mirror of https://github.com/wolfSSL/wolfssl.git
Guard curve448 shared secret software path on ret so the cryptocb reset is read
parent
5dd72727cb
commit
51975e27a5
|
|
@ -384,7 +384,9 @@ int wc_curve448_shared_secret_ex(curve448_key* private_key,
|
|||
|
||||
#ifdef WOLF_CRYPTO_CB_ONLY_CURVE448
|
||||
/* software path stripped; callback is the only provider */
|
||||
ret = NO_VALID_DEVID;
|
||||
if (ret == 0) {
|
||||
ret = NO_VALID_DEVID;
|
||||
}
|
||||
#else
|
||||
#ifdef WOLFSSL_CHECK_MEM_ZERO
|
||||
/* Register the buffer after the early returns so every later path
|
||||
|
|
@ -393,9 +395,9 @@ int wc_curve448_shared_secret_ex(curve448_key* private_key,
|
|||
wc_MemZero_Add("wc_curve448_shared_secret_ex o", o, CURVE448_PUB_KEY_SIZE);
|
||||
#endif
|
||||
|
||||
/* ret is 0 here: the argument checks return early and the cryptocb block
|
||||
* either returns or resets it. */
|
||||
ret = curve448(o, private_key->k, public_key->p);
|
||||
if (ret == 0) {
|
||||
ret = curve448(o, private_key->k, public_key->p);
|
||||
}
|
||||
#ifndef WOLFSSL_NO_ECDHX_SHARED_ZERO_CHECK
|
||||
if (ret == 0) {
|
||||
byte t = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue