diff options
author | Tom Joseph <tomjoseph@in.ibm.com> | 2017-01-24 18:20:41 +0530 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-02-24 17:02:45 +0000 |
commit | 491dbd0126b10d3a7a1aa0745edd57ac51dab371 (patch) | |
tree | a5e4ad77c7a69bc4ec152b04f5aa29219dffa136 | |
parent | 5469065f28b69997824f09a43944d50aad34eacb (diff) | |
download | phosphor-net-ipmid-491dbd0126b10d3a7a1aa0745edd57ac51dab371.tar.gz phosphor-net-ipmid-491dbd0126b10d3a7a1aa0745edd57ac51dab371.zip |
Modify the session data to handle the Confidentiality algo
Change-Id: I1be4bb4349a5dfe0a512017cc5ed8f80e5ab14d9
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
-rw-r--r-- | session.hpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/session.hpp b/session.hpp index 87a2276..1eec759 100644 --- a/session.hpp +++ b/session.hpp @@ -8,6 +8,7 @@ #include <vector> #include "auth_algo.hpp" +#include "crypt_algo.hpp" #include "integrity_algo.hpp" #include "endian.hpp" #include "socket_channel.hpp" @@ -172,6 +173,35 @@ class Session integrityAlgoInterface = std::move(integrityAlgo); } + /* + * @brief Get Session's Confidentiality Algorithm + * + * @return pointer to the confidentiality algorithm + */ + auto getCryptAlgo() const + { + if(cryptAlgoInterface) + { + return cryptAlgoInterface.get(); + } + else + { + throw std::runtime_error("Confidentiality Algorithm Empty"); + } + } + + /* + * @brief Set Session's Confidentiality Algorithm + * + * @param[in] confAlgo - unique pointer to confidentiality algorithm + * instance + */ + void setCryptAlgo( + std::unique_ptr<cipher::crypt::Interface>&& cryptAlgo) + { + cryptAlgoInterface = std::move(cryptAlgo); + } + void updateLastTransactionTime() { lastTime = std::chrono::steady_clock::now(); @@ -212,6 +242,10 @@ class Session std::unique_ptr<cipher::integrity::Interface> integrityAlgoInterface = nullptr; + // Confidentiality Algorithm Interface for the Session + std::unique_ptr<cipher::crypt::Interface> cryptAlgoInterface = + nullptr; + // Last Transaction Time decltype(std::chrono::steady_clock::now()) lastTime; }; |