summaryrefslogtreecommitdiffstats
path: root/session.hpp
diff options
context:
space:
mode:
authorTom Joseph <tomjoseph@in.ibm.com>2017-01-10 16:02:07 +0530
committerTom Joseph <tomjoseph@in.ibm.com>2017-01-17 14:59:21 +0530
commit638d0666d37f94ed91cf5cf20e7adddce3d47015 (patch)
tree185f9620904da5b0eb602c9fe7e0e6e91e8a3c7c /session.hpp
parentd212a6dc85e0dcfb481e5925c46869804dbf2d87 (diff)
downloadphosphor-net-ipmid-638d0666d37f94ed91cf5cf20e7adddce3d47015.tar.gz
phosphor-net-ipmid-638d0666d37f94ed91cf5cf20e7adddce3d47015.zip
Session data modified to handle integrity algo
Change-Id: I3ebc8f2e1599b01e3cfb89c2ab17651d549a7ca1 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Diffstat (limited to 'session.hpp')
-rw-r--r--session.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/session.hpp b/session.hpp
index 390d305..29e3340 100644
--- a/session.hpp
+++ b/session.hpp
@@ -8,6 +8,7 @@
#include <vector>
#include "auth_algo.hpp"
+#include "integrity_algo.hpp"
#include "endian.hpp"
#include "socket_channel.hpp"
@@ -142,6 +143,35 @@ class Session
authAlgoInterface = std::move(inAuthAlgo);
}
+ /*
+ * @brief Get Session's Integrity Algorithm
+ *
+ * @return pointer to the integrity algorithm
+ */
+ auto getIntegrityAlgo() const
+ {
+ if(integrityAlgoInterface)
+ {
+ return integrityAlgoInterface.get();
+ }
+ else
+ {
+ throw std::runtime_error("Integrity Algorithm Empty");
+ }
+ }
+
+ /*
+ * @brief Set Session's Integrity Algorithm
+ *
+ * @param[in] integrityAlgo - unique pointer to integrity algorithm
+ * instance
+ */
+ void setIntegrityAlgo(
+ std::unique_ptr<cipher::integrity::Interface>&& integrityAlgo)
+ {
+ integrityAlgoInterface = std::move(integrityAlgo);
+ }
+
void updateLastTransactionTime()
{
lastTime = std::chrono::steady_clock::now();
@@ -178,6 +208,10 @@ class Session
// Authentication Algorithm Interface for the Session
std::unique_ptr<cipher::rakp_auth::Interface> authAlgoInterface;
+ // Integrity Algorithm Interface for the Session
+ std::unique_ptr<cipher::integrity::Interface> integrityAlgoInterface =
+ nullptr;
+
// Last Transaction Time
decltype(std::chrono::steady_clock::now()) lastTime;
};
OpenPOWER on IntegriCloud