mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Sanity check key sizes
This commit is contained in:
@ -615,6 +615,9 @@ int wc_SrpComputeKey(Srp* srp, byte* clientPubKey, word32 clientPubKeySz,
|
||||
digestSz = SrpHashSize(srp->type);
|
||||
secretSz = mp_unsigned_bin_size(&srp->N);
|
||||
|
||||
if ((secretSz < clientPubKeySz) || (secretSz < serverPubKeySz))
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if ((secret = (byte*)XMALLOC(secretSz, srp->heap, DYNAMIC_TYPE_SRP)) ==NULL)
|
||||
return MEMORY_E;
|
||||
|
||||
|
Reference in New Issue
Block a user