diff --git a/src/providers/pkcs11/utils.rs b/src/providers/pkcs11/utils.rs index 7f51e8d..1755226 100644 --- a/src/providers/pkcs11/utils.rs +++ b/src/providers/pkcs11/utils.rs @@ -284,7 +284,10 @@ impl CkMechanism { /// of memory, hardware failure, corruption detection, lack of entropy and unsupported operations. pub fn to_response_status(error: Error) -> ResponseStatus { match error { - Error::Io(e) => ResponseStatus::from(e), + Error::LibraryLoading{err} => { + format_error!("PKCS11 error to PsaErrorCommunicationFailure", err); + ResponseStatus::PsaErrorCommunicationFailure + }, Error::Module(e) | Error::InvalidInput(e) => { format_error!("Conversion of error to PsaErrorCommunicationFailure", e); ResponseStatus::PsaErrorCommunicationFailure