Skip to content

Commit

Permalink
Prevent crash on missing Authority Key Identifier
Browse files Browse the repository at this point in the history
Another missing NULL check.

Thanks to Niklas Vogel for reporting this.
  • Loading branch information
ydahhrk committed Aug 6, 2024
1 parent 939d988 commit b1eb3c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/extension.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,10 @@ handle_aki(void *ext, void *arg)
AUTHORITY_KEYID *aki = ext;
X509 *parent;

if (aki->keyid == NULL) {
return pr_val_err("%s extension lacks a keyIdentifier.",
ext_aki()->name);
}
if (aki->issuer != NULL) {
return pr_val_err("%s extension contains an authorityCertIssuer.",
ext_aki()->name);
Expand Down
3 changes: 2 additions & 1 deletion src/object/certificate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,8 @@ handle_aki_ta(void *ext, void *arg)
}

error = (ASN1_OCTET_STRING_cmp(aki->keyid, ski) != 0)
? pr_val_err("The '%s' does not equal the '%s'.", ext_aki()->name, ext_ski()->name)
? pr_val_err("The '%s' does not equal the '%s'.",
ext_aki()->name, ext_ski()->name)
: 0;

ASN1_BIT_STRING_free(ski);
Expand Down

0 comments on commit b1eb3c5

Please sign in to comment.