netipmid: apply clang-format rules
Lots of whitespace change. Let clang-format do its job and keep the code
looking nice.
Change-Id: Idfcad1a99cab8170d55a06163de8ad3f420b68b7
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/command/rakp34.cpp b/command/rakp34.cpp
index 37335a8..76236d5 100644
--- a/command/rakp34.cpp
+++ b/command/rakp34.cpp
@@ -1,22 +1,23 @@
#include "rakp34.hpp"
-#include <algorithm>
-#include <cstring>
-#include <iostream>
-
#include "comm_module.hpp"
#include "endian.hpp"
#include "guid.hpp"
#include "main.hpp"
#include "rmcp.hpp"
+#include <algorithm>
+#include <cstring>
+#include <iostream>
+
namespace command
{
void applyIntegrityAlgo(const uint32_t bmcSessionID)
{
- auto session = (std::get<session::Manager&>(singletonPool).getSession(
- bmcSessionID)).lock();
+ auto session =
+ (std::get<session::Manager&>(singletonPool).getSession(bmcSessionID))
+ .lock();
auto authAlgo = session->getAuthAlgo();
@@ -25,15 +26,15 @@
case cipher::integrity::Algorithms::HMAC_SHA1_96:
{
session->setIntegrityAlgo(
- std::make_unique<cipher::integrity::AlgoSHA1>(
- authAlgo->sessionIntegrityKey));
+ std::make_unique<cipher::integrity::AlgoSHA1>(
+ authAlgo->sessionIntegrityKey));
break;
}
case cipher::integrity::Algorithms::HMAC_SHA256_128:
{
session->setIntegrityAlgo(
std::make_unique<cipher::integrity::AlgoSHA256>(
- authAlgo->sessionIntegrityKey));
+ authAlgo->sessionIntegrityKey));
break;
}
default:
@@ -43,8 +44,9 @@
void applyCryptAlgo(const uint32_t bmcSessionID)
{
- auto session = (std::get<session::Manager&>(singletonPool).getSession(
- bmcSessionID)).lock();
+ auto session =
+ (std::get<session::Manager&>(singletonPool).getSession(bmcSessionID))
+ .lock();
auto authAlgo = session->getAuthAlgo();
@@ -53,10 +55,10 @@
case cipher::crypt::Algorithms::AES_CBC_128:
{
auto intAlgo = session->getIntegrityAlgo();
- auto k2 = intAlgo->generateKn(
- authAlgo->sessionIntegrityKey, rmcp::const_2);
+ auto k2 = intAlgo->generateKn(authAlgo->sessionIntegrityKey,
+ rmcp::const_2);
session->setCryptAlgo(
- std::make_unique<cipher::crypt::AlgoAES128>(k2));
+ std::make_unique<cipher::crypt::AlgoAES128>(k2));
break;
}
default:
@@ -82,8 +84,8 @@
}
// Session ID zero is reserved for Session Setup
- if(endian::from_ipmi(request->managedSystemSessionID) ==
- session::SESSION_ZERO)
+ if (endian::from_ipmi(request->managedSystemSessionID) ==
+ session::SESSION_ZERO)
{
std::cerr << "RAKP34: BMC invalid Session ID\n";
response->rmcpStatusCode =
@@ -94,8 +96,10 @@
std::shared_ptr<session::Session> session;
try
{
- session = (std::get<session::Manager&>(singletonPool).getSession(
- endian::from_ipmi(request->managedSystemSessionID))).lock();
+ session = (std::get<session::Manager&>(singletonPool)
+ .getSession(
+ endian::from_ipmi(request->managedSystemSessionID)))
+ .lock();
}
catch (std::exception& e)
{
@@ -159,19 +163,19 @@
auto output = authAlgo->generateHMAC(input);
if (inPayload.size() != (sizeof(RAKP3request) + output.size()) ||
- std::memcmp(output.data(), request+1, output.size()))
+ std::memcmp(output.data(), request + 1, output.size()))
{
std::cerr << "Mismatch in HMAC sent by remote console\n";
response->messageTag = request->messageTag;
- response->rmcpStatusCode = static_cast<uint8_t>
- (RAKP_ReturnCode::INVALID_INTEGRITY_VALUE);
+ response->rmcpStatusCode =
+ static_cast<uint8_t>(RAKP_ReturnCode::INVALID_INTEGRITY_VALUE);
response->reserved = 0;
response->remoteConsoleSessionID = rcSessionID;
- //close the session
- std::get<session::Manager&>(singletonPool).stopSession(
- session->getBMCSessionID());
+ // close the session
+ std::get<session::Manager&>(singletonPool)
+ .stopSession(session->getBMCSessionID());
return outPayload;
}
@@ -194,8 +198,7 @@
iter = input.begin();
// Remote Console Random Number
- std::copy(authAlgo->rcRandomNum.begin(), authAlgo->rcRandomNum.end(),
- iter);
+ std::copy(authAlgo->rcRandomNum.begin(), authAlgo->rcRandomNum.end(), iter);
std::advance(iter, cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN);
// Managed Console Random Number
@@ -239,8 +242,7 @@
iter = input.begin();
// Remote Console Random Number
- std::copy(authAlgo->rcRandomNum.begin(), authAlgo->rcRandomNum.end(),
- iter);
+ std::copy(authAlgo->rcRandomNum.begin(), authAlgo->rcRandomNum.end(), iter);
std::advance(iter, cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN);
// Managed System Session ID