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/rakp12.cpp b/command/rakp12.cpp
index c52d188..b0aad87 100644
--- a/command/rakp12.cpp
+++ b/command/rakp12.cpp
@@ -1,5 +1,10 @@
#include "rakp12.hpp"
+#include "comm_module.hpp"
+#include "endian.hpp"
+#include "guid.hpp"
+#include "main.hpp"
+
#include <openssl/rand.h>
#include <algorithm>
@@ -7,11 +12,6 @@
#include <iomanip>
#include <iostream>
-#include "comm_module.hpp"
-#include "endian.hpp"
-#include "guid.hpp"
-#include "main.hpp"
-
namespace command
{
@@ -23,8 +23,8 @@
auto response = reinterpret_cast<RAKP2response*>(outPayload.data());
// 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 << "RAKP12: BMC invalid Session ID\n";
response->rmcpStatusCode =
@@ -35,8 +35,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)
{
@@ -46,12 +48,12 @@
return outPayload;
}
- auto rakp1Size = sizeof(RAKP1request) -
- (userNameMaxLen - request->user_name_len);
+ auto rakp1Size =
+ sizeof(RAKP1request) - (userNameMaxLen - request->user_name_len);
// Validate user name length in the message
if (request->user_name_len > userNameMaxLen ||
- inPayload.size() != rakp1Size)
+ inPayload.size() != rakp1Size)
{
response->rmcpStatusCode =
static_cast<uint8_t>(RAKP_ReturnCode::INVALID_NAME_LENGTH);
@@ -92,16 +94,15 @@
std::vector<uint8_t> input;
input.resize(sizeof(rcSessionID) + sizeof(bmcSessionID) +
cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN +
- cipher::rakp_auth::BMC_RANDOM_NUMBER_LEN +
- BMC_GUID_LEN + sizeof(request->req_max_privilege_level) +
- sizeof(request->user_name_len) +
- session->userName.size());
+ cipher::rakp_auth::BMC_RANDOM_NUMBER_LEN + BMC_GUID_LEN +
+ sizeof(request->req_max_privilege_level) +
+ sizeof(request->user_name_len) + session->userName.size());
auto iter = input.begin();
// Remote Console Session ID
- std::copy_n(reinterpret_cast<uint8_t*>(&rcSessionID),
- sizeof(rcSessionID), iter);
+ std::copy_n(reinterpret_cast<uint8_t*>(&rcSessionID), sizeof(rcSessionID),
+ iter);
std::advance(iter, sizeof(rcSessionID));
// Managed System Session ID
@@ -111,18 +112,17 @@
// Copy the Remote Console Random Number from the RAKP1 request to the
// Authentication Algorithm
- std::copy_n(reinterpret_cast<const uint8_t*>
- (request->remote_console_random_number),
- cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN,
- authAlgo->rcRandomNum.begin());
+ std::copy_n(
+ reinterpret_cast<const uint8_t*>(request->remote_console_random_number),
+ cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN,
+ authAlgo->rcRandomNum.begin());
- 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);
// Generate the Managed System Random Number
if (!RAND_bytes(input.data() + sizeof(rcSessionID) + sizeof(bmcSessionID) +
- cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN,
+ cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN,
cipher::rakp_auth::BMC_RANDOM_NUMBER_LEN))
{
response->rmcpStatusCode =
@@ -140,8 +140,8 @@
std::advance(iter, BMC_GUID_LEN);
// Requested Privilege Level
- session->curPrivLevel = static_cast<session::Privilege>
- (request->req_max_privilege_level);
+ session->curPrivLevel =
+ static_cast<session::Privilege>(request->req_max_privilege_level);
std::copy_n(&(request->req_max_privilege_level),
sizeof(request->req_max_privilege_level), iter);
std::advance(iter, sizeof(request->req_max_privilege_level));
@@ -162,15 +162,14 @@
response->messageTag = request->messageTag;
response->rmcpStatusCode = static_cast<uint8_t>(RAKP_ReturnCode::NO_ERROR);
response->reserved = 0;
- response->remoteConsoleSessionID = rcSessionID ;
+ response->remoteConsoleSessionID = rcSessionID;
// Copy Managed System Random Number to the Response
std::copy(authAlgo->bmcRandomNum.begin(), authAlgo->bmcRandomNum.end(),
response->managed_system_random_number);
// Copy System GUID to the Response
- std::copy_n(cache::guid.data(),
- cache::guid.size(),
+ std::copy_n(cache::guid.data(), cache::guid.size(),
response->managed_system_guid);
// Insert the HMAC output into the payload