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 d6e92c0bd6)
This commit is contained in:
@@ -533,9 +533,9 @@ static int run_rfc5114_tests(void)
|
|||||||
* Work out shared secrets using both sides and compare with expected
|
* Work out shared secrets using both sides and compare with expected
|
||||||
* values.
|
* values.
|
||||||
*/
|
*/
|
||||||
if (!DH_compute_key(Z1, dhB->pub_key, dhA))
|
if (DH_compute_key(Z1, dhB->pub_key, dhA) == -1)
|
||||||
goto bad_err;
|
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;
|
goto bad_err;
|
||||||
|
|
||||||
if (memcmp(Z1, td->Z, td->Z_len))
|
if (memcmp(Z1, td->Z, td->Z_len))
|
||||||
|
|||||||
Reference in New Issue
Block a user