@@ -12,9 +12,9 @@ use tokio::sync::broadcast::Receiver;
1212use tracing_subscriber:: { self , EnvFilter } ;
1313
1414use libwebauthn:: ops:: webauthn:: {
15- GetAssertionHmacOrPrfInput , GetAssertionRequest , GetAssertionRequestExtensions ,
16- MakeCredentialPrfInput , MakeCredentialRequest , MakeCredentialsRequestExtensions , PRFValue ,
17- PrfInput , ResidentKeyRequirement , UserVerificationRequirement ,
15+ GetAssertionRequest , GetAssertionRequestExtensions , MakeCredentialPrfInput ,
16+ MakeCredentialRequest , MakeCredentialsRequestExtensions , PRFValue , PrfInput ,
17+ ResidentKeyRequirement , UserVerificationRequirement ,
1818} ;
1919use libwebauthn:: pin:: PinRequestReason ;
2020use libwebauthn:: proto:: ctap2:: {
@@ -148,15 +148,15 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
148148 second : None ,
149149 } ,
150150 ) ;
151- let hmac_or_prf = GetAssertionHmacOrPrfInput :: Prf ( PrfInput {
151+ let prf = PrfInput {
152152 eval,
153153 eval_by_credential,
154- } ) ;
154+ } ;
155155 run_success_test (
156156 & mut channel,
157157 & credential,
158158 & challenge,
159- hmac_or_prf ,
159+ prf ,
160160 "eval_by_credential only" ,
161161 )
162162 . await ;
@@ -175,15 +175,15 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
175175 second : None ,
176176 } ,
177177 ) ;
178- let hmac_or_prf = GetAssertionHmacOrPrfInput :: Prf ( PrfInput {
178+ let prf = PrfInput {
179179 eval,
180180 eval_by_credential,
181- } ) ;
181+ } ;
182182 run_success_test (
183183 & mut channel,
184184 & credential,
185185 & challenge,
186- hmac_or_prf ,
186+ prf ,
187187 "eval and eval_by_credential" ,
188188 )
189189 . await ;
@@ -195,15 +195,15 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
195195 } ) ;
196196
197197 let eval_by_credential = HashMap :: new ( ) ;
198- let hmac_or_prf = GetAssertionHmacOrPrfInput :: Prf ( PrfInput {
198+ let prf = PrfInput {
199199 eval,
200200 eval_by_credential,
201- } ) ;
201+ } ;
202202 run_success_test (
203203 & mut channel,
204204 & credential,
205205 & challenge,
206- hmac_or_prf ,
206+ prf ,
207207 "eval only" ,
208208 )
209209 . await ;
@@ -243,15 +243,15 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
243243 second : None ,
244244 } ,
245245 ) ;
246- let hmac_or_prf = GetAssertionHmacOrPrfInput :: Prf ( PrfInput {
246+ let prf = PrfInput {
247247 eval,
248248 eval_by_credential,
249- } ) ;
249+ } ;
250250 run_success_test (
251251 & mut channel,
252252 & credential,
253253 & challenge,
254- hmac_or_prf ,
254+ prf ,
255255 "eval and full list of eval_by_credential" ,
256256 )
257257 . await ;
@@ -284,15 +284,15 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
284284 second : Some ( [ 8 ; 32 ] ) ,
285285 } ,
286286 ) ;
287- let hmac_or_prf = GetAssertionHmacOrPrfInput :: Prf ( PrfInput {
287+ let prf = PrfInput {
288288 eval,
289289 eval_by_credential,
290- } ) ;
290+ } ;
291291 run_success_test (
292292 & mut channel,
293293 & credential,
294294 & challenge,
295- hmac_or_prf ,
295+ prf ,
296296 "eval and non-fitting list of eval_by_credential" ,
297297 )
298298 . await ;
@@ -322,15 +322,15 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
322322 second : Some ( [ 8 ; 32 ] ) ,
323323 } ,
324324 ) ;
325- let hmac_or_prf = GetAssertionHmacOrPrfInput :: Prf ( PrfInput {
325+ let prf = PrfInput {
326326 eval,
327327 eval_by_credential,
328- } ) ;
328+ } ;
329329 run_success_test (
330330 & mut channel,
331331 & credential,
332332 & challenge,
333- hmac_or_prf ,
333+ prf ,
334334 "No eval and non-fitting list of eval_by_credential (should have no extension output)" ,
335335 )
336336 . await ;
@@ -349,15 +349,15 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
349349 second : None ,
350350 } ,
351351 ) ;
352- let hmac_or_prf = GetAssertionHmacOrPrfInput :: Prf ( PrfInput {
352+ let prf = PrfInput {
353353 eval,
354354 eval_by_credential,
355- } ) ;
355+ } ;
356356 run_failed_test (
357357 & mut channel,
358358 Some ( & credential) ,
359359 & challenge,
360- hmac_or_prf ,
360+ prf ,
361361 "Wrongly encoded credential_id" ,
362362 WebAuthnError :: Platform ( PlatformError :: SyntaxError ) ,
363363 )
@@ -373,15 +373,15 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
373373 second : None ,
374374 } ,
375375 ) ;
376- let hmac_or_prf = GetAssertionHmacOrPrfInput :: Prf ( PrfInput {
376+ let prf = PrfInput {
377377 eval,
378378 eval_by_credential,
379- } ) ;
379+ } ;
380380 run_failed_test (
381381 & mut channel,
382382 Some ( & credential) ,
383383 & challenge,
384- hmac_or_prf ,
384+ prf ,
385385 "Empty credential_id" ,
386386 WebAuthnError :: Platform ( PlatformError :: SyntaxError ) ,
387387 )
@@ -397,15 +397,15 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
397397 second : None ,
398398 } ,
399399 ) ;
400- let hmac_or_prf = GetAssertionHmacOrPrfInput :: Prf ( PrfInput {
400+ let prf = PrfInput {
401401 eval,
402402 eval_by_credential,
403- } ) ;
403+ } ;
404404 run_failed_test (
405405 & mut channel,
406406 None ,
407407 & challenge,
408- hmac_or_prf ,
408+ prf ,
409409 "Empty allow_list, set eval_by_credential" ,
410410 WebAuthnError :: Platform ( PlatformError :: NotSupported ) ,
411411 )
@@ -418,7 +418,7 @@ async fn run_success_test(
418418 channel : & mut HidChannel < ' _ > ,
419419 credential : & Ctap2PublicKeyCredentialDescriptor ,
420420 challenge : & [ u8 ; 32 ] ,
421- hmac_or_prf : GetAssertionHmacOrPrfInput ,
421+ prf : PrfInput ,
422422 printoutput : & str ,
423423) {
424424 let get_assertion = GetAssertionRequest {
@@ -427,7 +427,7 @@ async fn run_success_test(
427427 allow : vec ! [ credential. clone( ) ] ,
428428 user_verification : UserVerificationRequirement :: Discouraged ,
429429 extensions : Some ( GetAssertionRequestExtensions {
430- hmac_or_prf : Some ( hmac_or_prf ) ,
430+ prf : Some ( prf ) ,
431431 ..Default :: default ( )
432432 } ) ,
433433 timeout : TIMEOUT ,
@@ -444,7 +444,7 @@ async fn run_success_test(
444444 break Err ( WebAuthnError :: Ctap ( ctap_error) ) ;
445445 }
446446 Err ( err) => break Err ( err) ,
447- } ;
447+ }
448448 }
449449 . unwrap ( ) ;
450450 for ( num, assertion) in response. assertions . iter ( ) . enumerate ( ) {
@@ -459,7 +459,7 @@ async fn run_failed_test(
459459 channel : & mut HidChannel < ' _ > ,
460460 credential : Option < & Ctap2PublicKeyCredentialDescriptor > ,
461461 challenge : & [ u8 ; 32 ] ,
462- hmac_or_prf : GetAssertionHmacOrPrfInput ,
462+ prf : PrfInput ,
463463 printoutput : & str ,
464464 expected_error : WebAuthnError ,
465465) {
@@ -469,7 +469,7 @@ async fn run_failed_test(
469469 allow : credential. map ( |x| vec ! [ x. clone( ) ] ) . unwrap_or_default ( ) ,
470470 user_verification : UserVerificationRequirement :: Discouraged ,
471471 extensions : Some ( GetAssertionRequestExtensions {
472- hmac_or_prf : Some ( hmac_or_prf ) ,
472+ prf : Some ( prf ) ,
473473 ..Default :: default ( )
474474 } ) ,
475475 timeout : TIMEOUT ,
@@ -486,7 +486,7 @@ async fn run_failed_test(
486486 break Err ( WebAuthnError :: Ctap ( ctap_error) ) ;
487487 }
488488 Err ( err) => break Err ( err) ,
489- } ;
489+ }
490490 } ;
491491
492492 assert_eq ! ( response, Err ( expected_error) , "{printoutput}:" ) ;
0 commit comments