Repository navigation
Make signature.py and skill.py pass ub's own gate - #12
Merged
Merged
Conversation
…ving signature mutants verify now parses the key and the signature in helpers; install plans and publishes files in helpers. Accept/reject results are unchanged: a 1012-case corpus of valid and tampered inputs gives identical outcomes before and after. New tests pin point_equal on projective points, non-canonical and off-curve encodings, wrong lengths, s = q, and each verify error by message.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
src/ub_cli/signature.pyandsrc/ub_cli/skill.pypass ub's own gate (round-3 dogfood findings).Changes
signature.verify(CC 12): split key parsing into_public_keyand signature parsing into_signature_parts. Checks run in the same order with the same errors.skill.install(CC 14): split the check pass into_pendingand the atomic write into_publish. No behavior change.tests/test_update.py: new tests kill every surviving or uncovered signature mutant:point_equalon scaled projective points, and on points with only x or only y negated (kills the* -> /andand -> ormutants on line 37).recover_x(1, 0) == 0,recover_x(1, 1) is None, an off-curvey = -2, and non-canonicaly = p. These kill the>= -> >mutant at line 41, the0 -> 1mutants at lines 44 and 45, and* -> /at line 49. Line 49 needs a largey: with a smallythe float mutant gives the same answer.ed25519_verifywith a 65-byte signature (line 71or -> and, line 72 uncovered). Alsos = qagainst the identity key and R, wheres = 0does verify, so only the range check rejects it (line 75>= -> >).verifytamper cases now assert the error message. New cases cover base64 with an inserted!in the key, blob and global signature (lines 83/89/90validate=True -> False), a wrong key prefix (line 84or -> and), a too-long blob and global signature (line 91or -> and), a wrong key id, and an unsupported algorithm.Signature behavior is unchanged
Before and after the refactor, a scratch script ran
verifyon 1012 cases. It crosses 4 messages (current and legacy, each also tampered), 11 key variants and 23 signature variants: CRLF, line count, comment, base64, lengths, algorithm, key id, and bit flips in each signature. The script recorded the return value, or the exception type and message, for each case. The before and after outputs are byte-identical (cmpclean): 8 accepted and 1004 rejected, with the same messages.Verification (Python 3.11, this branch)
Baseline on main:
CRAP: 2 of 10 functions >= 10,Mutation: 115 killed, 15 survived, 2 uncovered.No equivalent mutants remain to justify.
Not run: a full
ub check -s src; only these two files were measured.