Sanity check key sizes

This commit is contained in:
Eric Blankenhorn
2020-08-04 15:02:44 -05:00
parent 8d00b015c1
commit 50647ccdb1

View File

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