Guard curve448 shared secret software path on ret so the cryptocb reset is read

pull/11209/head
night1rider 2026-08-20 13:53:20 -06:00
parent 5dd72727cb
commit 51975e27a5
1 changed files with 6 additions and 4 deletions

View File

@ -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;