mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
check PKCS7 content length is not larger than bundle if not using separate header/footer
This commit is contained in:
@ -4397,6 +4397,16 @@ static int PKCS7_VerifySignedData(PKCS7* pkcs7, const byte* hashBuf,
|
||||
/* support using header and footer without content */
|
||||
if (pkiMsg2 && pkiMsg2Sz > 0 && hashBuf && hashSz > 0) {
|
||||
localIdx = 0;
|
||||
|
||||
} else if (pkiMsg2 == NULL && hashBuf == NULL) {
|
||||
/* header/footer not separate, check content length is
|
||||
* not larger than total bundle size */
|
||||
if ((localIdx + length) > pkiMsgSz) {
|
||||
WOLFSSL_MSG("Content length detected is larger than "
|
||||
"total bundle size");
|
||||
ret = BUFFER_E;
|
||||
break;
|
||||
}
|
||||
}
|
||||
idx = localIdx;
|
||||
}
|
||||
|
Reference in New Issue
Block a user