summaryrefslogtreecommitdiffstats
path: root/crypto/dh
diff options
context:
space:
mode:
authorPascal Cuoq <cuoq@trust-in-soft.com>2015-05-06 09:55:28 +0200
committerKurt Roeckx <kurt@roeckx.be>2015-10-07 20:36:46 +0200
commit738b8e6bc2331ae9230411d88b8a100614f80457 (patch)
tree1cdc15c734be70f08c8a848b566c7febebdab31c /crypto/dh
parent6481be7346baea1ce0dcfe0a1ff28b0f44e9ce31 (diff)
Properly check return type of DH_compute_key()
It returns -1 on error, not 0. Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> MR #1231 (cherry picked from commit d6e92c0bd6c36fc68291e79ef5753fd7f0420695)
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/dhtest.c4
1 files changed, 2 insertions, 2 deletions
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))