Skip to content

Commit

Permalink
libsecureboot: do not accept certificate we cannot decode
Browse files Browse the repository at this point in the history
Although we care more about the CN of a certificate than its status
(for purpose of reporting), we should skip if we have errors decoding.

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
  • Loading branch information
sgerraty authored and bsdjhb committed Sep 2, 2023
2 parents 093436b + 9c3478c commit caa41cb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/libsecureboot/vets.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,10 @@ x509_cn_get(br_x509_certificate *xc, char *buf, size_t len)
mc.vtable->end_cert(&mc.vtable);
/* we don't actually care about cert status - just its name */
err = mc.vtable->end_chain(&mc.vtable);
(void)err; /* keep compiler quiet */

if (!cn.status) {
if (cn.status <= 0)
buf = NULL;
if (err == 0) /* keep compiler happy */
buf = NULL;
}
return (buf);
}

Expand Down

0 comments on commit caa41cb

Please sign in to comment.