Based on input from test (who complained about the lack of
traces even with OPENCRYPTOKI_TRACE_LEVEL=3) I added just a
minimum of traces for each token to see just the init and
finalize functions getting called.

Signed-off-by: Harald Freudenberger <fre...@linux.vnet.ibm.com>
---
 usr/lib/pkcs11/cca_stdll/cca_specific.c      |    4 ++++
 usr/lib/pkcs11/ep11_stdll/ep11_specific.c    |    4 ++--
 usr/lib/pkcs11/ica_s390_stdll/ica_specific.c |    9 +++++----
 usr/lib/pkcs11/icsf_stdll/icsf_specific.c    |    2 ++
 usr/lib/pkcs11/soft_stdll/soft_specific.c    |    7 ++++---
 usr/lib/pkcs11/tpm_stdll/tpm_specific.c      |    4 ++++
 6 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/usr/lib/pkcs11/cca_stdll/cca_specific.c 
b/usr/lib/pkcs11/cca_stdll/cca_specific.c
index 750eed5..e43b585 100644
--- a/usr/lib/pkcs11/cca_stdll/cca_specific.c
+++ b/usr/lib/pkcs11/cca_stdll/cca_specific.c
@@ -135,6 +135,8 @@ token_specific_init(CK_SLOT_ID SlotNumber, char *conf_name)
        long return_code, reason_code, rule_array_count, verb_data_length;
        void *lib_csulcca;
 
+       TRACE_INFO("cca %s slot=%d running\n", __func__, (int)SlotNumber);
+
        lib_csulcca = dlopen(CCASHAREDLIB, RTLD_GLOBAL | RTLD_NOW);
        if (lib_csulcca == NULL) {
                OCK_SYSLOG(LOG_ERR, "%s: Error loading library: '%s' [%s]\n",
@@ -177,6 +179,8 @@ token_specific_init(CK_SLOT_ID SlotNumber, char *conf_name)
 CK_RV
 token_specific_final()
 {
+       TRACE_INFO("cca %s running\n", __func__);
+
        return CKR_OK;
 }
 
diff --git a/usr/lib/pkcs11/ep11_stdll/ep11_specific.c 
b/usr/lib/pkcs11/ep11_stdll/ep11_specific.c
index 15e948c..ef1e143 100644
--- a/usr/lib/pkcs11/ep11_stdll/ep11_specific.c
+++ b/usr/lib/pkcs11/ep11_stdll/ep11_specific.c
@@ -1247,7 +1247,7 @@ CK_RV ep11tok_init(CK_SLOT_ID SlotNumber, char *conf_name)
                                    {CKA_LABEL, (void*)wrap_key_name, 
sizeof(wrap_key_name)},
                                    {CKA_TOKEN, (void*)&cktrue, 
sizeof(cktrue)}};
 
-       TRACE_INFO("%s init running\n", __func__);
+       TRACE_INFO("ep11 %s slot=%d running\n", __func__, (int)SlotNumber);
 
        /* read ep11 specific config file with user specified adapter/domain 
pairs, ... */
        rc = read_adapter_config_file(conf_name);
@@ -1306,7 +1306,7 @@ CK_RV ep11tok_init(CK_SLOT_ID SlotNumber, char *conf_name)
 
 CK_RV ep11tok_final()
 {
-       TRACE_INFO("%s final running\n", __func__);
+       TRACE_INFO("ep11 %s running\n", __func__);
 
        return CKR_OK;
 }
diff --git a/usr/lib/pkcs11/ica_s390_stdll/ica_specific.c 
b/usr/lib/pkcs11/ica_s390_stdll/ica_specific.c
index 9c16685..242d113 100755
--- a/usr/lib/pkcs11/ica_s390_stdll/ica_specific.c
+++ b/usr/lib/pkcs11/ica_s390_stdll/ica_specific.c
@@ -354,15 +354,16 @@ token_specific_rng(CK_BYTE *output, CK_ULONG bytes)
 CK_RV
 token_specific_init(CK_SLOT_ID  SlotNumber, char *conf_name)
 {
-
-   return ica_open_adapter(&adapter_handle);
+       TRACE_INFO("ica %s slot=%d running\n", __func__, (int)SlotNumber);
+       return ica_open_adapter(&adapter_handle);
 }
 
 CK_RV
 token_specific_final()
 {
-   ica_close_adapter(adapter_handle);
-   return CKR_OK;
+       TRACE_INFO("ica %s running\n", __func__);
+       ica_close_adapter(adapter_handle);
+       return CKR_OK;
 }
 
 // count_ones_in_byte: for use in adjust_des_key_parity_bits below
diff --git a/usr/lib/pkcs11/icsf_stdll/icsf_specific.c 
b/usr/lib/pkcs11/icsf_stdll/icsf_specific.c
index efe2714..2d4c579 100644
--- a/usr/lib/pkcs11/icsf_stdll/icsf_specific.c
+++ b/usr/lib/pkcs11/icsf_stdll/icsf_specific.c
@@ -276,6 +276,8 @@ CK_RV icsftok_init(CK_SLOT_ID slot_id, char *conf_name)
        CK_RV rc = CKR_OK;
        struct slot_data *data;
 
+       TRACE_INFO("icsf %s slot=%d running\n", __func__, (int)slot_id);
+
        /* Check Slot ID */
        if (slot_id < 0 || slot_id > MAX_SLOT_ID) {
                TRACE_ERROR("Invalid slot ID: %lu\n", slot_id);
diff --git a/usr/lib/pkcs11/soft_stdll/soft_specific.c 
b/usr/lib/pkcs11/soft_stdll/soft_specific.c
index 64a63a9..033698e 100644
--- a/usr/lib/pkcs11/soft_stdll/soft_specific.c
+++ b/usr/lib/pkcs11/soft_stdll/soft_specific.c
@@ -342,14 +342,15 @@ CK_CHAR label[] = "IBM OS PKCS#11   ";
 CK_RV
 token_specific_init(CK_SLOT_ID SlotNumber, char *conf_name)
 {
-   return CKR_OK;
-
+       TRACE_INFO("soft %s slot=%d running\n", __func__, (int)SlotNumber);
+       return CKR_OK;
 }
 
 CK_RV
 token_specific_final()
 {
-  return CKR_OK;
+       TRACE_INFO("soft %s running\n", __func__);
+       return CKR_OK;
 }
 
 
diff --git a/usr/lib/pkcs11/tpm_stdll/tpm_specific.c 
b/usr/lib/pkcs11/tpm_stdll/tpm_specific.c
index 82b0a0c..2927450 100644
--- a/usr/lib/pkcs11/tpm_stdll/tpm_specific.c
+++ b/usr/lib/pkcs11/tpm_stdll/tpm_specific.c
@@ -173,6 +173,8 @@ token_specific_init(CK_SLOT_ID SlotNumber, char *conf_name)
        char path_buf[PATH_MAX], fname[PATH_MAX];
        struct stat statbuf;
 
+       TRACE_INFO("tpm %s slot=%d running\n", __func__, (int)SlotNumber);
+
        // if the user specific directory doesn't exist, create it
        sprintf(path_buf, "%s", get_pk_dir(fname));
        if (stat(path_buf, &statbuf) < 0) {
@@ -2154,6 +2156,8 @@ token_specific_final()
 {
        TSS_RESULT result;
 
+       TRACE_INFO("tpm %s running\n", __func__);
+
         if ((result = Tspi_Context_Close(tspContext))) {
                 TRACE_ERROR("Tspi_Context_Close failed. rc=0x%x\n", result);
                 return CKR_FUNCTION_FAILED;
-- 
1.7.9.5


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Opencryptoki-tech mailing list
Opencryptoki-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech

Reply via email to