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".uefisign: Separate file verdicts from failures
This can be usefuluefisign(8) exited 1 for a tool such as the automatic bootloader updatedeverything, so a caller (e.g. a signing script
discussed in D58990.or a CI check) could not tell an unsigned or malformed file from a
program failure. Split the status into four values:
Split the status into two ranges. A small value is a statement about the 0 success (file was signed or with -V, contains a signature)
file that was examined: 1 for the wrong signature state (not signed under 1 program or library failure
-V, already signed when 2 no signing), 2 for a file that is not a conformingnature found (with -V)
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. 3 invalid file format (input is not a conforming PE image)
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>```