diff options
author | Tom Joseph <tomjoseph@in.ibm.com> | 2017-01-24 18:24:57 +0530 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-02-24 17:02:45 +0000 |
commit | 4c766eb1ec6700ca709cf39fefafdd4465165aa4 (patch) | |
tree | efc25e6b293de1049cb07e0eae2e0aa0e26cc037 | |
parent | 2f0bd0ebc319ad00d53964c649b0c760800abeb4 (diff) | |
download | phosphor-net-ipmid-4c766eb1ec6700ca709cf39fefafdd4465165aa4.tar.gz phosphor-net-ipmid-4c766eb1ec6700ca709cf39fefafdd4465165aa4.zip |
Set the Confidentiality Algo in the RAKP34 command
Change-Id: I7601b2fd35bedd0145533c5742ef4c848055eefd
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
-rw-r--r-- | command/rakp34.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
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 applyIntegrityAlgo(const uint32_t bmcSessionID) } } +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 @@ std::vector<uint8_t> RAKP34(std::vector<uint8_t>& inPayload, // Set the Integrity Algorithm applyIntegrityAlgo(session->getBMCSessionID()); + // Set the Confidentiality Algorithm + applyCryptAlgo(session->getBMCSessionID()); + session->state = session::State::ACTIVE; std::cout << "<< RAKP34\n"; |