aboutsummaryrefslogtreecommitdiffstats
path: root/SoftHSMv2/src/lib/session_mgr
diff options
context:
space:
mode:
authorRitu Sood <ritu.sood@intel.com>2018-04-26 01:50:05 +0000
committerRitu Sood <ritu.sood@intel.com>2018-05-24 05:55:20 +0000
commit57c7ad1aa0e485b5594f27f1ab501ff0306fe2fc (patch)
treef47b764bda303958051dae4f3e4f0222c338ac3e /SoftHSMv2/src/lib/session_mgr
parentc1c9bfcabc4a5e4147d19c599de7d9bf925fa98b (diff)
Added a new Attribute to store TPM key handle
Includes changes to detect existing instances of key and also some bug fixes. Also added new functionality for RSA_SignUpdate, RSA_SignFinal and RSA_Cleanup Issue-ID: AAF-260 Change-Id: Ib064e86b8f112784ed6d352ab1557ab9a13c5978 Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Diffstat (limited to 'SoftHSMv2/src/lib/session_mgr')
-rw-r--r--SoftHSMv2/src/lib/session_mgr/Session.cpp13
-rw-r--r--SoftHSMv2/src/lib/session_mgr/Session.h6
2 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 54c0ff7..67820ed 100644
--- a/SoftHSMv2/src/lib/session_mgr/Session.cpp
+++ b/SoftHSMv2/src/lib/session_mgr/Session.cpp
@@ -61,6 +61,7 @@ Session::Session(Slot* inSlot, bool inIsReadWrite, CK_VOID_PTR inPApplication, C
// Storing Key handle in session
hKey = CK_INVALID_HANDLE;
+ hwCryptoOpaque = NULL;
}
// Constructor
@@ -91,6 +92,7 @@ Session::Session()
// Storing Key handle in session
hKey = CK_INVALID_HANDLE;
+ hwCryptoOpaque = NULL;
}
// Destructor
@@ -471,3 +473,14 @@ SymmetricKey* Session::getSymmetricKey()
{
return symmetricKey;
}
+
+void Session::setHwCryptoOpaque(void *inHwCryptoOpaque )
+{
+ hwCryptoOpaque = inHwCryptoOpaque;
+}
+
+void* Session::getHwCryptoOpaque()
+{
+ return hwCryptoOpaque;
+}
+
diff --git a/SoftHSMv2/src/lib/session_mgr/Session.h b/SoftHSMv2/src/lib/session_mgr/Session.h
index 128fb2b..39f19db 100644
--- a/SoftHSMv2/src/lib/session_mgr/Session.h
+++ b/SoftHSMv2/src/lib/session_mgr/Session.h
@@ -127,6 +127,9 @@ public:
void setKeyHandle(CK_OBJECT_HANDLE inHKey);
CK_OBJECT_HANDLE getKeyHandle();
+ void setHwCryptoOpaque(void* inHwCryptoOpaque);
+ void *getHwCryptoOpaque();
+
private:
// Constructor
Session();
@@ -174,6 +177,9 @@ private:
// Symmetric Crypto
SymmetricKey* symmetricKey;
+ // hw plugin specific data
+ void *hwCryptoOpaque;
+
// Storing Key handle in session
CK_OBJECT_HANDLE hKey;
};