Skip to content

Blind the default RSA decryption paths - #739

Merged
tarcieri merged 1 commit into
masterfrom
blind-decryption-by-default
Nov 1, 2026
Merged

tarcieri merged 1 commit into
masterfrom
blind-decryption-by-default

Conversation

@tarcieri

@tarcieri tarcieri commented Nov 1, 2026

Copy link
Copy Markdown
Member

Note: this PR is an extraction of #702

Enables the getrandom crate feature by default and uses SysRng for blinding in RsaPrivateKey::decrypt and the PKCS#1v1.5/OAEP Decryptor implementations.

Also builds without getrandom, which retains the previous behavior, in whcih case callers can supply a custom RNG explicitly through the existing blinding APIs.

Note: this PR is an extraction of #702

Enables the `getrandom` crate feature by default and uses `SysRng` for
blinding in `RsaPrivateKey::decrypt` and the PKCS#1v1.5/OAEP `Decryptor`
implementations.

Also builds without `getrandom`, which retains the previous behavior, in
whcih case callers can supply a custom RNG explicitly through the
existing blinding APIs.
@tarcieri
tarcieri merged commit f1131e2 into master Nov 1, 2026
13 checks passed
@tarcieri
tarcieri deleted the blind-decryption-by-default branch November 1, 2026 01:28
tarcieri added a commit that referenced this pull request Nov 1, 2026
Avoid a padding oracle by returning a deterministic rejection symbol
rather than an error on padding failures. See sections 7.1/7.2 of:

https://www.ietf.org/archive/id/draft-irtf-cfrg-rsa-guidance-10.html

Incorporates some of the code from #680 / #702, where some of the code
from the latter was merged in #739 (blinding support).

Uses `cargo checkct` / BINSEC to verify constant-time operation.

Closes #626
tarcieri added a commit that referenced this pull request Nov 1, 2026
Avoid a padding oracle by returning a deterministic rejection symbol
rather than an error on padding failures. See sections 7.1/7.2 of:

https://www.ietf.org/archive/id/draft-irtf-cfrg-rsa-guidance-10.html

Incorporates some of the code from #680 / #702, where some of the code
from the latter was merged in #739 (blinding support).

Uses `cargo checkct` / BINSEC to verify constant-time operation.

Closes #626
tarcieri added a commit that referenced this pull request Nov 1, 2026
Avoid a padding oracle by returning a deterministic rejection symbol
rather than an error on padding failures. See sections 7.1/7.2 of:

https://www.ietf.org/archive/id/draft-irtf-cfrg-rsa-guidance-10.html

Incorporates some of the code from #680 / #702, where some of the code
from the latter was merged in #739 (blinding support).

Uses `cargo checkct` / BINSEC to verify constant-time operation.

Closes #626
tarcieri added a commit that referenced this pull request Nov 2, 2026
Similar change to #739, but for signing instead of decryption, utilizing
`getrandom` when available to supply randomness for blinding
automatically when the crate feature is enabled (which it is by
default).

This also changes `pss::BlindedSigningKey` into a deprecated type alias
for `pss::SigningKey`. Contrary to a code comment claiming that it's an
implementation of `draft-irtf-cfrg-rsa-blind-signatures` (now RFC9474)
it doesn't actually implement this protocol but merely blinds the
signing paths, now making it redundant.

A proper implementation of RFC9474 blinded signatures would be
interesting to add, but the API would need to receive an already encoded
and blinded representative from the client, and we don't support that.
tarcieri added a commit that referenced this pull request Nov 2, 2026
)

Similar change to #739, but for signing instead of decryption, utilizing
`getrandom` when available to supply randomness for blinding
automatically when the crate feature is enabled (which it is by
default).

This also changes `pss::BlindedSigningKey` into a deprecated type alias
for `pss::SigningKey`. Contrary to a code comment claiming that it's an
implementation of `draft-irtf-cfrg-rsa-blind-signatures` (now RFC9474)
it doesn't actually implement this protocol but merely blinds the
signing paths, now making it redundant.

A proper implementation of RFC9474 blinded signatures would be
interesting to add, but the API would need to receive an already encoded
and blinded representative from the client, and we don't support that.
yukaia pushed a commit to yukaia/blink that referenced this pull request Nov 4, 2026
suppaftp 12.2.1 sets data_connection_open only after the 150 is read,
one of the conditions the entry named. The rsa fixes (RustCrypto/RSA#739,
#749) merged on 2026-11-01 and rsa 0.10.0-rc.20 is out; russh 0.65.1
still pins rc.18. New entries: resume with an unknown size, known_hosts
format subset, IPv6 legacy host ambiguity, missing Windows device names,
checkpoint file-name length.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant