Set the Confidentiality Algo in the RAKP34 command
Change-Id: I7601b2fd35bedd0145533c5742ef4c848055eefd
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/command/rakp34.cpp b/command/rakp34.cpp
index 398a1e7..cd455cd 100644
--- a/command/rakp34.cpp
+++ b/command/rakp34.cpp
@@ -33,6 +33,26 @@
}
}
+void applyCryptAlgo(const uint32_t bmcSessionID)
+{
+ auto session = (std::get<session::Manager&>(singletonPool).getSession(
+ bmcSessionID)).lock();
+
+ auto authAlgo = session->getAuthAlgo();
+
+ switch (authAlgo->cryptAlgo)
+ {
+ case cipher::crypt::Algorithms::AES_CBC_128:
+ {
+ session->setCryptAlgo(std::make_unique<cipher::crypt::AlgoAES128>(
+ authAlgo->sessionIntegrityKey));
+ break;
+ }
+ default:
+ break;
+ }
+}
+
std::vector<uint8_t> RAKP34(std::vector<uint8_t>& inPayload,
const message::Handler& handler)
{
@@ -232,6 +252,9 @@
// Set the Integrity Algorithm
applyIntegrityAlgo(session->getBMCSessionID());
+ // Set the Confidentiality Algorithm
+ applyCryptAlgo(session->getBMCSessionID());
+
session->state = session::State::ACTIVE;
std::cout << "<< RAKP34\n";