use clear_multi, don't call init twice
This commit is contained in:
@@ -119,9 +119,7 @@ ltm_dh_generate_key(DH *dh)
|
|||||||
|
|
||||||
res = mp_exptmod(&g, &priv_key, &p, &pub);
|
res = mp_exptmod(&g, &priv_key, &p, &pub);
|
||||||
|
|
||||||
mp_clear(&priv_key);
|
mp_clear_multi(&priv_key, &g, &p, NULL);
|
||||||
mp_clear(&g);
|
|
||||||
mp_clear(&p);
|
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -175,8 +173,6 @@ ltm_dh_compute_key(unsigned char *shared, const BIGNUM * pub, DH *dh)
|
|||||||
|
|
||||||
BN2mpz(&priv_key, dh->priv_key);
|
BN2mpz(&priv_key, dh->priv_key);
|
||||||
|
|
||||||
mp_init(&s);
|
|
||||||
|
|
||||||
ret = mp_exptmod(&peer_pub, &priv_key, &p, &s);
|
ret = mp_exptmod(&peer_pub, &priv_key, &p, &s);
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
Reference in New Issue
Block a user