Name the key that actually signed in generate-signature, or name none #5
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/buildtasks!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/signature-key-identity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
bin/generate-signaturehardcoded TurnKey's release key (tkl-$CODENAME-images.asc,release-$CODENAME-images@turnkeylinux.org, the raw.githubusercontent URL) and wrote a.hashtelling the reader to import that key and verify with it, while signing nothing. The layers released on 2026-09-26 carried such files and were removed from the mirror by hand.What the script does now
BT_GPGKEYset<file>.hash, clearsigns it with that key, then verifies the signature it just made: theVALIDSIGprimary fingerprint must be the fingerprint the file names, or the run fails. The key quoted in the text is checked against the signing key, so a published key file that is not the signer is refused. A run that dies between writing and signing removes the unsigned file.BT_GPGKEYunset<file>.sha256and<file>.sha512inshaNsum -cformat, removes a stale.hash, and names no key anywhere. Exit 0, because a caller with no key did not ask for a signature;--require-signaturemakes it fatal for callers that did.Identity comes from
BT_GPGKEY,BT_SIGN_KEY_EMAIL,BT_SIGN_KEY_FPR,BT_SIGN_KEY_FILEandBT_SIGN_KEY_URL. No URL is defaulted for us:https://archive.keellinux.org/keel-archive-keyring.ascdoes not exist yet, so the text says the key is published with the release and the reader compares the fingerprint. The operator setsBT_SIGN_KEY_URLthe day the keyring is published.Upstream stays reachable, byte for byte
When the signing key is the upstream release key of the codename, the upstream key file and URL are the defaults and the text is the one upstream's script writes, quirks included.
tests/signature-referencefreezes the old script;tests/signatureruns both over one throwaway key andcmps the cleartext of the signed file against the reference output.Tests
tests/signatureis rewritten in the style oftests/layer: throwaway keys generated inside the test in its ownGNUPGHOME, acurlstub for the one fetch, no network and no project key. It covers every refusal, including a published key file that is a different key with the same address.tests/coverage.shruns it as a third suite.expect_ok, used twice by the audit tests of #4 but never defined, is defined here: under kcov a command not found does not stop the suite, so both assertions had been skipped, while the same suite fails outright outside kcov.Test plan
tests/signatureandtests/coverage.sh 99locally, gpg 2.4.7, kcov 43cmpbin/signature-verify -ftests / coverageon this pull request