diff options
Diffstat (limited to 'meta-oe/recipes-extended/openwsman/openwsman/0001-openSSL-1.1.0-API-fixes.patch')
-rw-r--r-- | meta-oe/recipes-extended/openwsman/openwsman/0001-openSSL-1.1.0-API-fixes.patch | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/openwsman/openwsman/0001-openSSL-1.1.0-API-fixes.patch b/meta-oe/recipes-extended/openwsman/openwsman/0001-openSSL-1.1.0-API-fixes.patch new file mode 100644 index 000000000..8d230ba6d --- /dev/null +++ b/meta-oe/recipes-extended/openwsman/openwsman/0001-openSSL-1.1.0-API-fixes.patch | |||
@@ -0,0 +1,77 @@ | |||
1 | From 634b95157e1823672a2c95fac0cecf079b5967e7 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de> | ||
3 | Date: Mon, 19 Nov 2018 15:31:27 +0100 | ||
4 | Subject: [PATCH] openSSL 1.1.0 API fixes | ||
5 | |||
6 | --- | ||
7 | src/server/shttpd/io_ssl.c | 5 +++++ | ||
8 | src/server/shttpd/shttpd.c | 11 ++++++++++- | ||
9 | src/server/shttpd/ssl.h | 3 +++ | ||
10 | 3 files changed, 18 insertions(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/src/server/shttpd/io_ssl.c b/src/server/shttpd/io_ssl.c | ||
13 | index 6de0db2a..ece610ef 100644 | ||
14 | --- a/src/server/shttpd/io_ssl.c | ||
15 | +++ b/src/server/shttpd/io_ssl.c | ||
16 | @@ -21,8 +21,13 @@ struct ssl_func ssl_sw[] = { | ||
17 | {"SSL_set_fd", {0}}, | ||
18 | {"SSL_new", {0}}, | ||
19 | {"SSL_CTX_new", {0}}, | ||
20 | +#if OPENSSL_VERSION_NUMBER < 0x10100000L | ||
21 | {"SSLv23_server_method", {0}}, | ||
22 | {"SSL_library_init", {0}}, | ||
23 | +#else | ||
24 | + {"TLS_server_method", {0}}, | ||
25 | + {"OPENSSL_init_ssl", {0}}, | ||
26 | +#endif | ||
27 | {"SSL_CTX_use_PrivateKey_file", {0}}, | ||
28 | {"SSL_CTX_use_certificate_file",{0}}, | ||
29 | {NULL, {0}} | ||
30 | diff --git a/src/server/shttpd/shttpd.c b/src/server/shttpd/shttpd.c | ||
31 | index f0f3fbd8..652aea17 100644 | ||
32 | --- a/src/server/shttpd/shttpd.c | ||
33 | +++ b/src/server/shttpd/shttpd.c | ||
34 | @@ -1489,9 +1489,14 @@ set_ssl(struct shttpd_ctx *ctx, const char *pem) | ||
35 | } | ||
36 | |||
37 | /* Initialize SSL crap */ | ||
38 | - SSL_library_init(); | ||
39 | |||
40 | +#if OPENSSL_VERSION_NUMBER < 0x10100000L | ||
41 | + SSL_library_init(); | ||
42 | if ((CTX = SSL_CTX_new(SSLv23_server_method())) == NULL) | ||
43 | +#else | ||
44 | + OPENSSL_init_ssl(); | ||
45 | + if ((CTX = SSL_CTX_new(TLS_server_method())) == NULL) | ||
46 | +#endif | ||
47 | _shttpd_elog(E_LOG, NULL, "SSL_CTX_new error"); | ||
48 | else if (SSL_CTX_use_certificate_file(CTX, wsmand_options_get_ssl_cert_file(), SSL_FILETYPE_PEM) != 1) | ||
49 | _shttpd_elog(E_LOG, NULL, "cannot open certificate file %s", pem); | ||
50 | @@ -1552,6 +1557,10 @@ set_ssl(struct shttpd_ctx *ctx, const char *pem) | ||
51 | if (rc != 1) { | ||
52 | _shttpd_elog(E_LOG, NULL, "Failed to set SSL cipher list \"%s\"", ssl_cipher_list); | ||
53 | } | ||
54 | + else if ((*ssl_cipher_list == 0) || (*ssl_cipher_list == ' ')) { | ||
55 | + _shttpd_elog(E_LOG, NULL, "Empty 'ssl_cipher_list' defaults to 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256'."); | ||
56 | + _shttpd_elog(E_LOG, NULL, "Check openSSL documentation."); | ||
57 | + } | ||
58 | } | ||
59 | ctx->ssl_ctx = CTX; | ||
60 | |||
61 | diff --git a/src/server/shttpd/ssl.h b/src/server/shttpd/ssl.h | ||
62 | index 2304b70a..89a73c49 100644 | ||
63 | --- a/src/server/shttpd/ssl.h | ||
64 | +++ b/src/server/shttpd/ssl.h | ||
65 | @@ -56,6 +56,9 @@ extern struct ssl_func ssl_sw[]; | ||
66 | #if OPENSSL_VERSION_NUMBER < 0x10100000L | ||
67 | #define SSLv23_server_method() (* (SSL_METHOD * (*)(void)) FUNC(9))() | ||
68 | #define SSL_library_init() (* (int (*)(void)) FUNC(10))() | ||
69 | +#else | ||
70 | +#define TLS_server_method() (* (SSL_METHOD * (*)(void)) FUNC(9))() | ||
71 | +#define OPENSSL_init_ssl() (* (int (*)(void)) FUNC(10))() | ||
72 | #endif | ||
73 | #define SSL_CTX_use_PrivateKey_file(x,y,z) (* (int (*)(SSL_CTX *, \ | ||
74 | const char *, int)) FUNC(11))((x), (y), (z)) | ||
75 | -- | ||
76 | 2.19.1 | ||
77 | |||