mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-10 12:00:53 +02:00
fix for serial number containing 0's and for RNG fail case
This commit is contained in:
@@ -37284,7 +37284,7 @@ static int CopyX509NameToCertName(WOLFSSL_X509_NAME* n, CertName* cName)
|
||||
|
||||
if (j >= CTC_MAX_ATTRIB) {
|
||||
WOLFSSL_MSG("No more space left in CertName");
|
||||
break;
|
||||
return MEMORY_E;
|
||||
}
|
||||
|
||||
cName->name[j].sz = length;
|
||||
@@ -48354,7 +48354,7 @@ int wolfSSL_X509_set_serialNumber(WOLFSSL_X509* x509, WOLFSSL_ASN1_INTEGER* s)
|
||||
if (s->length < 3) {
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
XSTRNCPY((char*)x509->serial, (char*)s->data + 2, s->length - 2);
|
||||
XMEMCPY(x509->serial, s->data + 2, s->length - 2);
|
||||
x509->serialSz = s->length - 2;
|
||||
x509->serial[s->length] = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user