Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 1 | #include "rakp12.hpp" |
| 2 | |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 3 | #include "comm_module.hpp" |
| 4 | #include "endian.hpp" |
| 5 | #include "guid.hpp" |
| 6 | #include "main.hpp" |
| 7 | |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 8 | #include <openssl/rand.h> |
| 9 | |
| 10 | #include <algorithm> |
Tom Joseph | 56527b9 | 2018-03-21 19:31:58 +0530 | [diff] [blame] | 11 | #include <cstring> |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 12 | #include <iomanip> |
Vernon Mauery | fc37e59 | 2018-12-19 14:55:15 -0800 | [diff] [blame] | 13 | #include <phosphor-logging/log.hpp> |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 14 | |
Vernon Mauery | fc37e59 | 2018-12-19 14:55:15 -0800 | [diff] [blame] | 15 | using namespace phosphor::logging; |
| 16 | |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 17 | namespace command |
| 18 | { |
| 19 | |
AppaRao Puli | ecb32fb | 2020-07-01 22:55:38 +0530 | [diff] [blame^] | 20 | bool isChannelAccessModeEnabled(const uint8_t accessMode) |
| 21 | { |
| 22 | return accessMode != |
| 23 | static_cast<uint8_t>(ipmi::EChannelAccessMode::disabled); |
| 24 | } |
| 25 | |
Tom Joseph | 18a45e9 | 2017-04-11 11:30:44 +0530 | [diff] [blame] | 26 | std::vector<uint8_t> RAKP12(const std::vector<uint8_t>& inPayload, |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 27 | const message::Handler& handler) |
| 28 | { |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 29 | std::vector<uint8_t> outPayload(sizeof(RAKP2response)); |
Tom Joseph | 18a45e9 | 2017-04-11 11:30:44 +0530 | [diff] [blame] | 30 | auto request = reinterpret_cast<const RAKP1request*>(inPayload.data()); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 31 | auto response = reinterpret_cast<RAKP2response*>(outPayload.data()); |
| 32 | |
| 33 | // Session ID zero is reserved for Session Setup |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 34 | if (endian::from_ipmi(request->managedSystemSessionID) == |
Suryakanth Sekar | f8a34fc | 2019-06-12 20:59:18 +0530 | [diff] [blame] | 35 | session::sessionZero) |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 36 | { |
Vernon Mauery | fc37e59 | 2018-12-19 14:55:15 -0800 | [diff] [blame] | 37 | log<level::INFO>("RAKP12: BMC invalid Session ID"); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 38 | response->rmcpStatusCode = |
| 39 | static_cast<uint8_t>(RAKP_ReturnCode::INVALID_SESSION_ID); |
| 40 | return outPayload; |
| 41 | } |
| 42 | |
| 43 | std::shared_ptr<session::Session> session; |
| 44 | try |
| 45 | { |
Vernon Mauery | ae1fda4 | 2018-10-15 12:55:34 -0700 | [diff] [blame] | 46 | session = |
| 47 | std::get<session::Manager&>(singletonPool) |
| 48 | .getSession(endian::from_ipmi(request->managedSystemSessionID)); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 49 | } |
| 50 | catch (std::exception& e) |
| 51 | { |
Vernon Mauery | fc37e59 | 2018-12-19 14:55:15 -0800 | [diff] [blame] | 52 | log<level::ERR>("RAKP12 : session not found", |
| 53 | entry("EXCEPTION=%s", e.what())); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 54 | response->rmcpStatusCode = |
| 55 | static_cast<uint8_t>(RAKP_ReturnCode::INVALID_SESSION_ID); |
| 56 | return outPayload; |
| 57 | } |
| 58 | |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 59 | auto rakp1Size = |
| 60 | sizeof(RAKP1request) - (userNameMaxLen - request->user_name_len); |
Tom Joseph | 56527b9 | 2018-03-21 19:31:58 +0530 | [diff] [blame] | 61 | |
| 62 | // Validate user name length in the message |
| 63 | if (request->user_name_len > userNameMaxLen || |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 64 | inPayload.size() != rakp1Size) |
Tom Joseph | 56527b9 | 2018-03-21 19:31:58 +0530 | [diff] [blame] | 65 | { |
| 66 | response->rmcpStatusCode = |
| 67 | static_cast<uint8_t>(RAKP_ReturnCode::INVALID_NAME_LENGTH); |
| 68 | return outPayload; |
| 69 | } |
| 70 | |
| 71 | session->userName.assign(request->user_name, request->user_name_len); |
| 72 | |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 73 | // Update transaction time |
| 74 | session->updateLastTransactionTime(); |
| 75 | |
| 76 | auto rcSessionID = endian::to_ipmi(session->getRCSessionID()); |
| 77 | auto bmcSessionID = endian::to_ipmi(session->getBMCSessionID()); |
| 78 | auto authAlgo = session->getAuthAlgo(); |
| 79 | |
| 80 | /* |
| 81 | * Generate Key Authentication Code - RAKP 2 |
| 82 | * |
| 83 | * 1) Remote Console Session ID - 4 bytes |
| 84 | * 2) Managed System Session ID - 4 bytes |
| 85 | * 3) Remote Console Random Number - 16 bytes |
| 86 | * 4) Managed System Random Number - 16 bytes |
| 87 | * 5) Managed System GUID - 16 bytes |
| 88 | * 6) Requested Privilege Level - 1 byte |
| 89 | * 7) User Name Length Byte - 1 byte (0 for 'null' username) |
| 90 | * 8) User Name - variable (absent for 'null' username) |
| 91 | */ |
| 92 | |
| 93 | std::vector<uint8_t> input; |
| 94 | input.resize(sizeof(rcSessionID) + sizeof(bmcSessionID) + |
| 95 | cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN + |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 96 | cipher::rakp_auth::BMC_RANDOM_NUMBER_LEN + BMC_GUID_LEN + |
| 97 | sizeof(request->req_max_privilege_level) + |
| 98 | sizeof(request->user_name_len) + session->userName.size()); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 99 | |
| 100 | auto iter = input.begin(); |
| 101 | |
| 102 | // Remote Console Session ID |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 103 | std::copy_n(reinterpret_cast<uint8_t*>(&rcSessionID), sizeof(rcSessionID), |
| 104 | iter); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 105 | std::advance(iter, sizeof(rcSessionID)); |
| 106 | |
| 107 | // Managed System Session ID |
| 108 | std::copy_n(reinterpret_cast<uint8_t*>(&bmcSessionID), sizeof(bmcSessionID), |
| 109 | iter); |
| 110 | std::advance(iter, sizeof(bmcSessionID)); |
| 111 | |
| 112 | // Copy the Remote Console Random Number from the RAKP1 request to the |
| 113 | // Authentication Algorithm |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 114 | std::copy_n( |
| 115 | reinterpret_cast<const uint8_t*>(request->remote_console_random_number), |
| 116 | cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN, |
| 117 | authAlgo->rcRandomNum.begin()); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 118 | |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 119 | std::copy(authAlgo->rcRandomNum.begin(), authAlgo->rcRandomNum.end(), iter); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 120 | std::advance(iter, cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN); |
| 121 | |
| 122 | // Generate the Managed System Random Number |
| 123 | if (!RAND_bytes(input.data() + sizeof(rcSessionID) + sizeof(bmcSessionID) + |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 124 | cipher::rakp_auth::REMOTE_CONSOLE_RANDOM_NUMBER_LEN, |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 125 | cipher::rakp_auth::BMC_RANDOM_NUMBER_LEN)) |
| 126 | { |
| 127 | response->rmcpStatusCode = |
| 128 | static_cast<uint8_t>(RAKP_ReturnCode::INSUFFICIENT_RESOURCE); |
| 129 | return outPayload; |
| 130 | } |
Richard Marian Thomaiyar | d5a4f45 | 2019-01-16 12:15:44 +0530 | [diff] [blame] | 131 | // As stated in Set Session Privilege Level command in IPMI Spec, when |
jayaprakash Mutyala | 2555e2e | 2019-12-24 22:51:46 +0000 | [diff] [blame] | 132 | // creating a session through Activate command / RAKP 1 message, it must |
| 133 | // be established with USER privilege as well as all other sessions are |
| 134 | // initially set to USER privilege, regardless of the requested maximum |
| 135 | // privilege. |
| 136 | if (!(static_cast<session::Privilege>(request->req_max_privilege_level & |
| 137 | session::reqMaxPrivMask) > |
| 138 | session::Privilege::CALLBACK)) |
Richard Marian Thomaiyar | d5a4f45 | 2019-01-16 12:15:44 +0530 | [diff] [blame] | 139 | { |
jayaprakash Mutyala | 2555e2e | 2019-12-24 22:51:46 +0000 | [diff] [blame] | 140 | response->rmcpStatusCode = |
| 141 | static_cast<uint8_t>(RAKP_ReturnCode::UNAUTH_ROLE_PRIV); |
| 142 | return outPayload; |
Richard Marian Thomaiyar | d5a4f45 | 2019-01-16 12:15:44 +0530 | [diff] [blame] | 143 | } |
jayaprakash Mutyala | 2555e2e | 2019-12-24 22:51:46 +0000 | [diff] [blame] | 144 | session->currentPrivilege(static_cast<uint8_t>(session::Privilege::USER)); |
| 145 | |
Tom Joseph | 4021b1f | 2019-02-12 10:10:12 +0530 | [diff] [blame] | 146 | session->reqMaxPrivLevel = |
| 147 | static_cast<session::Privilege>(request->req_max_privilege_level); |
Richard Marian Thomaiyar | d91fd9d | 2018-12-06 12:03:50 +0530 | [diff] [blame] | 148 | if (request->user_name_len == 0) |
Richard Marian Thomaiyar | 127748a | 2018-09-06 07:08:51 +0530 | [diff] [blame] | 149 | { |
Richard Marian Thomaiyar | d91fd9d | 2018-12-06 12:03:50 +0530 | [diff] [blame] | 150 | // Bail out, if user name is not specified. |
| 151 | // Yes, NULL user name is not supported for security reasons. |
Richard Marian Thomaiyar | 99b8784 | 2018-12-06 21:35:43 +0530 | [diff] [blame] | 152 | response->rmcpStatusCode = |
| 153 | static_cast<uint8_t>(RAKP_ReturnCode::UNAUTH_NAME); |
| 154 | return outPayload; |
Richard Marian Thomaiyar | d2563c5 | 2018-11-29 11:49:10 +0530 | [diff] [blame] | 155 | } |
Richard Marian Thomaiyar | 99b8784 | 2018-12-06 21:35:43 +0530 | [diff] [blame] | 156 | |
| 157 | // Perform user name based lookup |
| 158 | std::string userName(request->user_name, request->user_name_len); |
| 159 | std::string passwd; |
| 160 | uint8_t userId = ipmi::ipmiUserGetUserId(userName); |
| 161 | if (userId == ipmi::invalidUserId) |
| 162 | { |
| 163 | response->rmcpStatusCode = |
| 164 | static_cast<uint8_t>(RAKP_ReturnCode::UNAUTH_NAME); |
| 165 | return outPayload; |
| 166 | } |
| 167 | // check user is enabled before proceeding. |
| 168 | bool userEnabled = false; |
| 169 | ipmi::ipmiUserCheckEnabled(userId, userEnabled); |
| 170 | if (!userEnabled) |
| 171 | { |
| 172 | response->rmcpStatusCode = |
| 173 | static_cast<uint8_t>(RAKP_ReturnCode::INACTIVE_ROLE); |
| 174 | return outPayload; |
| 175 | } |
Richard Marian Thomaiyar | 4c4694e | 2019-06-20 16:36:49 +0530 | [diff] [blame] | 176 | // Get the user password for RAKP message authenticate |
| 177 | passwd = ipmi::ipmiUserGetPassword(userName); |
| 178 | if (passwd.empty()) |
| 179 | { |
| 180 | response->rmcpStatusCode = |
| 181 | static_cast<uint8_t>(RAKP_ReturnCode::UNAUTH_NAME); |
| 182 | return outPayload; |
| 183 | } |
Ayushi Smriti | b31e969 | 2019-05-15 12:06:51 +0000 | [diff] [blame] | 184 | // Check whether user is already locked for failed attempts |
| 185 | if (!ipmi::ipmiUserPamAuthenticate(userName, passwd)) |
| 186 | { |
| 187 | log<level::ERR>("Authentication failed - user already locked out", |
| 188 | entry("USER-ID=%d", static_cast<uint8_t>(userId))); |
| 189 | |
| 190 | response->rmcpStatusCode = |
| 191 | static_cast<uint8_t>(RAKP_ReturnCode::UNAUTH_NAME); |
| 192 | return outPayload; |
| 193 | } |
Saravanan Palanisamy | d9c86bb | 2019-08-07 17:57:37 +0000 | [diff] [blame] | 194 | |
| 195 | uint8_t chNum = static_cast<uint8_t>(getInterfaceIndex()); |
Richard Marian Thomaiyar | 99b8784 | 2018-12-06 21:35:43 +0530 | [diff] [blame] | 196 | // Get channel based access information |
Richard Marian Thomaiyar | 992e53c | 2019-03-03 13:30:46 +0530 | [diff] [blame] | 197 | if ((ipmi::ipmiUserGetPrivilegeAccess( |
| 198 | userId, chNum, session->sessionUserPrivAccess) != IPMI_CC_OK) || |
| 199 | (ipmi::getChannelAccessData(chNum, session->sessionChannelAccess) != |
| 200 | IPMI_CC_OK)) |
Richard Marian Thomaiyar | 99b8784 | 2018-12-06 21:35:43 +0530 | [diff] [blame] | 201 | { |
| 202 | response->rmcpStatusCode = |
| 203 | static_cast<uint8_t>(RAKP_ReturnCode::INACTIVE_ROLE); |
| 204 | return outPayload; |
| 205 | } |
AppaRao Puli | ecb32fb | 2020-07-01 22:55:38 +0530 | [diff] [blame^] | 206 | if (!isChannelAccessModeEnabled(session->sessionChannelAccess.accessMode)) |
| 207 | { |
| 208 | phosphor::logging::log<phosphor::logging::level::ERR>( |
| 209 | "Channel access mode disabled."); |
| 210 | response->rmcpStatusCode = |
| 211 | static_cast<uint8_t>(RAKP_ReturnCode::INACTIVE_ROLE); |
| 212 | return outPayload; |
| 213 | } |
Richard Marian Thomaiyar | 992e53c | 2019-03-03 13:30:46 +0530 | [diff] [blame] | 214 | if (session->sessionUserPrivAccess.privilege > |
| 215 | static_cast<uint8_t>(session::Privilege::OEM)) |
Richard Marian Thomaiyar | 7e5d38d | 2019-03-02 22:11:41 +0530 | [diff] [blame] | 216 | { |
| 217 | response->rmcpStatusCode = |
| 218 | static_cast<uint8_t>(RAKP_ReturnCode::INACTIVE_ROLE); |
| 219 | return outPayload; |
| 220 | } |
Suryakanth Sekar | f8a34fc | 2019-06-12 20:59:18 +0530 | [diff] [blame] | 221 | session->channelNum(chNum); |
| 222 | session->userID(userId); |
jayaprakash Mutyala | 2555e2e | 2019-12-24 22:51:46 +0000 | [diff] [blame] | 223 | // minimum privilege of Channel / User / session::privilege::USER |
Richard Marian Thomaiyar | d5a4f45 | 2019-01-16 12:15:44 +0530 | [diff] [blame] | 224 | // has to be used as session current privilege level |
Richard Marian Thomaiyar | 99b8784 | 2018-12-06 21:35:43 +0530 | [diff] [blame] | 225 | uint8_t minPriv = 0; |
Richard Marian Thomaiyar | 992e53c | 2019-03-03 13:30:46 +0530 | [diff] [blame] | 226 | if (session->sessionChannelAccess.privLimit < |
| 227 | session->sessionUserPrivAccess.privilege) |
Richard Marian Thomaiyar | 99b8784 | 2018-12-06 21:35:43 +0530 | [diff] [blame] | 228 | { |
Richard Marian Thomaiyar | 992e53c | 2019-03-03 13:30:46 +0530 | [diff] [blame] | 229 | minPriv = session->sessionChannelAccess.privLimit; |
Richard Marian Thomaiyar | 99b8784 | 2018-12-06 21:35:43 +0530 | [diff] [blame] | 230 | } |
| 231 | else |
| 232 | { |
Richard Marian Thomaiyar | 992e53c | 2019-03-03 13:30:46 +0530 | [diff] [blame] | 233 | minPriv = session->sessionUserPrivAccess.privilege; |
Richard Marian Thomaiyar | 99b8784 | 2018-12-06 21:35:43 +0530 | [diff] [blame] | 234 | } |
Suryakanth Sekar | f8a34fc | 2019-06-12 20:59:18 +0530 | [diff] [blame] | 235 | if (session->currentPrivilege() > minPriv) |
Richard Marian Thomaiyar | 99b8784 | 2018-12-06 21:35:43 +0530 | [diff] [blame] | 236 | { |
Suryakanth Sekar | f8a34fc | 2019-06-12 20:59:18 +0530 | [diff] [blame] | 237 | session->currentPrivilege(static_cast<uint8_t>(minPriv)); |
Richard Marian Thomaiyar | 99b8784 | 2018-12-06 21:35:43 +0530 | [diff] [blame] | 238 | } |
Richard Marian Thomaiyar | d91fd9d | 2018-12-06 12:03:50 +0530 | [diff] [blame] | 239 | // For username / privilege lookup, fail with UNAUTH_NAME, if requested |
Richard Marian Thomaiyar | d8e92fe | 2019-01-16 11:56:23 +0530 | [diff] [blame] | 240 | // max privilege does not match user privilege |
Richard Marian Thomaiyar | d91fd9d | 2018-12-06 12:03:50 +0530 | [diff] [blame] | 241 | if (((request->req_max_privilege_level & userNameOnlyLookupMask) == |
| 242 | userNamePrivLookup) && |
Richard Marian Thomaiyar | d8e92fe | 2019-01-16 11:56:23 +0530 | [diff] [blame] | 243 | ((request->req_max_privilege_level & session::reqMaxPrivMask) != |
Richard Marian Thomaiyar | 992e53c | 2019-03-03 13:30:46 +0530 | [diff] [blame] | 244 | session->sessionUserPrivAccess.privilege)) |
Richard Marian Thomaiyar | d91fd9d | 2018-12-06 12:03:50 +0530 | [diff] [blame] | 245 | { |
Vernon Mauery | fc37e59 | 2018-12-19 14:55:15 -0800 | [diff] [blame] | 246 | log<level::INFO>( |
| 247 | "Username/Privilege lookup failed for requested privilege"); |
Richard Marian Thomaiyar | d91fd9d | 2018-12-06 12:03:50 +0530 | [diff] [blame] | 248 | response->rmcpStatusCode = |
| 249 | static_cast<uint8_t>(RAKP_ReturnCode::UNAUTH_NAME); |
| 250 | return outPayload; |
| 251 | } |
Richard Marian Thomaiyar | 99b8784 | 2018-12-06 21:35:43 +0530 | [diff] [blame] | 252 | |
| 253 | std::fill(authAlgo->userKey.data(), |
| 254 | authAlgo->userKey.data() + authAlgo->userKey.size(), 0); |
| 255 | std::copy_n(passwd.c_str(), passwd.size(), authAlgo->userKey.data()); |
| 256 | |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 257 | // Copy the Managed System Random Number to the Authentication Algorithm |
| 258 | std::copy_n(iter, cipher::rakp_auth::BMC_RANDOM_NUMBER_LEN, |
| 259 | authAlgo->bmcRandomNum.begin()); |
| 260 | std::advance(iter, cipher::rakp_auth::BMC_RANDOM_NUMBER_LEN); |
| 261 | |
| 262 | // Managed System GUID |
Tom Joseph | 83029cb | 2017-09-01 16:37:31 +0530 | [diff] [blame] | 263 | std::copy_n(cache::guid.data(), cache::guid.size(), iter); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 264 | std::advance(iter, BMC_GUID_LEN); |
| 265 | |
| 266 | // Requested Privilege Level |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 267 | std::copy_n(&(request->req_max_privilege_level), |
| 268 | sizeof(request->req_max_privilege_level), iter); |
| 269 | std::advance(iter, sizeof(request->req_max_privilege_level)); |
| 270 | |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 271 | // User Name Length Byte |
| 272 | std::copy_n(&(request->user_name_len), sizeof(request->user_name_len), |
| 273 | iter); |
Tom Joseph | 56527b9 | 2018-03-21 19:31:58 +0530 | [diff] [blame] | 274 | std::advance(iter, sizeof(request->user_name_len)); |
| 275 | |
| 276 | std::copy_n(session->userName.data(), session->userName.size(), iter); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 277 | |
| 278 | // Generate Key Exchange Authentication Code - RAKP2 |
| 279 | auto output = authAlgo->generateHMAC(input); |
| 280 | |
| 281 | response->messageTag = request->messageTag; |
| 282 | response->rmcpStatusCode = static_cast<uint8_t>(RAKP_ReturnCode::NO_ERROR); |
| 283 | response->reserved = 0; |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 284 | response->remoteConsoleSessionID = rcSessionID; |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 285 | |
| 286 | // Copy Managed System Random Number to the Response |
| 287 | std::copy(authAlgo->bmcRandomNum.begin(), authAlgo->bmcRandomNum.end(), |
| 288 | response->managed_system_random_number); |
| 289 | |
| 290 | // Copy System GUID to the Response |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 291 | std::copy_n(cache::guid.data(), cache::guid.size(), |
Tom Joseph | 83029cb | 2017-09-01 16:37:31 +0530 | [diff] [blame] | 292 | response->managed_system_guid); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 293 | |
| 294 | // Insert the HMAC output into the payload |
| 295 | outPayload.insert(outPayload.end(), output.begin(), output.end()); |
Tom Joseph | 8bb10b7 | 2016-12-06 17:47:56 +0530 | [diff] [blame] | 296 | return outPayload; |
| 297 | } |
| 298 | |
| 299 | } // namespace command |