Repository navigation
rsa: accept short PKCS#1 v1.5 signatures without a digest - #514
Merged
aidangarske merged 3 commits intoDec 2, 2026
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The padding change is narrowly scoped, buffer cleanup is sound, and regression coverage checks acceptance and rejection behavior with no unresolved findings.
No open issues 🎉
What changed in this PR
This PR fixes RSA verification compatibility with rpm-sequoia in replace-default mode by accepting short PKCS#1 v1.5 signatures when no digest is configured.
Changes:
- Left-pads short signatures with zeros only for digest-free PKCS#1 v1.5 verification.
- Preserves existing signature-length behavior for other verification modes.
- Adds regression coverage for valid short signatures, corrupted signatures, and digest-based length checks.
| File | Description |
|---|---|
test/unit.h |
Declares the short-signature regression test. |
test/unit.c |
Registers the regression test. |
test/test_rsa.c |
Tests short-signature behavior against both providers. |
src/wp_rsa_sig.c |
Adds conditional left-padding and frees the temporary buffer. |
Review effort: Balanced
ColtonWilley
force-pushed
the
fix/rsa-verify-short-sig
branch
from
December 1, 2026 19:28
0e4e5ff to
93e9295
Compare
aidangarske
requested changes
Dec 2, 2026
aidangarske
left a comment
Member
There was a problem hiding this comment.
Skoll Code Review
Scan type: review
Overall recommendation: REQUEST_CHANGES
Findings: 1 total — 1 posted, 0 skipped
1 finding(s) posted as inline comments (see file-level comments below)
Posted findings
- [High] Short signatures remain rejected when the NONE enum is nonzero —
src/wp_rsa_sig.c:1485-1489
Review generated by Skoll
aidangarske
reviewed
Dec 2, 2026
aidangarske
previously approved these changes
Dec 2, 2026
ColtonWilley
dismissed
aidangarske’s stale review
December 2, 2026 22:04
The merge-base changed after approval.
aidangarske
previously approved these changes
Dec 2, 2026
rpm-sequoia verifies OpenPGP RSA signatures via EVP_PKEY_verify with no digest set and leading zeros stripped from the signature MPI, so ~1 in 256 fail. Left-pad them as the default provider's RSA_public_decrypt does. PSS, X9.31 and PKCS#1 with a digest still require full length (RFC 8017).
Accepted without a digest, rejected with one, as the default provider does.
ColtonWilley
dismissed
aidangarske’s stale review
December 2, 2026 22:07
The merge-base changed after approval.
ColtonWilley
force-pushed
the
fix/rsa-verify-short-sig
branch
from
December 2, 2026 22:07
251b68e to
3e6d877
Compare
aidangarske
self-requested a review
December 2, 2026 22:09
aidangarske
approved these changes
Dec 2, 2026
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.
In replace-default mode, rpm on RHEL 10 rejects ~1 in 256 validly signed RSA packages (
Header V4 RSA/SHA256 Signature: BAD). rpm-sequoia verifies viaEVP_PKEY_verifywith no digest set and the signature's leading zero bytes stripped, which the default provider accepts. Such short PKCS#1 v1.5 signatures are now left-padded; PSS, X9.31 and PKCS#1 with a digest still require full length (RFC 8017).