@@ -381,6 +381,7 @@ impl From<GetAssertionResponse> for AuthenticatorResponse {
381381mod test {
382382 use std:: { sync:: Arc , time:: Duration } ;
383383
384+ use base64:: Engine as _;
384385 use libwebauthn:: {
385386 ops:: webauthn:: {
386387 MakeCredentialRequest , ResidentKeyRequirement , UserVerificationRequirement ,
@@ -396,9 +397,7 @@ mod test {
396397 credential_service:: usb:: InProcessUsbHandler ,
397398 dbus:: test:: { DummyFlowServer , DummyUiServer } ,
398399 model:: CredentialRequest ,
399- webauthn:: { self , NavigationContext } ,
400400 } ;
401- use credentialsd_common:: model:: Operation ;
402401
403402 use super :: {
404403 hybrid:: { test:: DummyHybridHandler , HybridStateInternal } ,
@@ -456,13 +455,15 @@ mod test {
456455
457456 fn create_credential_request ( ) -> CredentialRequest {
458457 let challenge = "Ox0AXQz7WUER7BGQFzvVrQbReTkS3sepVGj26qfUhhrWSarkDbGF4T4NuCY1aAwHYzOzKMJJ2YRSatetl0D9bQ" ;
459- let origin = NavigationContext :: SameOrigin ( "https://webauthn.io" . parse ( ) . unwrap ( ) ) ;
460- let client_data_json =
461- webauthn:: format_client_data_json ( Operation :: Create , challenge, & origin) ;
462- let client_data_hash = webauthn:: create_client_data_hash ( & client_data_json) ;
458+ let origin = "webauthn.io" . to_string ( ) ;
459+ let is_cross_origin = false ;
460+ let challenge_bytes = base64:: engine:: general_purpose:: URL_SAFE_NO_PAD
461+ . decode ( challenge)
462+ . expect ( "valid base64url challenge" ) ;
463463 let make_request = MakeCredentialRequest {
464- hash : client_data_hash,
465- origin : "https://webauthn.io" . to_string ( ) ,
464+ challenge : challenge_bytes,
465+ origin : origin. clone ( ) ,
466+ cross_origin : Some ( is_cross_origin) ,
466467 relying_party : Ctap2PublicKeyCredentialRpEntity {
467468 id : "webauthn.io" . to_string ( ) ,
468469 name : Some ( "webauthn.io" . to_string ( ) ) ,
0 commit comments