File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -616,6 +616,7 @@ fn verify_challenge_auth_signature(
616616 signature : Signature ,
617617 config : & RequesterConfig ,
618618) -> bool {
619+ use p384:: ecdsa:: signature:: hazmat:: PrehashVerifier ;
619620 use signature:: Verifier ;
620621
621622 let mut sig_combined_context = Vec :: new ( ) ;
@@ -646,13 +647,11 @@ fn verify_challenge_auth_signature(
646647 // M denotes the message that is signed. M shall be the concatenation of the combined_spdm_prefix and unverified_message_hash.
647648 let m = [ sig_combined_context. as_slice ( ) , & transcript_hash] . concat ( ) ;
648649
649- let res = pubkey. verify ( & m, & signature) ;
650- if config. verbose {
651- if let Err ( e) = & res {
652- println ! ( "Signature verify error: {e}" ) ;
653- }
650+ if ctx. connection_info ( ) . version_number ( ) >= SpdmVersion :: V12 {
651+ pubkey. verify ( & m, & signature) . is_ok ( )
652+ } else {
653+ pubkey. verify_prehash ( & m, & signature) . is_ok ( )
654654 }
655- res. is_ok ( )
656655}
657656
658657#[ derive( Debug ) ]
You can’t perform that action at this time.
0 commit comments