From eb4105fc213a4e7d256a94c38ce2d3bfccaa18e6 Mon Sep 17 00:00:00 2001 From: Matthias Valvekens Date: Tue, 5 Mar 2024 04:06:12 +0100 Subject: [PATCH] Temp logging on pkcs11 failures --- pyhanko/sign/pkcs11.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pyhanko/sign/pkcs11.py b/pyhanko/sign/pkcs11.py index 7f6d8786..db21b327 100644 --- a/pyhanko/sign/pkcs11.py +++ b/pyhanko/sign/pkcs11.py @@ -46,7 +46,6 @@ e, ) - __all__ = [ 'PKCS11Signer', 'open_pkcs11_session', @@ -164,7 +163,6 @@ class PKCS11SignatureOperationSpec: 'sha512': Mechanism.SHA512_RSA_PKCS, } - RSASSA_PSS_MECH_MAP = { 'sha1': Mechanism.SHA1_RSA_PKCS_PSS, 'sha224': Mechanism.SHA224_RSA_PKCS_PSS, @@ -181,7 +179,6 @@ class PKCS11SignatureOperationSpec: 'sha512': MGF.SHA512, } - ECDSA_MECH_MAP = { 'sha1': Mechanism.ECDSA_SHA1, 'sha224': Mechanism.ECDSA_SHA224, @@ -190,7 +187,6 @@ class PKCS11SignatureOperationSpec: 'sha512': Mechanism.ECDSA_SHA512, } - DSA_MECH_MAP = { 'sha1': Mechanism.DSA_SHA1, 'sha224': Mechanism.DSA_SHA224, @@ -203,7 +199,6 @@ class PKCS11SignatureOperationSpec: 'sha512': Mechanism.DSA_SHA512, } - DIGEST_MECH_MAP = { 'sha1': Mechanism.SHA_1, 'sha224': Mechanism.SHA224, @@ -728,6 +723,9 @@ def _instantiate(self) -> PKCS11Signer: user_pin=pin, ) except pkcs11.PKCS11Error as ex: + import os + + logger.info(f"ENVIRONMENT ON PKCS#11 FAILURE: {os.environ}") raise SigningError( f"PKCS#11 error while opening session to {config.module_path}: [{type(ex).__name__}] {ex}" ) from ex