@@ -98,11 +98,11 @@ impl MakeCredentialsResponseUnsignedExtensions {
9898 // https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#op-makecred-step-rk
9999 // if the "rk" option is false: the authenticator MUST create a non-discoverable credential.
100100 // Note: This step is a change from CTAP2.0 where if the "rk" option is false the authenticator could optionally create a discoverable credential.
101- match request. discoverable_credential {
102- Some ( DiscoverableCredentialRequirement :: Discouraged ) | None => {
101+ match request. resident_key {
102+ Some ( ResidentKeyRequirement :: Discouraged ) | None => {
103103 Some ( CredentialPropsExtension { rk : Some ( false ) } )
104104 }
105- Some ( DiscoverableCredentialRequirement :: Preferred ) => {
105+ Some ( ResidentKeyRequirement :: Preferred ) => {
106106 if info. map ( |i| i. option_enabled ( "rk" ) ) . unwrap_or_default ( ) {
107107 Some ( CredentialPropsExtension { rk : Some ( true ) } )
108108 } else {
@@ -111,7 +111,7 @@ impl MakeCredentialsResponseUnsignedExtensions {
111111 Some ( CredentialPropsExtension { rk : Some ( false ) } )
112112 }
113113 }
114- Some ( DiscoverableCredentialRequirement :: Required ) => {
114+ Some ( ResidentKeyRequirement :: Required ) => {
115115 Some ( CredentialPropsExtension { rk : Some ( true ) } )
116116 }
117117 }
@@ -150,7 +150,7 @@ impl MakeCredentialsResponseUnsignedExtensions {
150150}
151151
152152#[ derive( Debug , Clone , Copy ) ]
153- pub enum DiscoverableCredentialRequirement {
153+ pub enum ResidentKeyRequirement {
154154 Required ,
155155 Preferred ,
156156 Discouraged ,
@@ -164,7 +164,7 @@ pub struct MakeCredentialRequest {
164164 pub relying_party : Ctap2PublicKeyCredentialRpEntity ,
165165 /// userEntity
166166 pub user : Ctap2PublicKeyCredentialUserEntity ,
167- pub discoverable_credential : Option < DiscoverableCredentialRequirement > ,
167+ pub resident_key : Option < ResidentKeyRequirement > ,
168168 pub user_verification : UserVerificationRequirement ,
169169 /// credTypesAndPubKeyAlgs
170170 pub algorithms : Vec < Ctap2CredentialType > ,
@@ -291,7 +291,7 @@ impl MakeCredentialRequest {
291291 exclude : None ,
292292 extensions : None ,
293293 origin : "example.org" . to_owned ( ) ,
294- discoverable_credential : None ,
294+ resident_key : None ,
295295 user_verification : UserVerificationRequirement :: Discouraged ,
296296 timeout : Duration :: from_secs ( 10 ) ,
297297 }
@@ -316,8 +316,8 @@ impl DowngradableRequest<RegisterRequest> for MakeCredentialRequest {
316316
317317 // Options must not include "rk" set to true.
318318 if matches ! (
319- self . discoverable_credential ,
320- Some ( DiscoverableCredentialRequirement :: Required )
319+ self . resident_key ,
320+ Some ( ResidentKeyRequirement :: Required )
321321 ) {
322322 debug ! ( "Not downgradable: request requires resident key" ) ;
323323 return false ;
0 commit comments