Skip to content

Commit 5fc7116

Browse files
add crl rsa pss for asn=original
1 parent cd07e32 commit 5fc7116

1 file changed

Lines changed: 39 additions & 3 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36722,8 +36722,24 @@ static int ParseCRL_CertList(RevokedCert* rcert, DecodedCRL* dcrl,
3672236722
dcrl->version++;
3672336723
}
3672436724

36725-
if (GetAlgoId(buf, &idx, &oid, oidIgnoreType, sz) < 0)
36725+
if (GetAlgoId(buf, &idx, &oid, oidIgnoreType, sz) < 0) {
3672636726
return ASN_PARSE_E;
36727+
}
36728+
#ifdef WC_RSA_PSS
36729+
else if (oid == CTC_RSASSAPSS) {
36730+
word32 tmpSz;
36731+
int len;
36732+
36733+
tmpSz = idx;
36734+
dcrl->sigParamsIndex = idx;
36735+
if (GetSequence(buf, &idx, &len, sz) < 0) {
36736+
dcrl->sigParamsIndex = 0;
36737+
return ASN_PARSE_E;
36738+
}
36739+
idx += len;
36740+
dcrl->sigParamsLength = idx - tmpSz;
36741+
}
36742+
#endif
3672736743

3672836744
checkIdx = idx;
3672936745
if (GetSequence(buf, &checkIdx, &length, sz) < 0) {
@@ -37153,6 +37169,10 @@ int ParseCRL(RevokedCert* rcert, DecodedCRL* dcrl, const byte* buff, word32 sz,
3715337169
int ret = 0;
3715437170
int len;
3715537171
word32 idx = 0;
37172+
#ifdef WC_RSA_PSS
37173+
const byte* sigParams = NULL;
37174+
int sigParamsSz = 0;
37175+
#endif
3715637176

3715737177
WOLFSSL_MSG("ParseCRL");
3715837178

@@ -37182,8 +37202,24 @@ int ParseCRL(RevokedCert* rcert, DecodedCRL* dcrl, const byte* buff, word32 sz,
3718237202

3718337203
idx = dcrl->sigIndex;
3718437204

37185-
if (GetAlgoId(buff, &idx, &dcrl->signatureOID, oidSigType, sz) < 0)
37205+
if (GetAlgoId(buff, &idx, &dcrl->signatureOID, oidSigType, sz) < 0) {
3718637206
return ASN_PARSE_E;
37207+
}
37208+
#ifdef WC_RSA_PSS
37209+
else if (dcrl->signatureOID == CTC_RSASSAPSS) {
37210+
word32 tmpSz;
37211+
const byte* params;
37212+
37213+
tmpSz = idx;
37214+
params = buff + idx;
37215+
if (GetSequence(buff, &idx, &len, sz) < 0) {
37216+
return ASN_PARSE_E;
37217+
}
37218+
idx += len;
37219+
sigParams = params;
37220+
sigParamsSz = idx - tmpSz;
37221+
}
37222+
#endif
3718737223

3718837224
if (GetCRL_Signature(buff, &idx, dcrl, sz) < 0)
3718937225
return ASN_PARSE_E;
@@ -37223,7 +37259,7 @@ int ParseCRL(RevokedCert* rcert, DecodedCRL* dcrl, const byte* buff, word32 sz,
3722337259
WOLFSSL_MSG("Found CRL issuer CA");
3722437260
ret = VerifyCRL_Signature(&sigCtx, buff + dcrl->certBegin,
3722537261
dcrl->sigIndex - dcrl->certBegin, dcrl->signature, dcrl->sigLength,
37226-
dcrl->signatureOID, sigParam, sigParamsSz, ca, dcrl->heap);
37262+
dcrl->signatureOID, sigParams, sigParamsSz, ca, dcrl->heap);
3722737263

3722837264
end:
3722937265
return ret;

0 commit comments

Comments
 (0)