From: Pascal Cuoq Date: Wed, 6 May 2015 07:55:28 +0000 (+0200) Subject: Properly check return type of DH_compute_key() X-Git-Tag: OpenSSL_1_0_2e~61 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=738b8e6bc2331ae9230411d88b8a100614f80457;p=oweals%2Fopenssl.git Properly check return type of DH_compute_key() It returns -1 on error, not 0. Signed-off-by: Kurt Roeckx Reviewed-by: Rich Salz MR #1231 (cherry picked from commit d6e92c0bd6c36fc68291e79ef5753fd7f0420695) --- diff --git a/crypto/dh/dhtest.c b/crypto/dh/dhtest.c index c9dd76bc75..6fe8ff4c0c 100644 --- a/crypto/dh/dhtest.c +++ b/crypto/dh/dhtest.c @@ -533,9 +533,9 @@ static int run_rfc5114_tests(void) * Work out shared secrets using both sides and compare with expected * values. */ - if (!DH_compute_key(Z1, dhB->pub_key, dhA)) + if (DH_compute_key(Z1, dhB->pub_key, dhA) == -1) goto bad_err; - if (!DH_compute_key(Z2, dhA->pub_key, dhB)) + if (DH_compute_key(Z2, dhA->pub_key, dhB) == -1) goto bad_err; if (memcmp(Z1, td->Z, td->Z_len))