Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 75669b077bd54bedbc086c60cbe137e7f4c685b5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Vitezslav Crhonek <vcrhonek@redhat.com> |
| 3 | Date: Mon, 24 Apr 2017 11:28:39 +0200 |
| 4 | Subject: [PATCH 2/2] Check OpenSSL version number to allow builds with older |
| 5 | version |
| 6 | |
| 7 | Upstream-Status: Submitted [https://github.com/Openwsman/openwsman/pull/99] |
| 8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 9 | --- |
| 10 | src/lib/wsman-curl-client-transport.c | 4 ++++ |
| 11 | src/server/shttpd/shttpd.c | 4 ++++ |
| 12 | 2 files changed, 8 insertions(+) |
| 13 | |
| 14 | diff --git a/src/lib/wsman-curl-client-transport.c b/src/lib/wsman-curl-client-transport.c |
| 15 | index e64ad097..4fc047e8 100644 |
| 16 | --- a/src/lib/wsman-curl-client-transport.c |
| 17 | +++ b/src/lib/wsman-curl-client-transport.c |
| 18 | @@ -247,7 +247,11 @@ static int ssl_certificate_thumbprint_verify_callback(X509_STORE_CTX *ctx, void |
| 19 | unsigned int tempFingerprintLen; |
| 20 | tempDigest = (EVP_MD*)EVP_sha1( ); |
| 21 | |
| 22 | + #if OPENSSL_VERSION_NUMBER < 0x10100000L |
| 23 | + X509 *cert = ctx->cert; |
| 24 | + #else |
| 25 | X509 *cert = X509_STORE_CTX_get_current_cert(ctx); |
| 26 | + #endif |
| 27 | if(!cert) |
| 28 | return 0; |
| 29 | |
| 30 | diff --git a/src/server/shttpd/shttpd.c b/src/server/shttpd/shttpd.c |
| 31 | index 4c1dbf32..161720c8 100644 |
| 32 | --- a/src/server/shttpd/shttpd.c |
| 33 | +++ b/src/server/shttpd/shttpd.c |
| 34 | @@ -1526,7 +1526,11 @@ set_ssl(struct shttpd_ctx *ctx, const char *pem) |
| 35 | if (strncasecmp(protocols[idx].name, ssl_disabled_protocols, blank_ptr-ssl_disabled_protocols) == 0) { |
| 36 | //_shttpd_elog(E_LOG, NULL, "SSL: disable %s protocol", protocols[idx].name); |
| 37 | debug("SSL: disable %s protocol", protocols[idx].name); |
| 38 | + #if OPENSSL_VERSION_NUMBER < 0x10100000L |
| 39 | + SSL_CTX_ctrl(CTX, SSL_CTRL_OPTIONS, protocols[idx].opt, NULL); |
| 40 | + #else |
| 41 | SSL_CTX_set_options(CTX, protocols[idx].opt); |
| 42 | + #endif |
| 43 | break; |
| 44 | } |
| 45 | } |
| 46 | -- |
| 47 | 2.18.0 |
| 48 | |