mirror of https://github.com/wolfSSL/wolfssl.git
fix signer memory takeover on malformed data
parent
b86dfd582f
commit
2d612da9f4
12
src/ssl.c
12
src/ssl.c
|
@ -3354,10 +3354,14 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify)
|
||||||
ret = MEMORY_ERROR;
|
ret = MEMORY_ERROR;
|
||||||
else {
|
else {
|
||||||
signer->keyOID = cert->keyOID;
|
signer->keyOID = cert->keyOID;
|
||||||
signer->publicKey = cert->publicKey;
|
if (cert->pubKeyStored) {
|
||||||
signer->pubKeySize = cert->pubKeySize;
|
signer->publicKey = cert->publicKey;
|
||||||
signer->nameLen = cert->subjectCNLen;
|
signer->pubKeySize = cert->pubKeySize;
|
||||||
signer->name = cert->subjectCN;
|
}
|
||||||
|
if (cert->subjectCNStored) {
|
||||||
|
signer->nameLen = cert->subjectCNLen;
|
||||||
|
signer->name = cert->subjectCN;
|
||||||
|
}
|
||||||
signer->pathLength = cert->pathLength;
|
signer->pathLength = cert->pathLength;
|
||||||
signer->pathLengthSet = cert->pathLengthSet;
|
signer->pathLengthSet = cert->pathLengthSet;
|
||||||
#ifndef IGNORE_NAME_CONSTRAINTS
|
#ifndef IGNORE_NAME_CONSTRAINTS
|
||||||
|
|
Loading…
Reference in New Issue