Skip to content

Commit 0ef8541

Browse files
committed
validate hashAlgSz is within bounds before calling XMEMCPY
1 parent d6c8e7b commit 0ef8541

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7846,6 +7846,9 @@ word32 wc_EncodeRsaPssAlgoId(int hashOID, int saltLen, byte* out, word32 outSz)
78467846
if (outSz < outerSz) {
78477847
idx = 0; goto pss_algoid_done;
78487848
}
7849+
if (hashAlgSz > RSA_PSS_ALGOID_TMPBUF_SZ) {
7850+
idx = 0; goto pss_algoid_done;
7851+
}
78497852

78507853
{
78517854
word32 idPart = (word32)SetObjectId((int)rsapssOidSz, NULL) + rsapssOidSz;

0 commit comments

Comments
 (0)