SHA256
1
0
forked from pool/scamper

Accepting request 546902 from network:utilities

- add patch new-openssl.patch to compile with new openssl versions

OBS-URL: https://build.opensuse.org/request/show/546902
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/scamper?expand=0&rev=3
This commit is contained in:
Dominique Leuenberger 2017-12-01 14:54:16 +00:00 committed by Git OBS Bridge
commit 06c7984544
3 changed files with 69 additions and 0 deletions

61
new-openssl.patch Normal file
View File

@ -0,0 +1,61 @@
Index: scamper/scamper_control.c
===================================================================
RCS file: /home/mjl/cvsroot/scamper/scamper/scamper_control.c,v
retrieving revision 1.194
diff -u -p -r1.194 scamper_control.c
--- scamper/scamper_control.c 12 Jul 2017 07:23:15 -0000 1.194
+++ scamper/scamper_control.c 30 Nov 2017 21:01:56 -0000
@@ -2495,6 +2495,7 @@ static int remote_sock_ssl_init(control_
* it is based on post_connection_check in "Network Security with
* OpenSSL" by John Viega, Matt Messier, and Pravir Chandra.
*/
+#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L
static int remote_sock_is_valid_cert(control_remote_t *rm)
{
X509 *cert = NULL;
@@ -2562,6 +2563,7 @@ static int remote_sock_is_valid_cert(con
if(cert != NULL) X509_free(cert);
return rc;
}
+#endif /* OpenSSL version < 1.1.0 */
#endif
/*
@@ -2963,8 +2965,10 @@ static int remote_read_sock(control_remo
if(SSL_is_init_finished(rm->ssl) != 0 ||
(rc = SSL_do_handshake(rm->ssl)) > 0)
{
+#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L
if(remote_sock_is_valid_cert(rm) == 0)
return -1;
+#endif
rm->mode = SSL_MODE_ESTABLISHED;
}
if(remote_sock_ssl_want_read(rm) < 0)
@@ -3296,6 +3300,11 @@ int scamper_control_add_remote(const cha
{
uint32_t u32;
+#if defined(HAVE_OPENSSL) && \
+ defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
+ X509_VERIFY_PARAM *param = NULL;
+#endif
+
if((ctrl_rem = malloc_zero(sizeof(control_remote_t))) == NULL ||
(ctrl_rem->list = dlist_alloc()) == NULL ||
(ctrl_rem->sq = scamper_queue_alloc(NULL)) == NULL)
@@ -3316,6 +3325,14 @@ int scamper_control_add_remote(const cha
}
SSL_CTX_set_options(tls_ctx,
SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1);
+
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
+ param = SSL_CTX_get0_param(tls_ctx);
+ X509_VERIFY_PARAM_set_hostflags(param,
+ X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
+ X509_VERIFY_PARAM_set1_host(param, name, 0);
+#endif
+
SSL_CTX_set_verify(tls_ctx, SSL_VERIFY_PEER, NULL);
/* load the default set of certs into the SSL context */

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Nov 30 21:22:24 UTC 2017 - sebix+novell.com@sebix.at
- add patch new-openssl.patch to compile with new openssl versions
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Aug 24 06:58:41 UTC 2017 - sebix+novell.com@sebix.at Thu Aug 24 06:58:41 UTC 2017 - sebix+novell.com@sebix.at

View File

@ -25,6 +25,8 @@ License: GPL-2.0
Group: Productivity/Networking/Diagnostic Group: Productivity/Networking/Diagnostic
Url: https://www.caida.org/tools/measurement/scamper/ Url: https://www.caida.org/tools/measurement/scamper/
Source: https://www.caida.org/tools/measurement/%{name}/code/%{name}-cvs-%{version}.tar.gz Source: https://www.caida.org/tools/measurement/%{name}/code/%{name}-cvs-%{version}.tar.gz
# PATCH-FIX-UPSTREAM new-openssl.patch -- from developer, new release will come soon
Patch0: new-openssl.patch
BuildRequires: libopenssl-devel BuildRequires: libopenssl-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
@ -73,6 +75,7 @@ libscamperfile library.
%prep %prep
%setup -q -n %{name}-cvs-%{version} %setup -q -n %{name}-cvs-%{version}
%patch0
%build %build
%configure --disable-static %configure --disable-static