--- distcache-1.5.1/ssl/acinclude.m4.openssl11 2004-04-20 20:51:50.000000000 +0200 +++ distcache-1.5.1/ssl/acinclude.m4 2017-09-09 07:52:47.167238373 +0200 @@ -100,7 +100,7 @@ LDFLAGS="$LDFLAGS -L$dc_ssltk_lib" fi liberrors="" - AC_CHECK_LIB(crypto, SSLeay_version, [], [liberrors="yes"]) + AC_CHECK_LIB(crypto, OpenSSL_version_num, [], [liberrors="yes"]) AC_CHECK_LIB(ssl, SSL_CTX_new, [], [liberrors="yes"]) if test "x$liberrors" != "x"; then AC_MSG_ERROR([... Error, SSL/TLS libraries were missing or unusable]) --- distcache-1.5.1/ssl/libnalssl/bss_nal.c.openssl11 2004-05-27 22:54:48.000000000 +0200 +++ distcache-1.5.1/ssl/libnalssl/bss_nal.c 2017-10-15 23:27:08.535822978 +0200 @@ -41,26 +41,27 @@ static int NAL_bio_new(BIO *); static int NAL_bio_free(BIO *); -static BIO_METHOD NAL_bio_meth = { - BIO_TYPE_BIO, - "NAL_CONNECTION", - NAL_bio_write, - NAL_bio_read, - NAL_bio_puts, - NULL, /* bgets */ - NAL_bio_ctrl, - NAL_bio_new, - NAL_bio_free, - NULL /* callback_ctrl */ -}; +static BIO_METHOD * NAL_bio_meth; BIO *BIO_new_NAL_CONNECTION(NAL_CONNECTION *c) { - BIO *b = BIO_new(&NAL_bio_meth); + if (NAL_bio_meth == NULL) + { + NAL_bio_meth = BIO_meth_new(BIO_TYPE_BIO, "NAL_CONNECTION"); + BIO_meth_set_write(NAL_bio_meth, NAL_bio_write); + BIO_meth_set_read(NAL_bio_meth, NAL_bio_read); + BIO_meth_set_puts(NAL_bio_meth, NAL_bio_puts); + /* bgets */ + BIO_meth_set_ctrl(NAL_bio_meth, NAL_bio_ctrl); + BIO_meth_set_create(NAL_bio_meth, NAL_bio_new); + BIO_meth_set_destroy(NAL_bio_meth, NAL_bio_free); + /* callback_ctrl */ + } + BIO *b = BIO_new(NAL_bio_meth); if(!b) return NULL; - b->ptr = c; - b->init = 1; - b->shutdown = 1; + BIO_set_data(b, c); + BIO_set_init(b, 1); + BIO_set_shutdown(b, 1); return b; } @@ -69,10 +70,10 @@ #ifdef NAL_BIO_DEBUG SYS_fprintf(SYS_stdout, "NAL_BIO_DEBUG: NAL_bio_new()\n"); #endif - b->init = 0; - b->num = -1; - b->ptr = NULL; - b->flags = 0; + BIO_set_init(b, 0); + //b->num = -1; + BIO_set_data(b, NULL); + BIO_set_flags(b, 0); return 1; } @@ -81,8 +82,8 @@ #ifdef NAL_BIO_DEBUG SYS_fprintf(SYS_stdout, "NAL_BIO_DEBUG: NAL_bio_free()\n"); #endif - if(b->shutdown && b->init && b->ptr) { - NAL_CONNECTION *c = b->ptr; + if(BIO_get_shutdown(b) && BIO_get_init(b) && BIO_get_data(b)) { + NAL_CONNECTION *c = BIO_get_data(b); NAL_CONNECTION_free(c); } return 1; @@ -91,7 +92,7 @@ static int NAL_bio_write(BIO *b, const char *ptr, int len) { unsigned int res; - NAL_CONNECTION *c = (NAL_CONNECTION *)b->ptr; + NAL_CONNECTION *c = (NAL_CONNECTION *)BIO_get_data(b); NAL_BUFFER *buf = NAL_CONNECTION_get_send(c); #ifdef NAL_BIO_DEBUG SYS_fprintf(SYS_stdout, "NAL_BIO_DEBUG: NAL_bio_write(%d)\n", len); @@ -109,7 +110,7 @@ static int NAL_bio_read(BIO *b, char *ptr, int len) { unsigned int res; - NAL_CONNECTION *c = (NAL_CONNECTION *)b->ptr; + NAL_CONNECTION *c = (NAL_CONNECTION *)BIO_get_data(b); NAL_BUFFER *buf = NAL_CONNECTION_get_read(c); #ifdef NAL_BIO_DEBUG SYS_fprintf(SYS_stdout, "NAL_BIO_DEBUG: NAL_bio_read(%d)\n", len); @@ -150,9 +151,9 @@ return 1; /* Commands */ case BIO_CTRL_GET_CLOSE: - return b->shutdown; + return BIO_get_shutdown(b); case BIO_CTRL_SET_CLOSE: - b->shutdown = (int)num; + BIO_set_shutdown(b, (int)num); return 1; default: #ifdef NAL_BIO_DEBUG --- distcache-1.5.1/ssl/swamp/swamp.c.openssl11 2017-10-15 22:24:40.488582910 +0200 +++ distcache-1.5.1/ssl/swamp/swamp.c 2017-10-15 23:32:58.903582262 +0200 @@ -105,10 +105,6 @@ switch(config->sslmeth) { case SWAMP_SSLMETH_NORMAL: sslmethod = SSLv23_client_method(); break; -#ifndef OPENSSL_NO_SSL2 - case SWAMP_SSLMETH_SSLv2: - sslmethod = SSLv2_client_method(); break; -#endif case SWAMP_SSLMETH_SSLv3: sslmethod = SSLv3_client_method(); break; case SWAMP_SSLMETH_TLSv1: @@ -153,7 +149,7 @@ fp = NULL; } if(x509) { - if(!X509_STORE_add_cert(ctx->cert_store, x509)) + if(!X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx), x509)) return NULL; /* Reference counts */ X509_free(x509); @@ -446,13 +442,16 @@ } } if(ctx->config->output_sessions) { + unsigned int session_id_length; + unsigned char const * session_id; temp_session = SSL_get1_session(item->ssl); /* debug some stuff :-) */ SYS_fprintf(SYS_stderr, "session-id[conn:%i]:", loop); - for(tmp = 0; tmp < (int)temp_session->session_id_length; + session_id = SSL_SESSION_get_id(temp_session, &session_id_length); + for(tmp = 0; tmp < (int)session_id_length; tmp++) SYS_fprintf(SYS_stderr, "%02X", - temp_session->session_id[tmp]); + session_id[tmp]); SYS_fprintf(SYS_stderr, "\n"); SSL_SESSION_free(temp_session); }