mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Addressing some PR feedback
This commit is contained in:
@ -94,7 +94,7 @@ static int InitCRL_Entry(CRL_Entry* crle, DecodedCRL* dcrl, const byte* buff,
|
|||||||
#if defined(OPENSSL_EXTRA)
|
#if defined(OPENSSL_EXTRA)
|
||||||
crle->issuer = NULL;
|
crle->issuer = NULL;
|
||||||
wolfSSL_d2i_X509_NAME(&crle->issuer, (unsigned char**)&dcrl->issuer,
|
wolfSSL_d2i_X509_NAME(&crle->issuer, (unsigned char**)&dcrl->issuer,
|
||||||
XSTRLEN((const char*)dcrl->issuer));
|
dcrl->issuerSz);
|
||||||
if (crle->issuer == NULL) {
|
if (crle->issuer == NULL) {
|
||||||
return WOLFSSL_FAILURE;
|
return WOLFSSL_FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -32853,7 +32853,10 @@ static int GetRevoked(const byte* buff, word32* idx, DecodedCRL* dcrl,
|
|||||||
int maxIdx)
|
int maxIdx)
|
||||||
{
|
{
|
||||||
#ifndef WOLFSSL_ASN_TEMPLATE
|
#ifndef WOLFSSL_ASN_TEMPLATE
|
||||||
int ret, len;
|
#ifndef NO_ASN_TIME
|
||||||
|
int ret;
|
||||||
|
#endif
|
||||||
|
int len;
|
||||||
word32 end;
|
word32 end;
|
||||||
RevokedCert* rc;
|
RevokedCert* rc;
|
||||||
|
|
||||||
@ -33114,7 +33117,8 @@ static int ParseCRL_CertList(DecodedCRL* dcrl, const byte* buf,
|
|||||||
}
|
}
|
||||||
#ifdef OPENSSL_EXTRA
|
#ifdef OPENSSL_EXTRA
|
||||||
else {
|
else {
|
||||||
dcrl->issuer = (byte*)GetNameFromDer(buf + idx, WC_ASN_NAME_MAX);
|
dcrl->issuerSz = length + 3;
|
||||||
|
dcrl->issuer = (byte*)GetNameFromDer(buf + idx, dcrl->issuerSz);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -33149,6 +33153,8 @@ static int ParseCRL_CertList(DecodedCRL* dcrl, const byte* buf,
|
|||||||
WOLFSSL_ERROR_VERBOSE(CRL_CERT_DATE_ERR);
|
WOLFSSL_ERROR_VERBOSE(CRL_CERT_DATE_ERR);
|
||||||
return CRL_CERT_DATE_ERR;
|
return CRL_CERT_DATE_ERR;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)verify;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33343,7 +33349,7 @@ static int ParseCRL_Extensions(DecodedCRL* dcrl, const byte* buf,
|
|||||||
|
|
||||||
#ifdef WOLFSSL_SMALL_STACK
|
#ifdef WOLFSSL_SMALL_STACK
|
||||||
m = (mp_int*)XMALLOC(sizeof(*m), NULL,
|
m = (mp_int*)XMALLOC(sizeof(*m), NULL,
|
||||||
DYNAMIC_TYPE_TMP_BUFFER);
|
DYNAMIC_TYPE_BIGINT);
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
return MEMORY_E;
|
return MEMORY_E;
|
||||||
}
|
}
|
||||||
@ -33356,7 +33362,7 @@ static int ParseCRL_Extensions(DecodedCRL* dcrl, const byte* buf,
|
|||||||
if (ret != MP_OKAY) {
|
if (ret != MP_OKAY) {
|
||||||
mp_free(m);
|
mp_free(m);
|
||||||
#ifdef WOLFSSL_SMALL_STACK
|
#ifdef WOLFSSL_SMALL_STACK
|
||||||
XFREE(m, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(m, NULL, DYNAMIC_TYPE_BIGINT);
|
||||||
#endif
|
#endif
|
||||||
return BUFFER_E;
|
return BUFFER_E;
|
||||||
}
|
}
|
||||||
@ -33681,12 +33687,14 @@ end:
|
|||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
#endif
|
#endif
|
||||||
/* Parse and store the issuer name. */
|
/* Parse and store the issuer name. */
|
||||||
dcrl->issuer = (byte*)GetNameFromDer((byte*)GetASNItem_Addr(
|
dcrl->issuerSz = GetASNItem_Length(dataASN[CRLASN_IDX_TBS_ISSUER],
|
||||||
dataASN[CRLASN_IDX_TBS_ISSUER], buff), ASN_NAME_MAX);
|
buff);
|
||||||
|
dcrl->issuer = (byte*)GetNameFromDer((byte*)GetASNItem_Addr(
|
||||||
|
dataASN[CRLASN_IDX_TBS_ISSUER], buff),
|
||||||
|
dcrl->issuerSz);
|
||||||
/* Calculate the Hash id from the issuer name. */
|
/* Calculate the Hash id from the issuer name. */
|
||||||
ret = CalcHashId(GetASNItem_Addr(dataASN[CRLASN_IDX_TBS_ISSUER], buff),
|
ret = CalcHashId(GetASNItem_Addr(dataASN[CRLASN_IDX_TBS_ISSUER], buff),
|
||||||
GetASNItem_Length(dataASN[CRLASN_IDX_TBS_ISSUER], buff),
|
dcrl->issuerSz, dcrl->issuerHash);
|
||||||
dcrl->issuerHash);
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ret = ASN_PARSE_E;
|
ret = ASN_PARSE_E;
|
||||||
}
|
}
|
||||||
|
@ -2412,6 +2412,7 @@ struct DecodedCRL {
|
|||||||
RevokedCert* certs; /* revoked cert list */
|
RevokedCert* certs; /* revoked cert list */
|
||||||
#if defined(OPENSSL_EXTRA)
|
#if defined(OPENSSL_EXTRA)
|
||||||
byte* issuer; /* full name including common name */
|
byte* issuer; /* full name including common name */
|
||||||
|
int issuerSz; /* length of the issuer */
|
||||||
#endif
|
#endif
|
||||||
int totalCerts; /* number on list */
|
int totalCerts; /* number on list */
|
||||||
int version; /* version of cert */
|
int version; /* version of cert */
|
||||||
|
Reference in New Issue
Block a user