fix commit: fix for build with openssl 1.1

1ce6f8c6299740b6c27ca070bc8779702587cfa1

Signed-off-by: Markus Volk <f_l_k@t-online.de>
Signed-off-by: Thilo Graf <dbt@novatux.de>


Origin commit data
------------------
Branch: master
Commit: 45964f793a
Author: Markus Volk <f_l_k@t-online.de>
Date: 2019-02-16 (Sat, 16 Feb 2019)



------------------
This commit was generated by Migit
This commit is contained in:
Markus Volk
2019-02-16 06:47:12 +01:00
committed by max_10
parent aae4198077
commit 2f0db137c5

View File

@@ -161,17 +161,18 @@ int dh_gen_exp(uint8_t *dest, int dest_len, uint8_t *dh_g, int dh_g_len, uint8_t
DH_generate_key(dh);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
len = BN_num_bytes(dh->priv_key);
#else
const BIGNUM *pub_key, *priv_key;
DH_get0_key(dh, &pub_key, &priv_key);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
len = BN_num_bytes(priv_key);
#else
#endif
if (len > dest_len) {
printf("len > dest_len\n");
return -1;
}
#endif
gap = dest_len - len;
memset(dest, 0, gap);