Return -1 dh_compute_key on failure, pointed out by Olga Kornievskaia.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18639 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -134,7 +134,7 @@ dh_compute_key(unsigned char *shared, const BIGNUM * pub, DH *dh)
|
||||
mp_result res;
|
||||
|
||||
if (dh->pub_key == NULL || dh->g == NULL || dh->priv_key == NULL)
|
||||
return 0;
|
||||
return -1;
|
||||
|
||||
mp_int_init(&p);
|
||||
BN2mpz(&p, dh->p);
|
||||
@@ -149,7 +149,7 @@ dh_compute_key(unsigned char *shared, const BIGNUM * pub, DH *dh)
|
||||
{
|
||||
mp_int_clear(&p);
|
||||
mp_int_clear(&peer_pub);
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
mp_int_init(&priv_key);
|
||||
|
Reference in New Issue
Block a user