aboutsummaryrefslogtreecommitdiffstats
path: root/SoftHSMv2/src/lib/session_mgr/Session.cpp
diff options
context:
space:
mode:
authorPramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>2018-03-27 09:24:56 -0700
committerPramod <pramod.raghavendra.jayathirth@intel.com>2018-03-30 02:17:20 +0000
commit4ba28823277dd1d154e4a26f7eae440c40b1f9fd (patch)
tree6acf40941e2cb98670374be20279e18cc96b5c64 /SoftHSMv2/src/lib/session_mgr/Session.cpp
parent8a5b33a9ba846d785d244e29bc29a46f7be34928 (diff)
Adds the HardwareInfra layer in SoftHSM
This enables the support of multiple HSMs Issue-ID: AAF-200 Change-Id: I825a72a0bf46827ff3be0c0311085cf970b970a6 Signed-off-by: Pramod <pramod.raghavendra.jayathirth@intel.com>
Diffstat (limited to 'SoftHSMv2/src/lib/session_mgr/Session.cpp')
-rw-r--r--SoftHSMv2/src/lib/session_mgr/Session.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/SoftHSMv2/src/lib/session_mgr/Session.cpp b/SoftHSMv2/src/lib/session_mgr/Session.cpp
index 5db36fd..54c0ff7 100644
--- a/SoftHSMv2/src/lib/session_mgr/Session.cpp
+++ b/SoftHSMv2/src/lib/session_mgr/Session.cpp
@@ -58,6 +58,9 @@ Session::Session(Slot* inSlot, bool inIsReadWrite, CK_VOID_PTR inPApplication, C
symmetricKey = NULL;
param = NULL;
paramLen = 0;
+
+ // Storing Key handle in session
+ hKey = CK_INVALID_HANDLE;
}
// Constructor
@@ -85,6 +88,9 @@ Session::Session()
symmetricKey = NULL;
param = NULL;
paramLen = 0;
+
+ // Storing Key handle in session
+ hKey = CK_INVALID_HANDLE;
}
// Destructor
@@ -93,6 +99,19 @@ Session::~Session()
resetOp();
}
+void Session::setKeyHandle(CK_OBJECT_HANDLE inHKey)
+{
+ //store the key hanldle for subsequent use
+ hKey = inHKey;
+}
+
+
+CK_OBJECT_HANDLE Session::getKeyHandle()
+{
+ //return the Key handle for subsequent use
+ return hKey;
+}
+
// Get session info
CK_RV Session::getInfo(CK_SESSION_INFO_PTR pInfo)
{