From 25b7e9d4cf803db58b0f2bdcc1eb4b08c75dbea3 Mon Sep 17 00:00:00 2001 From: Ben Poon Date: Fri, 11 Jun 2021 16:48:03 +0800 Subject: [PATCH] invoke pkcs11_config_interface( ) when initilize the pkcs11 slot if "PKCS11_USE_STATIC_CONFIG" is set to 1 --- lib/pkcs11/pkcs11_slot.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/pkcs11/pkcs11_slot.c b/lib/pkcs11/pkcs11_slot.c index 79620a724..61619b306 100644 --- a/lib/pkcs11/pkcs11_slot.c +++ b/lib/pkcs11/pkcs11_slot.c @@ -161,7 +161,9 @@ CK_RV pkcs11_slot_init(CK_SLOT_ID slotID) pkcs11_slot_ctx_ptr slot_ctx; ATCA_STATUS status = CKR_OK; int retries; - +#if PKCS11_USE_STATIC_CONFIG + CK_RV rv; +#endif if (!lib_ctx) { return CKR_CRYPTOKI_NOT_INITIALIZED; @@ -173,7 +175,13 @@ CK_RV pkcs11_slot_init(CK_SLOT_ID slotID) { return CKR_SLOT_ID_INVALID; } - +#if PKCS11_USE_STATIC_CONFIG + rv = pkcs11_config_interface(slot_ctx); + if (rv != CKR_OK) + { + return CKR_DEVICE_ERROR; + } +#endif if (!slot_ctx->initialized) { ATCAIfaceCfg * ifacecfg = &slot_ctx->interface_config;