parallaxsecond / parsec

Platform AbstRaction for SECurity service
https://parsec.community/
Apache License 2.0
462 stars 67 forks source link

Improve PKCS11 failure mode #730

Open ema opened 8 months ago

ema commented 8 months ago

Hi,

configuring the PKCS11 provider incorrectly seems to invariably result in the following sort of error messages:

parsec[391160]: [ERROR parsec_service::providers::pkcs11] Error initializing PKCS 11 context;
parsec[391160]: [ERROR cryptoki::context] Failed to finalize: PKCS11 error: This value can be returned by any function other than C_Initialize and C_GetFunctionList.  It indicates that the function cannot be executed because the Cryptoki library has not yet been initialized by a call to C_Initialize.
parsec[391160]: [ERROR parsec_service::utils::service_builder] Provider with ID PKCS #11 provider cannot be created;

The above is printed regardless of what is actually going wrong in reality. For instance, I have tried starting parsec with the wrong slot_number, or with no slot at all. The error message should be more descriptive if possible.

Thanks!

anta5010 commented 8 months ago

This duplicates https://github.com/parallaxsecond/parsec/issues/611 or vice versa