Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better errors reporting for PKCS11 provider #611

Open
anta5010 opened this issue May 31, 2022 · 0 comments
Open

Better errors reporting for PKCS11 provider #611

anta5010 opened this issue May 31, 2022 · 0 comments

Comments

@anta5010
Copy link
Collaborator

When there is an issue with creating a PKCS11 provider Parsec doesn't provide enough information about what went wrong even with the "trace" log level. It would be nice to include additional details if possible.

For example,

  1. when an incorrect slot is set in Parsec config for an USB HSM module we only see:
[INFO  parsec] Parsec started. Configuring the service...
[INFO  parsec_service::utils::service_builder] Creating a PKCS 11 Provider.
[INFO  parsec_service::providers::pkcs11] Building a PKCS 11 provider with library '/usr/lib/opensc-pkcs11.so'
[TRACE parsec_service::providers::pkcs11] Initialize command
[ERROR parsec_service::utils::service_builder] Provider with ID PKCS #11 provider cannot be created; Error: PKCS11 initialization failed
Error: failed to create provider
  1. When a Software HSM is used and correct permissions are not set to allow parsec account to access /var/lib/softhsm/tokens/* we only see:
[INFO  parsec_service::utils::service_builder] Creating a PKCS 11 Provider.
[INFO  parsec_service::providers::pkcs11] Building a PKCS 11 provider with library '/usr/lib/softhsm/libsofthsm2.so'
[TRACE parsec_service::providers::pkcs11] Initialize command
[ERROR parsec_service::providers::pkcs11::utils] Error converted to PsaErrorCommunicationFailure;
[ERROR parsec_service::utils::service_builder] Provider with ID PKCS #11 provider cannot be created;
Error: failed to create provider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant