[packages/pathfinder] - openssl-1.1 buildfixes, add missing cstring include

adamg adamg at pld-linux.org
Thu Sep 27 10:35:57 CEST 2018


commit 66a8a7d4393116f428307fc2b9f70b0787f58827
Author: Adam Gołębiowski <adamg at pld-linux.org>
Date:   Thu Sep 27 10:35:48 2018 +0200

    - openssl-1.1 buildfixes, add missing cstring include

 pathfinder-includes.patch | 11 +++++++++++
 pathfinder-openssl.patch  | 44 ++++++++++++++++++++++++++++++++++++++++++++
 pathfinder.spec           |  6 +++++-
 3 files changed, 60 insertions(+), 1 deletion(-)
---
diff --git a/pathfinder.spec b/pathfinder.spec
index 4f37d78..1a8f8aa 100644
--- a/pathfinder.spec
+++ b/pathfinder.spec
@@ -6,7 +6,7 @@ Summary:	PathFinder PKI Path Discovery and Validation Daemon
 Summary(pl.UTF-8):	PathFinder - demon do rozpoznawania i sprawdzania poprawności ścieżek PKI
 Name:		pathfinder
 Version:	1.1.7
-Release:	2.1
+Release:	3
 License:	LGPL v2.1 or BSD (libraries), LGPL v2.1 (programs)
 Group:		Libraries
 #Source0Download: http://code.google.com/p/pathfinder-pki/downloads/list
@@ -19,6 +19,8 @@ Patch0:		%{name}-c++.patch
 Patch1:		%{name}-link.patch
 Patch2:		%{name}-libdir.patch
 Patch3:		%{name}-shared_ptr.patch
+Patch4:		%{name}-includes.patch
+Patch5:		%{name}-openssl.patch
 URL:		http://code.google.com/p/pathfinder-pki/
 BuildRequires:	cmake >= 2.4.7
 BuildRequires:	dbus-devel >= 1
@@ -178,6 +180,8 @@ Statyczna biblioteka wtyczki PathFinder dla OpenSSL.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 %build
 # out-of-tree build is broken (missing -I$builddir)
diff --git a/pathfinder-includes.patch b/pathfinder-includes.patch
new file mode 100644
index 0000000..ca96813
--- /dev/null
+++ b/pathfinder-includes.patch
@@ -0,0 +1,11 @@
+diff -bur pathfinder-1.1.7.orig/openssltest.cc pathfinder-1.1.7/openssltest.cc
+--- pathfinder-1.1.7.orig/openssltest.cc	2012-01-03 19:04:40.000000000 +0100
++++ pathfinder-1.1.7/openssltest.cc	2018-09-26 17:04:23.240198966 +0200
+@@ -20,6 +20,7 @@
+ #include <openssl/pkcs12.h>
+ #include <openssl/x509v3.h>
+ #include <assert.h>
++#include <cstring>
+ 
+ #ifdef APPLE
+ #include <strings.h>
diff --git a/pathfinder-openssl.patch b/pathfinder-openssl.patch
new file mode 100644
index 0000000..d1d4393
--- /dev/null
+++ b/pathfinder-openssl.patch
@@ -0,0 +1,44 @@
+diff -bur pathfinder-1.1.7.orig/libpathfinder/libpathfinder-openssl.cc pathfinder-1.1.7/libpathfinder/libpathfinder-openssl.cc
+--- pathfinder-1.1.7.orig/libpathfinder/libpathfinder-openssl.cc	2012-01-03 19:04:40.000000000 +0100
++++ pathfinder-1.1.7/libpathfinder/libpathfinder-openssl.cc	2018-09-26 17:03:47.638343422 +0200
+@@ -19,10 +19,10 @@
+ 
+ int openssl_verify_cb(X509_STORE_CTX *ctx, void *arg)
+ {
+-    size_t size = i2d_X509(ctx->cert, NULL);
++    size_t size = i2d_X509(X509_STORE_CTX_get0_cert(ctx), NULL);
+     unsigned char *keybuf, *iend;
+     iend = keybuf = new unsigned char[size];
+-    i2d_X509(ctx->cert, &iend);
++    i2d_X509(X509_STORE_CTX_get0_cert(ctx), &iend);
+     char *certdata_str = new char[(size * 2 + 1)];
+     unsigned char *cp = keybuf;
+     char *certdata_str_i = certdata_str;
+diff -bur pathfinder-1.1.7.orig/util.cc pathfinder-1.1.7/util.cc
+--- pathfinder-1.1.7.orig/util.cc	2012-01-03 19:04:40.000000000 +0100
++++ pathfinder-1.1.7/util.cc	2018-09-26 17:00:04.173362564 +0200
+@@ -45,7 +45,7 @@
+ bool is_md(shared_ptr<WvX509> &x509)
+ {	
+     X509 *cert = x509->get_cert();
+-    int alg = OBJ_obj2nid(cert->sig_alg->algorithm);
++    int alg = X509_get_signature_nid(cert);
+     
+     if (alg == NID_md5WithRSAEncryption || alg == NID_md2WithRSAEncryption)
+         return true;
+@@ -56,10 +57,13 @@
+ size_t get_keysize(shared_ptr<WvX509> &x509)
+ {
+     EVP_PKEY *p = X509_get_pubkey(x509->get_cert());
++    const BIGNUM *rsa_n;
+ 
+     // FIXME: this only supports RSA for now.
+-    if (p && p->type == EVP_PKEY_RSA)
+-        return BN_num_bits(p->pkey.rsa->n);
++    if (p && EVP_PKEY_base_id(p) == EVP_PKEY_RSA) {
++	RSA_get0_key( EVP_PKEY_get0_RSA(p), &rsa_n, NULL, NULL);
++	return BN_num_bits(rsa_n);
++    }
+     return 0;
+ }
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/pathfinder.git/commitdiff/66a8a7d4393116f428307fc2b9f70b0787f58827



More information about the pld-cvs-commit mailing list