kanidm / webauthn-rs

An implementation of webauthn components for Rustlang servers
Mozilla Public License 2.0
483 stars 80 forks source link

Fix incorrect ATR Y(n) byte parsing #375

Closed micolous closed 10 months ago

micolous commented 10 months ago

Fixes an issue where the ATR parser incorrectly treated Yn as an absolute value, rather than a bitmask.

This came up parsing the YubiKey 5C's USB CCID ATR, where Y1 = 0b1111, which was incorrectly interpreted as containing 7 bytes, when there are actually only 3 bytes (for TA1, TB1 and TC1).

This also makes the Atr::protocols a HashSet, to deal with ATRs that repeat the same protocol multiple times.