diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 0e48073a1..59545b94f 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -33116,10 +33116,8 @@ static int ParseCRL_CertList(DecodedCRL* dcrl, const byte* buf, return ASN_PARSE_E; } #ifdef OPENSSL_EXTRA - else { - dcrl->issuerSz = length + 3; - dcrl->issuer = (byte*)GetNameFromDer(buf + idx, dcrl->issuerSz); - } + dcrl->issuerSz = length + (checkIdx - idx); + dcrl->issuer = (byte*)GetNameFromDer(buf + idx, (int)dcrl->issuerSz); #endif if (GetNameHash(buf, &idx, dcrl->issuerHash, sz) < 0) @@ -33377,7 +33375,7 @@ static int ParseCRL_Extensions(DecodedCRL* dcrl, const byte* buf, } #ifdef WOLFSSL_SMALL_STACK - XFREE(m, NULL, DYNAMIC_TYPE_TMP_BUFFER); + XFREE(m, NULL, DYNAMIC_TYPE_BIGINT); #endif mp_free(m); } @@ -33691,7 +33689,7 @@ end: buff); dcrl->issuer = (byte*)GetNameFromDer((byte*)GetASNItem_Addr( dataASN[CRLASN_IDX_TBS_ISSUER], buff), - dcrl->issuerSz); + (int)dcrl->issuerSz); /* Calculate the Hash id from the issuer name. */ ret = CalcHashId(GetASNItem_Addr(dataASN[CRLASN_IDX_TBS_ISSUER], buff), dcrl->issuerSz, dcrl->issuerHash); diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index 6ec817942..4561805b5 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -2412,7 +2412,7 @@ struct DecodedCRL { RevokedCert* certs; /* revoked cert list */ #if defined(OPENSSL_EXTRA) byte* issuer; /* full name including common name */ - int issuerSz; /* length of the issuer */ + word32 issuerSz; /* length of the issuer */ #endif int totalCerts; /* number on list */ int version; /* version of cert */