summaryrefslogtreecommitdiffstats
path: root/common/ssl_calls.c
diff options
context:
space:
mode:
authorDominik George <nik@naturalnet.de>2016-10-27 22:40:48 +0200
committerDominik George <nik@naturalnet.de>2016-10-27 22:40:48 +0200
commite5cf45d1ac7766540f8bb328c350a4866c63b02a (patch)
treee957b461ae768f5d7d5f3c1a0d90bf680b805793 /common/ssl_calls.c
parent1b5fb8f1c818ea7ba958f44bbd06f59dac0328d7 (diff)
downloadxrdp-proprietary-e5cf45d1ac7766540f8bb328c350a4866c63b02a.tar.gz
xrdp-proprietary-e5cf45d1ac7766540f8bb328c350a4866c63b02a.zip
Add backwards compatibility to OpenSSL < 1.1.0.
Diffstat (limited to 'common/ssl_calls.c')
-rw-r--r--common/ssl_calls.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/ssl_calls.c b/common/ssl_calls.c
index fc2db742..e7ca83ce 100644
--- a/common/ssl_calls.c
+++ b/common/ssl_calls.c
@@ -247,7 +247,12 @@ ssl_hmac_info_create(void)
{
HMAC_CTX *hmac_ctx;
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
hmac_ctx = HMAC_CTX_new();
+#else
+ hmac_ctx = (HMAC_CTX *) g_malloc(sizeof(HMAC_CTX), 1);
+ HMAC_CTX_init(hmac_ctx);
+#endif
return hmac_ctx;
}
@@ -260,7 +265,12 @@ ssl_hmac_info_delete(void *hmac)
hmac_ctx = (HMAC_CTX *) hmac;
if (hmac_ctx != 0)
{
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
HMAC_CTX_free(hmac_ctx);
+#else
+ HMAC_CTX_cleanup(hmac_ctx);
+ g_free(hmac_ctx);
+#endif
}
}
@@ -491,7 +501,12 @@ ssl_gen_key_xrdp1(int key_size_in_bits, char *exp, int exp_len,
const BIGNUM *n;
const BIGNUM *d;
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
RSA_get0_key(my_key, &n, NULL, &d);
+#else
+ n = my_key->n;
+ d = my_key->d;
+#endif
if (error == 0)
{