cms: `OtherRevocationInfoFormat.other_format` should be an OBJECT IDENTIFIER

Aperta Adatta ai principianti
#2,543 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
cryptography

Direzione di ricerca

Inizia leggendo la definizione di OtherRevocationInfoFormat e i relativi test di decodifica nel crate cms; l’issue indica il campo pubblico da modificare e include un riproduttore DER per RevocationInfoChoice::Other. Verifica che il riproduttore fallisca con il tag inatteso segnalato, poi aggiorna il tipo del campo a ObjectIdentifier e verifica che l’esempio venga decodificato correttamente.

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

Descrizione

OtherRevocationInfoFormat declares other_format: AlgorithmIdentifierOwned, but
RFC 5652 §10.2.1 defines it as

OtherRevocationInfoFormat ::= SEQUENCE {
  otherRevInfoFormat  OTHER-REVOK-INFO.&id({SupportedOtherRevokInfo}),
  otherRevInfo        OTHER-REVOK-INFO.&Type({SupportedOtherRevokInfo}{@otherRevInfoFormat}) }

i.e. an OBJECT IDENTIFIER followed by the value, as RFC 5940 §3 uses it for
id-ri-ocsp-response and id-ri-scvp. So a RevocationInfoChoice::Other holding an
OCSP response does not decode:

use cms::revocation::RevocationInfoChoice;
use der::Decode;
// [1] { id-ri-ocsp-response, OCSPResponse { responseStatus tryLater } }
let der = hex_literal::hex!("a10f" "06082b06010505071002" "3003" "0a0103");
RevocationInfoChoice::from_der(&der).unwrap();
// Err: TagUnexpected { expected: SEQUENCE, actual: OBJECT IDENTIFIER }

Versions: cms 0.3.0-rc.2 and master 715d277d. Since this changes a public field's
type, it would be good to fix before 0.3.0 (#2430). The fix is to make other_format an ObjectIdentifier.


Found and analyzed with AI assistance; the reproducers and results above were run on the versions stated.

Lingua principale
Rust
Stelle
347
Fork
200
Merge medio
15h 53m
PR unite (30g)
34

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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/formats

Tutte le issue di RustCrypto/formats

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.