Skip to content

Commit 244e3a7

Browse files
committed
Fixes from review
1 parent 45ffbba commit 244e3a7

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎src/crl.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3207,6 +3207,11 @@ int wolfSSL_X509_CRL_sign(WOLFSSL_X509_CRL* crl, WOLFSSL_EVP_PKEY* pkey,
32073207
entry->signature = newSignature;
32083208
entry->signatureSz = newSignatureSz;
32093209
entry->signatureOID = newSignatureOid;
3210+
#if !defined(NO_SKID) && !defined(NO_ASN)
3211+
/* Re-encoded TBS has no authority key id extension. */
3212+
entry->extAuthKeyIdRawIdx = 0;
3213+
entry->extAuthKeyIdRawSz = 0;
3214+
#endif
32103215
}
32113216
else {
32123217
if (newToBeSigned != NULL) {

‎src/x509.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10801,7 +10801,8 @@ static int X509CRLPrintExtensions(WOLFSSL_BIO* bio, WOLFSSL_X509_CRL* crl,
1080110801
}
1080210802

1080310803
#if !defined(NO_SKID)
10804-
if (ret == 0 && crl->crlList->extAuthKeyIdSet) {
10804+
if (ret == 0 && crl->crlList->extAuthKeyIdSet &&
10805+
crl->crlList->extAuthKeyIdRawSz > 0) {
1080510806
word32 i;
1080610807
char val[5];
1080710808
int valSz = 5;

‎wolfcrypt/src/asn_orig.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9605,7 +9605,8 @@ static int ParseCRL_CertList(RevokedCert* rcert, DecodedCRL* dcrl,
96059605
}
96069606

96079607
#ifndef NO_SKID
9608-
static int ParseCRL_AuthKeyIdExt(const byte* input, int sz, DecodedCRL* dcrl)
9608+
static int ParseCRL_AuthKeyIdExt(const byte* input, word32 inputIdx, int sz,
9609+
DecodedCRL* dcrl)
96099610
{
96109611
word32 idx = 0;
96119612
int length = 0, ret = 0;
@@ -9633,6 +9634,8 @@ static int ParseCRL_AuthKeyIdExt(const byte* input, int sz, DecodedCRL* dcrl)
96339634
}
96349635

96359636
dcrl->extAuthKeyIdSet = 1;
9637+
dcrl->extAuthKeyIdRawIdx = inputIdx + idx;
9638+
dcrl->extAuthKeyIdRawSz = (word32)length;
96369639

96379640
/* Get the hash or hash of the hash if wrong size. */
96389641
ret = GetHashId(input + idx, length, dcrl->extAuthKeyId,
@@ -9717,7 +9720,7 @@ static int ParseCRL_Extensions(DecodedCRL* dcrl, const byte* buf,
97179720

97189721
if (oid == AUTH_KEY_OID) {
97199722
#ifndef NO_SKID
9720-
ret = ParseCRL_AuthKeyIdExt(buf + idx, length, dcrl);
9723+
ret = ParseCRL_AuthKeyIdExt(buf + idx, idx, length, dcrl);
97219724
if (ret < 0) {
97229725
WOLFSSL_MSG("\tcouldn't parse AuthKeyId extension");
97239726
return ret;

0 commit comments

Comments
 (0)