Page MenuHomeFreeBSD

uefisign: separate file verdicts from failures
Needs ReviewPublic

Authored by quentin.thebault_defenso.fr on Fri, Sep 11, 1:21 AM.
Tags
None
Referenced Files
F173040427: D59580.id186417.diff
Wed, Sep 23, 2:30 AM
F173010673: D59580.id186417.diff
Tue, Sep 22, 8:41 PM
F172988709: D59580.id.diff
Tue, Sep 22, 4:29 PM
Unknown Object (File)
Sun, Sep 20, 9:22 AM
Unknown Object (File)
Sat, Sep 19, 3:32 AM
Unknown Object (File)
Sat, Sep 19, 3:27 AM
Unknown Object (File)
Fri, Sep 18, 6:38 PM
Unknown Object (File)
Fri, Sep 18, 2:35 AM
Subscribers

Details

Summary

uefisign reported every outcome other than success with an exit status of
1, so a caller could not tell "this binary is not signed" from "the
certificate would not parse" or "the crypto library is broken".

This can be useful for a tool such as the automatic bootloader updated
discussed in D58990.

Split the status into two ranges. A small value is a statement about the
file that was examined: 1 for the wrong signature state (not signed under
-V, already signed when signing), 2 for a file that is not a conforming
UEFI PE image. A failure of uefisign itself is reported with a value from
<sysexits.h>, which implies nothing about the file. A child killed by a
signal now exits 128 plus the signal number, so a status of 0 can no
longer mean that uefisign died.

What uefisign accepts, rejects and produces is unchanged: signing
loader.efi, loader_simp.efi, loader_ia32.efi, gptboot.efi and boot1.efi
gives byte-identical output before and after.

PR: 298383
Sponsored by: Defenso

Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76759
Build 73642: arc lint + arc unit