From nobody Wed Jul 05 19:37:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qx91F10K5z4l8QW; Wed, 5 Jul 2023 19:37:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qx91F0NR0z3MmH; Wed, 5 Jul 2023 19:37:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688585873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MUcdnvIEHq+zjt5p/0qNDHKn2dqQW2K9ktvmdS+x56s=; b=kXQGeQbfwNbNIiWdmD6UeXj9FYbCMg18PkNDkKYmeiMSZbIXSxUpycZIrZASewMYaBzrlx dlC0/BPGhkYiGGElRFLZohpKzSaOTbfVggxtyygmr+yma8zDGe86EcwuK43tqYTH1qXMAj ndMK+vgsh/QLgLqm5cpCVbDgdxdnDEJX8vk6OLnkHEsjosf2/kE134vB6ABGjTe+Yatue7 iLe9YoMWOxDmBweXPNeJtomMea5PewEQke3Pho9djUEW3S5HwxSXs6f7gw76kvwZUDKAqa nhnrZrPXqbGaikChiTHMR6Ar2AVOLZCtv3sIx8kRsSOaoIBb4PIfbNdQ/yCyAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688585873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MUcdnvIEHq+zjt5p/0qNDHKn2dqQW2K9ktvmdS+x56s=; b=NgXOLHH65O+Mz0oYXhPUQce1+nvQa0TAP+r2kqWJ3JZFIRRFFbtVPr2rmdS6T8tMK7MGny s2IEbHaCL/jvAqCoVgqpIHtG0QsxnQ1ywIGIjtoAl35oGYjcoyu0wTKvfMgcTsXEUw7xvy Eee8IUfBhOfDymi7S67EU3i0PrQEXKVSSmDYePSVk30Otpn961TPMq2j9OmwlFau6hTUhT n/J6T9UvWK3cH0UVMvJioiBgynsHtHnmOgjIo2FwyNFf3Cbg89gnYcreOuOhIqR2y03xL0 57kxKJs09o8ImLLk4858Ki0pf/IZc/db9Pfcp9KYD4+lNtsj2/egHlZIAWk8/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688585873; a=rsa-sha256; cv=none; b=fEQupSTnfIDMq3aLEBrDQd5oJmXfVYf80BTzJOeNbe2qkAZSP/nmXgSxnCo4Z3wyBbeawz lpEOb0BX3CNHiH+caMGjkk16XahorSP+d/O78xxmw9wtKqXDjBpr2LR4lLWjYM8M0MJv4U FZU123n70RL7FmJtzpoPmm00qXaYdpdgJ4gjcGeguQNQFLzxEow4w17SasdoFlbYze//ny HL8Qek8Yp0AzasH/fPQ2uNkHd90C2GH3a8EL4hEI2M+JRp+8IKpDdSsi+hi1gso+PX8Qz4 Stoy7pUNtd1XsNwR0KMQKeJUBo5yevw8xiD+Hhc/GMQXW/MRVR7BzuIKYekkdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qx91D6RyfzS3x; Wed, 5 Jul 2023 19:37:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 365JbqCR014922; Wed, 5 Jul 2023 19:37:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 365JbqLT014921; Wed, 5 Jul 2023 19:37:52 GMT (envelope-from git) Date: Wed, 5 Jul 2023 19:37:52 GMT Message-Id: <202307051937.365JbqLT014921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 9c3478cb2263 - main - libsecureboot: do not accept certificate we cannot decode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c3478cb226385c468c0d029337f4e78e69931c8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=9c3478cb226385c468c0d029337f4e78e69931c8 commit 9c3478cb226385c468c0d029337f4e78e69931c8 Author: Simon J. Gerraty AuthorDate: 2023-07-05 19:37:14 +0000 Commit: Simon J. Gerraty CommitDate: 2023-07-05 19:37:14 +0000 libsecureboot: do not accept certificate we cannot decode 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. --- lib/libsecureboot/vets.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libsecureboot/vets.c b/lib/libsecureboot/vets.c index 12191097ff8c..ca1eb12937bb 100644 --- a/lib/libsecureboot/vets.c +++ b/lib/libsecureboot/vets.c @@ -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); }