mirror of https://github.com/wolfSSL/wolfssl.git
Fixup from review
parent
24cd46f1f1
commit
09bae9da3e
|
@ -2585,7 +2585,7 @@ static int wc_ecc_shared_secret_gen_sync(ecc_key* private_key, ecc_point* point,
|
|||
|
||||
/* if cofactor flag has been set */
|
||||
if (private_key->flags & WC_ECC_FLAG_COFACTOR) {
|
||||
int cofactor = private_key->dp->cofactor;
|
||||
mp_digit cofactor = (mp_digit)private_key->dp->cofactor;
|
||||
/* only perform cofactor calc if not equal to 1 */
|
||||
if (cofactor != 1) {
|
||||
k = &k_lcl;
|
||||
|
@ -2604,7 +2604,10 @@ static int wc_ecc_shared_secret_gen_sync(ecc_key* private_key, ecc_point* point,
|
|||
/* make new point */
|
||||
result = wc_ecc_new_point_h(private_key->heap);
|
||||
if (result == NULL) {
|
||||
mp_clear(k);
|
||||
#ifdef HAVE_ECC_CDH
|
||||
if (k == &k_lcl)
|
||||
mp_clear(k);
|
||||
#endif
|
||||
return MEMORY_E;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue