Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
SUSE:SLE-12-SP3:GA
openCryptoki.3480
ocki-3.5-make-ica-token-mechanism-list-initiali...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ocki-3.5-make-ica-token-mechanism-list-initialization-thread-safe.patch of Package openCryptoki.3480
From ddc45468dfc82175818baa6cd8f4330ae593e32c Mon Sep 17 00:00:00 2001 From: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com> Date: Wed, 20 Jul 2016 16:19:48 -0400 Subject: [PATCH] Make ica token mechanism list initialization thread safe Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com> Signed-off-by: Vineetha Pai <vpishar@us.ibm.com> --- usr/lib/pkcs11/ica_s390_stdll/ica_specific.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/usr/lib/pkcs11/ica_s390_stdll/ica_specific.c b/usr/lib/pkcs11/ica_s390_stdll/ica_specific.c index 3bbc1ad..5699a80 100755 --- a/usr/lib/pkcs11/ica_s390_stdll/ica_specific.c +++ b/usr/lib/pkcs11/ica_s390_stdll/ica_specific.c @@ -354,6 +354,14 @@ token_specific_rng(CK_BYTE *output, CK_ULONG bytes) CK_RV token_specific_init(CK_SLOT_ID SlotNumber, char *conf_name) { + CK_ULONG rc = CKR_OK; + + rc = mech_list_ica_initialize(); + if (rc != CKR_OK) { + TRACE_ERROR("mech_list_ica_initialize failed\n"); + return rc; + } + TRACE_INFO("ica %s slot=%lu running\n", __func__, SlotNumber); return ica_open_adapter(&adapter_handle); } @@ -3385,7 +3393,7 @@ REF_MECH_LIST_ELEMENT ref_mech_list[] = { {80, CKM_GENERIC_SECRET_KEY_GEN, {80, 2048, CKF_HW|CKF_GENERATE}}, }; -CK_ULONG ref_mech_list_len = (sizeof(ref_mech_list) / sizeof(MECH_LIST_ELEMENT)); +CK_ULONG ref_mech_list_len = (sizeof(ref_mech_list) / sizeof(REF_MECH_LIST_ELEMENT)); /** * new ica-token mechanism table @@ -3431,20 +3439,11 @@ ica_specific_get_mechanism_list(CK_MECHANISM_TYPE_PTR pMechanismList, CK_ULONG_PTR pulCount) { unsigned int i; - CK_ULONG rc = CKR_OK; if (pulCount == NULL) { return CKR_ARGUMENTS_BAD; } - if (!mech_list_ica_init) { - rc = mech_list_ica_initialize(); - if (rc != CKR_OK) { - TRACE_ERROR("mech_list_ica_initialize failed\n"); - return rc; - } - } - if (pMechanismList == NULL) { *pulCount = mech_list_len; return CKR_OK; @@ -3478,17 +3477,8 @@ token_specific_get_mechanism_info(CK_MECHANISM_TYPE type, CK_RV ica_specific_get_mechanism_info (CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR pInfo) { - int rc = CKR_OK; unsigned int i; - if (!mech_list_ica_init) { - rc = mech_list_ica_initialize(); - if (rc != CKR_OK) { - TRACE_ERROR("mech_list_ica_initialize failed\n"); - return rc; - } - } - /* * find the requested mechanism and grab additional * mechanism specific information (mech_info) from mech_list_ica -- 1.8.3.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor