mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 15:02:58 +02:00
fix commit: fix for build with openssl 1.1
1ce6f8c629
Signed-off-by: Markus Volk <f_l_k@t-online.de>
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user