@@ -10,7 +10,7 @@ pub type AuthenticatorInfo = Response;
1010#[ serde_indexed( offset = 1 ) ]
1111pub struct Response {
1212 // 0x01
13- pub versions : Vec < Version , 4 > ,
13+ pub versions : Vec < Version , 5 > ,
1414
1515 // 0x02
1616 #[ serde( skip_serializing_if = "Option::is_none" ) ]
@@ -154,7 +154,7 @@ impl Default for Response {
154154
155155#[ derive( Debug ) ]
156156pub struct ResponseBuilder {
157- pub versions : Vec < Version , 4 > ,
157+ pub versions : Vec < Version , 5 > ,
158158 pub aaguid : Bytes < 16 > ,
159159}
160160
@@ -211,6 +211,7 @@ pub enum Version {
211211 Fido2_1 ,
212212 Fido2_1Pre ,
213213 Fido2_2 ,
214+ Fido2_3 ,
214215 U2fV2 ,
215216}
216217
@@ -219,6 +220,7 @@ impl Version {
219220 const FIDO_2_1 : & ' static str = "FIDO_2_1" ;
220221 const FIDO_2_1_PRE : & ' static str = "FIDO_2_1_PRE" ;
221222 const FIDO_2_2 : & ' static str = "FIDO_2_2" ;
223+ const FIDO_2_3 : & ' static str = "FIDO_2_3" ;
222224 const U2F_V2 : & ' static str = "U2F_V2" ;
223225}
224226
@@ -229,6 +231,7 @@ impl From<Version> for &str {
229231 Version :: Fido2_1 => Version :: FIDO_2_1 ,
230232 Version :: Fido2_1Pre => Version :: FIDO_2_1_PRE ,
231233 Version :: Fido2_2 => Version :: FIDO_2_2 ,
234+ Version :: Fido2_3 => Version :: FIDO_2_3 ,
232235 Version :: U2fV2 => Version :: U2F_V2 ,
233236 }
234237 }
@@ -243,6 +246,7 @@ impl TryFrom<&str> for Version {
243246 Self :: FIDO_2_1 => Ok ( Self :: Fido2_1 ) ,
244247 Self :: FIDO_2_1_PRE => Ok ( Self :: Fido2_1Pre ) ,
245248 Self :: FIDO_2_2 => Ok ( Self :: Fido2_2 ) ,
249+ Self :: FIDO_2_3 => Ok ( Self :: Fido2_3 ) ,
246250 Self :: U2F_V2 => Ok ( Self :: U2fV2 ) ,
247251 _ => Err ( TryFromStrError ) ,
248252 }
@@ -308,18 +312,21 @@ impl TryFrom<&str> for Extension {
308312#[ serde( into = "&str" , try_from = "&str" ) ]
309313pub enum Transport {
310314 Nfc ,
315+ SmartCard ,
311316 Usb ,
312317}
313318
314319impl Transport {
315320 const NFC : & ' static str = "nfc" ;
321+ const SMART_CARD : & ' static str = "smart-card" ;
316322 const USB : & ' static str = "usb" ;
317323}
318324
319325impl From < Transport > for & str {
320326 fn from ( transport : Transport ) -> Self {
321327 match transport {
322328 Transport :: Nfc => Transport :: NFC ,
329+ Transport :: SmartCard => Transport :: SMART_CARD ,
323330 Transport :: Usb => Transport :: USB ,
324331 }
325332 }
@@ -331,6 +338,7 @@ impl TryFrom<&str> for Transport {
331338 fn try_from ( s : & str ) -> Result < Self , Self :: Error > {
332339 match s {
333340 Self :: NFC => Ok ( Self :: Nfc ) ,
341+ Self :: SMART_CARD => Ok ( Self :: SmartCard ) ,
334342 Self :: USB => Ok ( Self :: Usb ) ,
335343 _ => Err ( TryFromStrError ) ,
336344 }
@@ -479,6 +487,7 @@ mod tests {
479487 ( Version :: Fido2_1 , "FIDO_2_1" ) ,
480488 ( Version :: Fido2_1Pre , "FIDO_2_1_PRE" ) ,
481489 ( Version :: Fido2_2 , "FIDO_2_2" ) ,
490+ ( Version :: Fido2_3 , "FIDO_2_3" ) ,
482491 ( Version :: U2fV2 , "U2F_V2" ) ,
483492 ] ;
484493 for ( version, s) in versions {
@@ -504,7 +513,11 @@ mod tests {
504513
505514 #[ test]
506515 fn test_serde_transport ( ) {
507- let transports = [ ( Transport :: Nfc , "nfc" ) , ( Transport :: Usb , "usb" ) ] ;
516+ let transports = [
517+ ( Transport :: Nfc , "nfc" ) ,
518+ ( Transport :: SmartCard , "smart-card" ) ,
519+ ( Transport :: Usb , "usb" ) ,
520+ ] ;
508521 for ( transport, s) in transports {
509522 assert_tokens ( & transport, & [ Token :: BorrowedStr ( s) ] ) ;
510523 }
0 commit comments