aboutsummaryrefslogtreecommitdiff
path: root/net/umurmur/patches
diff options
context:
space:
mode:
authorEneas U de Queiroz <cote2004-github@yahoo.com>2018-06-08 12:08:22 -0300
committerEneas U de Queiroz <cote2004-github@yahoo.com>2018-06-08 12:08:22 -0300
commit87b713520196053a196a4cc64ef67459be45b0d4 (patch)
tree8e093b578d4eec40122c01eec7c402a9d8cdb9a0 /net/umurmur/patches
parent2cfe32d7dd74a28178e7959f1d55bc7d1acd1113 (diff)
umurmur: update to version 0.2.17
This version supports openssl-1.1. Added a patch to update openssl 1.1 deprecated API. Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
Diffstat (limited to 'net/umurmur/patches')
-rw-r--r--net/umurmur/patches/0001-Update-openssl-1.1-deprecated-API.patch103
-rw-r--r--net/umurmur/patches/010-mbedtls_fix_includes.patch11
2 files changed, 103 insertions, 11 deletions
diff --git a/net/umurmur/patches/0001-Update-openssl-1.1-deprecated-API.patch b/net/umurmur/patches/0001-Update-openssl-1.1-deprecated-API.patch
new file mode 100644
index 000000000..9ccfdb7cc
--- /dev/null
+++ b/net/umurmur/patches/0001-Update-openssl-1.1-deprecated-API.patch
@@ -0,0 +1,103 @@
+From 45a0a33aea1878c467c380562d6e38b3e4c713a9 Mon Sep 17 00:00:00 2001
+From: Eneas U de Queiroz <cote2004-github@yahoo.com>
+Date: Fri, 8 Jun 2018 11:59:04 -0300
+Subject: [PATCH] Update openssl 1.1 deprecated API
+
+Allows building with openssl 1.1 compiled without deprecated API support.
+
+Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
+---
+ src/ssli_openssl.c | 27 ++++++++++++++++++++++++---
+ 1 file changed, 24 insertions(+), 3 deletions(-)
+
+diff --git a/src/ssli_openssl.c b/src/ssli_openssl.c
+index 8ff1bcf..4f7979c 100644
+--- a/src/ssli_openssl.c
++++ b/src/ssli_openssl.c
+@@ -42,6 +42,8 @@
+
+ #include <openssl/x509v3.h>
+ #include <openssl/ssl.h>
++#include <openssl/rsa.h>
++#include <openssl/bn.h>
+ #include <openssl/err.h>
+ #include <openssl/safestack.h>
+ static X509 *x509;
+@@ -159,6 +161,7 @@ static void SSL_initializeCert() {
+
+ char *crt = (char *)getStrConf(CERTIFICATE);
+ char *key = (char *)getStrConf(KEY);
++ BIGNUM *e = NULL;
+
+ if (context) {
+ bool_t did_load_cert = SSL_CTX_use_certificate_chain_file(context, crt);
+@@ -172,13 +175,24 @@ static void SSL_initializeCert() {
+
+ x509 = X509_new();
+ pkey = EVP_PKEY_new();
+- rsa = RSA_generate_key(4096,RSA_F4,NULL,NULL);
++ rsa = RSA_new();
++ e = BN_new();
++ if (x509 == NULL || pkey == NULL || rsa == NULL || e == NULL || !BN_set_word(e, RSA_F4) ||
++ !RSA_generate_key_ex (rsa, 4096, e, NULL)) {
++ Log_fatal("Failed to Generate RSA key.");
++ }
++ BN_free(e);
+ EVP_PKEY_assign_RSA(pkey, rsa);
+
+ X509_set_version(x509, 2);
+ ASN1_INTEGER_set(X509_get_serialNumber(x509),1);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ X509_gmtime_adj(X509_get_notBefore(x509),0);
+ X509_gmtime_adj(X509_get_notAfter(x509),60*60*24*365);
++#else
++ X509_gmtime_adj(X509_getm_notBefore(x509),0);
++ X509_gmtime_adj(X509_getm_notAfter(x509),60*60*24*365);
++#endif
+ X509_set_pubkey(x509, pkey);
+
+ X509_NAME *name=X509_get_subject_name(x509);
+@@ -214,9 +228,10 @@ void SSLi_init(void)
+ SSL *ssl;
+ int i, offset = 0, cipherstringlen = 0;
+ STACK_OF(SSL_CIPHER) *cipherlist = NULL, *cipherlist_new = NULL;
+- SSL_CIPHER *cipher;
++ const SSL_CIPHER *cipher;
+ char *cipherstring;
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ SSL_library_init();
+ OpenSSL_add_all_algorithms();
+ SSL_load_error_strings();
+@@ -225,13 +240,17 @@ void SSLi_init(void)
+ context = SSL_CTX_new(SSLv23_server_method());
+ SSL_CTX_set_options(context, SSL_OP_NO_SSLv2);
+ SSL_CTX_set_options(context, SSL_OP_NO_SSLv3);
+- SSL_CTX_set_options(context, SSL_OP_CIPHER_SERVER_PREFERENCE);
++#else
++ context = SSL_CTX_new(TLS_server_method());
++ SSL_CTX_set_min_proto_version(context, TLS1_VERSION);
++#endif
+ if (context == NULL)
+ {
+ ERR_print_errors_fp(stderr);
+ abort();
+ }
+
++ SSL_CTX_set_options(context, SSL_OP_CIPHER_SERVER_PREFERENCE);
+ SSL_CTX_set_cipher_list(context, ciphers);
+
+ EC_KEY *ecdhkey = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
+@@ -290,7 +309,9 @@ void SSLi_init(void)
+ void SSLi_deinit(void)
+ {
+ SSL_CTX_free(context);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_cleanup();
++#endif
+ }
+
+ int SSLi_nonblockaccept(SSL_handle_t *ssl, bool_t *SSLready)
+--
+2.16.4
+
diff --git a/net/umurmur/patches/010-mbedtls_fix_includes.patch b/net/umurmur/patches/010-mbedtls_fix_includes.patch
deleted file mode 100644
index 619517f3d..000000000
--- a/net/umurmur/patches/010-mbedtls_fix_includes.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/ssl.h
-+++ b/src/ssl.h
-@@ -90,7 +90,7 @@ typedef ssl_context SSL_handle_t;
-
- #elif defined(USE_MBEDTLS)
- #include <mbedtls/ssl.h>
--#include <mbedtls/net.h>
-+#include <mbedtls/net_sockets.h>
- #include <mbedtls/version.h>
-
- #if defined(MBEDTLS_VERSION_MAJOR)