@@ -255,9 +255,13 @@ impl<'a> Fido2Authenticator<'a> {
255255 pub async fn silently_discover_credentials (
256256 & mut self ,
257257 rp_id : String ,
258+ user_handle : Option < Vec < u8 > > ,
258259 ) -> Result < Vec < Fido2CredentialAutofillView > , SilentlyDiscoverCredentialsError > {
259260 let key_store = self . client . internal . get_key_store ( ) ;
260- let result = self . credential_store . find_credentials ( None , rp_id) . await ?;
261+ let result = self
262+ . credential_store
263+ . find_credentials ( None , rp_id, user_handle)
264+ . await ?;
261265
262266 let mut ctx = key_store. context ( ) ;
263267 result
@@ -353,7 +357,7 @@ impl passkey::authenticator::CredentialStore for CredentialStoreImpl<'_> {
353357 & self ,
354358 ids : Option < & [ passkey:: types:: webauthn:: PublicKeyCredentialDescriptor ] > ,
355359 rp_id : & str ,
356- _user_handle : Option < & [ u8 ] > ,
360+ user_handle : Option < & [ u8 ] > ,
357361 ) -> Result < Vec < Self :: PasskeyItem > , StatusCode > {
358362 #[ derive( Debug , Error ) ]
359363 enum InnerError {
@@ -370,14 +374,15 @@ impl passkey::authenticator::CredentialStore for CredentialStoreImpl<'_> {
370374 this : & CredentialStoreImpl < ' _ > ,
371375 ids : Option < & [ passkey:: types:: webauthn:: PublicKeyCredentialDescriptor ] > ,
372376 rp_id : & str ,
377+ user_handle : Option < & [ u8 ] > ,
373378 ) -> Result < Vec < CipherViewContainer > , InnerError > {
374379 let ids: Option < Vec < Vec < u8 > > > =
375380 ids. map ( |ids| ids. iter ( ) . map ( |id| id. id . clone ( ) . into ( ) ) . collect ( ) ) ;
376381
377382 let ciphers = this
378383 . authenticator
379384 . credential_store
380- . find_credentials ( ids, rp_id. to_string ( ) )
385+ . find_credentials ( ids, rp_id. to_string ( ) , user_handle . map ( |h| h . to_vec ( ) ) )
381386 . await ?;
382387
383388 // Remove any that don't have Fido2 credentials
@@ -420,7 +425,7 @@ impl passkey::authenticator::CredentialStore for CredentialStoreImpl<'_> {
420425 }
421426 }
422427
423- inner ( self , ids, rp_id) . await . map_err ( |error| {
428+ inner ( self , ids, rp_id, user_handle ) . await . map_err ( |error| {
424429 error ! ( %error, "Error finding credentials." ) ;
425430 VendorError :: try_from ( 0xF0 )
426431 . expect ( "Valid vendor error code" )
0 commit comments