Lines 1-41
Link Here
|
1 |
From 9f74e09373f3be7b77f510ef8b0ae2c887f7b325 Mon Sep 17 00:00:00 2001 |
|
|
2 |
From: Natanael Copa <ncopa@alpinelinux.org> |
3 |
Date: Tue, 4 Oct 2016 14:35:33 +0200 |
4 |
Subject: [PATCH] [280] Fix build with libressl |
5 |
|
6 |
Closes #280 |
7 |
|
8 |
Fix building with libressl which broke in commit fff741613 (Support for |
9 |
openssl 1.1.0). |
10 |
|
11 |
Bug: #280 |
12 |
|
13 |
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> |
14 |
--- |
15 |
lib/mosquitto_internal.h | 3 +++ |
1 |
lib/mosquitto_internal.h | 3 +++ |
16 |
src/mosquitto_passwd.c | 4 ++-- |
2 |
src/mosquitto_passwd.c | 4 ++-- |
17 |
src/security_default.c | 2 +- |
3 |
src/security_default.c | 2 +- |
18 |
3 files changed, 6 insertions(+), 3 deletions(-) |
4 |
3 files changed, 6 insertions(+), 3 deletions(-) |
19 |
|
5 |
|
20 |
diff --git lib/mosquitto_internal.h lib/mosquitto_internal.h |
6 |
--- src/mosquitto_passwd.c.orig 2017-07-10 22:46:01 UTC |
21 |
index 4b4cf85..700bbb0 100644 |
|
|
22 |
--- lib/mosquitto_internal.h |
23 |
+++ lib/mosquitto_internal.h |
24 |
@@ -25,6 +25,9 @@ and the Eclipse Distribution License is available at |
25 |
|
26 |
#ifdef WITH_TLS |
27 |
# include <openssl/ssl.h> |
28 |
+# if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) |
29 |
+# define HAVE_OPENSSL_OPAQUE_STRUCTS |
30 |
+# endif |
31 |
#else |
32 |
# include <time.h> |
33 |
#endif |
34 |
diff --git src/mosquitto_passwd.c src/mosquitto_passwd.c |
35 |
index de9a719..5b854d9 100644 |
36 |
--- src/mosquitto_passwd.c |
37 |
+++ src/mosquitto_passwd.c |
7 |
+++ src/mosquitto_passwd.c |
38 |
@@ -90,7 +90,7 @@ int output_new_password(FILE *fptr, const char *username, const char *password) |
8 |
@@ -90,7 +90,7 @@ int output_new_password(FILE *fptr, const char *userna |
39 |
unsigned char hash[EVP_MAX_MD_SIZE]; |
9 |
unsigned char hash[EVP_MAX_MD_SIZE]; |
40 |
unsigned int hash_len; |
10 |
unsigned int hash_len; |
41 |
const EVP_MD *digest; |
11 |
const EVP_MD *digest; |
Lines 44-50
index de9a719..5b854d9 100644
Link Here
|
44 |
EVP_MD_CTX context; |
14 |
EVP_MD_CTX context; |
45 |
#else |
15 |
#else |
46 |
EVP_MD_CTX *context; |
16 |
EVP_MD_CTX *context; |
47 |
@@ -117,7 +117,7 @@ int output_new_password(FILE *fptr, const char *username, const char *password) |
17 |
@@ -117,7 +117,7 @@ int output_new_password(FILE *fptr, const char *userna |
48 |
return 1; |
18 |
return 1; |
49 |
} |
19 |
} |
50 |
|
20 |
|
Lines 53-63
index de9a719..5b854d9 100644
Link Here
|
53 |
EVP_MD_CTX_init(&context); |
23 |
EVP_MD_CTX_init(&context); |
54 |
EVP_DigestInit_ex(&context, digest, NULL); |
24 |
EVP_DigestInit_ex(&context, digest, NULL); |
55 |
EVP_DigestUpdate(&context, password, strlen(password)); |
25 |
EVP_DigestUpdate(&context, password, strlen(password)); |
56 |
diff --git src/security_default.c src/security_default.c |
26 |
--- src/security_default.c.orig 2017-07-10 22:46:01 UTC |
57 |
index 64ca846..9ad8708 100644 |
|
|
58 |
--- src/security_default.c |
59 |
+++ src/security_default.c |
27 |
+++ src/security_default.c |
60 |
@@ -770,7 +770,7 @@ int mosquitto_psk_key_get_default(struct mosquitto_db *db, const char *hint, con |
28 |
@@ -790,7 +790,7 @@ int mosquitto_psk_key_get_default(struct mosquitto_db |
61 |
int _pw_digest(const char *password, const unsigned char *salt, unsigned int salt_len, unsigned char *hash, unsigned int *hash_len) |
29 |
int _pw_digest(const char *password, const unsigned char *salt, unsigned int salt_len, unsigned char *hash, unsigned int *hash_len) |
62 |
{ |
30 |
{ |
63 |
const EVP_MD *digest; |
31 |
const EVP_MD *digest; |
64 |
- |
|
|