Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`RsaPrivateKey::validate()` does not ensure `precompute()` won't fail

Aperta
#509 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
cryptography

Direzione di ricerca

Start with RsaPrivateKey::validate(), RsaPrivateKey::from_components(), and the precompute() call described in the issue. Check whether valid keys can fail during precomputation and whether the error is currently discarded. Done means validation and construction handle precompute failures consistently, with relevant tests covering the failure path.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

In RsaPrivateKey::from_components(), precompute() errors are ignored because it is claimed that the previous call to validate() guarantees it succeeds.

First of all, this is not the case - there can be bugs in precompute itself. I bumped into it while working on #506. In

let q_mod_p = BoxedMontyForm::new(q_mod_p, p_params.clone());

where I accidentally typed q_params instead of p_params, so the subsequent inversion failed.

Second, what are we even achieving by ignoring the errors there? Are there valid keys for which the values cannot be precomputed? from_components() already returns a Result, we might as well just forward the precompute() error to it.

Lingua principale
Rust
Stelle
673
Fork
190
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RustCrypto/RSA

Tutte le issue di RustCrypto/RSA

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.