From 2f0db137c5df752d815c7a20121f54530ac970b8 Mon Sep 17 00:00:00 2001 From: Markus Volk Date: Sat, 16 Feb 2019 06:47:12 +0100 Subject: [PATCH] fix commit: fix for build with openssl 1.1 1ce6f8c6299740b6c27ca070bc8779702587cfa1 Signed-off-by: Markus Volk Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/45964f793ac16798ac05efe63ea7500994018bfd Author: Markus Volk Date: 2019-02-16 (Sat, 16 Feb 2019) ------------------ This commit was generated by Migit --- libdvbci/dh_rsa_misc.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libdvbci/dh_rsa_misc.cpp b/libdvbci/dh_rsa_misc.cpp index fe2e16b..5b6be9b 100644 --- a/libdvbci/dh_rsa_misc.cpp +++ b/libdvbci/dh_rsa_misc.cpp @@ -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);