mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #1610] check_apt_key: reject extra pub without fpr, secret keys, option injection, and unnormalized expected (CHECK-APT-KEY-PARSING-AND-GUARDS) #1624
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1624
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1610
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/check-apt-key-parsing-and-guards📝 Commits (1)
0bede78check_apt_key: reject extra pub without fpr, secret keys, option injection, and unnormalized expected📊 Changes
2 files changed (+77 additions, -11 deletions)
View changed files
📝
scripts/check_apt_key.py(+31 -10)📝
tests/test_check_apt_key.py(+46 -1)📄 Description
Item ID:
CHECK-APT-KEY-PARSING-AND-GUARDS(unlisted; coordination issue #14 is at GitHub's 2,500-comment cap with no open successor at submission time, and no open PR touchesscripts/check_apt_key.py).What changed
pubkeys even when they lack anfprrecord (scripts/check_apt_key.py,primary_fingerprints): previously apubrecord followed by anotherpub,sub/ssb/sec, or EOF without anfprline was silently dropped, so appending an extrapubrecord withoutfprafter the pinned key passedcheck(). Now everypubrecord without a matchingfprappends""(rendered as<missing>in diagnostics), causingcheck()to fail.sec/ssb) incheck(): previously asecrecord appended after the pinnedpubkey was ignored and passedcheck(). Key files handed toaptmust contain public key material only.--end-of-options beforepathinshow_keys(): prevents a key file path starting with-from being interpreted as agpgoption.expectedinsidecheck()and guard non-strings innormalize(): direct callers passing lowercase/spaced fingerprints now match, invalid/emptyexpectedvalues are refused before invokinggpg, andnormalize(None)returnsNoneinstead of raisingTypeError.-h/--helpand defaultargv=Noneinmain().tests/test_check_apt_key.py): 6 new tests plus expandedtest_normalizecovering all of the above (no game files, no GPU, no realgpgrequired).Verification
python3 -W error -I tests/test_check_apt_key.py -v: 19 passedpython3 -W error -I tests/test_text_write_line_endings.py: passedpython3 -I scripts/check_no_game_data.py scripts/check_apt_key.py tests/test_check_apt_key.py: cleanpython3 -m compileall -q scripts/check_apt_key.py tests/test_check_apt_key.py: cleantests/test_check_apt_key.pyagainst unpatchedmain:scripts/check_apt_key.py): 7 failures, 1 error across the 19 tests (all new tests fail on unpatchedmain).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.