File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -363,8 +363,10 @@ fn sign_verify_multipart_already_initialized() -> TestResult {
363363 Error :: Pkcs11 ( RvError :: OperationActive , Function :: SignInit )
364364 ) ) ;
365365
366- // Make sure signing operation is over before trying same with verification
367- session. sign_final ( ) ?;
366+ // Make sure signing operation is over before trying same with verification.
367+ // Some backends will reset the ongoing operation after the failed 2nd call to
368+ // sign_init(), so we should not unwrap the result of this call.
369+ let _ = session. sign_final ( ) ;
368370
369371 // Initialize verification operation twice in a row
370372 session. verify_init ( & Mechanism :: Sha256RsaPkcs , pub_key) ?;
@@ -575,8 +577,10 @@ fn encrypt_decrypt_multipart_already_initialized() -> TestResult {
575577 Error :: Pkcs11 ( RvError :: OperationActive , Function :: EncryptInit )
576578 ) ) ;
577579
578- // Make sure encryption operation is over before trying same with decryption
579- session. encrypt_final ( ) ?;
580+ // Make sure encryption operation is over before trying same with decryption.
581+ // Some backends will reset the ongoing operation after the failed 2nd call to
582+ // encrypt_init(), so we should not unwrap the result of this call.
583+ let _ = session. encrypt_final ( ) ;
580584
581585 // Initialize encryption operation twice in a row
582586 session. decrypt_init ( & Mechanism :: AesEcb , key) ?;
You can’t perform that action at this time.
0 commit comments