Browse Source

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>
lilik-openwrt-22.03
Eneas U de Queiroz 7 years ago
parent
commit
87b7135201
3 changed files with 106 additions and 14 deletions
  1. +3
    -3
      net/umurmur/Makefile
  2. +103
    -0
      net/umurmur/patches/0001-Update-openssl-1.1-deprecated-API.patch
  3. +0
    -11
      net/umurmur/patches/010-mbedtls_fix_includes.patch

+ 3
- 3
net/umurmur/Makefile View File

@ -5,15 +5,15 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=umurmur PKG_NAME:=umurmur
PKG_VERSION:=0.2.16-20161126
PKG_VERSION:=0.2.17
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_MIRROR_HASH:=d41db898c826077735d48ec1d1ff9ed200d6520f46ae3dbb0a89dfaad49310cd
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/umurmur/umurmur.git PKG_SOURCE_URL:=https://github.com/umurmur/umurmur.git
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=fac630135664fda26338d403041b6b6e558a2d6b
PKG_MIRROR_HASH:=6773aebea9aea355a41425e946291bb47bc399f85483bd6532cf26dfc7c801e5
PKG_SOURCE_VERSION:=c4f6b1f6d27f7d7a556d30aedee73a675b5a6c48
PKG_INSTALL:=1 PKG_INSTALL:=1
PKG_FIXUP:=autoreconf PKG_FIXUP:=autoreconf


+ 103
- 0
net/umurmur/patches/0001-Update-openssl-1.1-deprecated-API.patch View File

@ -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

+ 0
- 11
net/umurmur/patches/010-mbedtls_fix_includes.patch View File

@ -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)

Loading…
Cancel
Save