NFC protocol issues (CTAP2 keepalive, SELECT Le, status word preservation)

Aperta
#195 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
rust

Direzione di ricerca

Inizia in src/transport/nfc/channel.rs, in cbor_send, nella chiamata SELECT intorno alla riga 147 e in apdu_send intorno alle righe 239–246; confronta questi percorsi con handle() e il ciclo di retry di CTAP1 in proto/ctap1/protocol.rs. Verifica i comportamenti citati di CTAP2, ISO 7816-4 e U2F NFC, quindi assicurati che le risposte keepalive, la gestione di Le per SELECT e le parole di stato originali funzionino attraverso i percorsi di errore e retry esistenti.

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

Descrizione

Missing CTAP2 keepalive (SW=0x91xx → NFCCTAP_GETRESPONSE)
  • Spec ref: CTAP 2.2 §11.3.4 (NFCCTAP_GETRESPONSE keepalive flow).
  • Location: src/transport/nfc/channel.rs:255-304 (cbor_send). Contains a literal // FIXME check for SW_UPDATE? and a commented-out keepalive block.
  • Behavior: After the final NFCCTAP_MSG fragment the response goes straight into CborResponse::try_from. There is no loop on (sw1 == 0x91) that issues NFCCTAP_GETRESPONSE (CLA=0x80, INS=0x11). The library's existing 0x61xx loop in handle() is the ISO 7816 GET RESPONSE mechanism for response continuation, not the CTAP2 keepalive.
  • Impact: Any CTAP2 NFC operation that takes long enough for the authenticator to emit a keepalive (on-token UV, large credential lists, biometric capture) is misinterpreted.
SELECT issued as Case 3 APDU (no Le)
  • Spec ref: CTAP 2.2 §11.3.1 + ISO 7816-4 §5.1.1.
  • Location: src/transport/nfc/channel.rs:147 calling command::select_file(...) from the apdu crate, which emits new_with_payload(...) without an Le.
  • Behavior: SELECT for AID A0 00 00 06 47 2F 00 01 is sent as 00 A4 04 00 08 A0 00 00 06 47 2F 00 01 with no trailing Le. FIDO authenticators that strictly enforce Case 4 will reject with SW=6700/6A87. Most authenticators are lenient.
  • Impact: Interop hazard with stricter authenticator firmwares and chip-on-card implementations.
apdu_send discards SW1/SW2
  • Spec ref: FIDO U2F NFC §3 (response status word semantics).
  • Location: src/transport/nfc/channel.rs:239-246.
  • Behavior: apdu_send wraps the response in ApduResponse::new_success(&resp) and discards the actual SW1/SW2. Non-9000 SWs are surfaced as NfcError::Apdu(_) → TransportError::InvalidFraming, losing the distinction between applet-not-selected (6A82), user-presence-required (6985), invalid-key-handle (6A80), etc.
  • Impact: CTAP1 user-presence retry loop in proto/ctap1/protocol.rs:111-135 is unreachable on NFC (it relies on ApduResponseStatus::UserPresenceTestFailed).
Lingua principale
Rust
Stelle
602
Fork
33
Merge medio
1g 13h
PR unite (30g)
9

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 linux-credentials/libwebauthn

Tutte le issue di linux-credentials/libwebauthn

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.