summaryrefslogtreecommitdiffstats
path: root/command/rakp12.hpp
blob: f68ec47f7171d2f20f48b2e7a4dcf829daedab00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#pragma once

#include <vector>

#include "message_handler.hpp"
#include "comm_module.hpp"

namespace command
{

/*
 * @struct RAKP1request
 *
 * IPMI Payload for RAKP Message 1
 */
struct RAKP1request
{
    uint8_t messageTag;
    uint8_t reserved1;
    uint16_t reserved2;
    uint32_t managedSystemSessionID;
    uint8_t remote_console_random_number[16];
    uint8_t req_max_privilege_level;
    uint16_t reserved3;
    uint8_t user_name_len;
    char user_name[16];
} __attribute__((packed));

/*
 * @struct RAKP2response
 *
 * IPMI Payload for RAKP Message 2
 */
struct RAKP2response
{
    uint8_t messageTag;
    uint8_t rmcpStatusCode;
    uint16_t reserved;
    uint32_t remoteConsoleSessionID;
    uint8_t managed_system_random_number[16];
    uint8_t managed_system_guid[16];
} __attribute__((packed));

/*
 * @brief RAKP Message 1, RAKP Message 2
 *
 * These messages are used to exchange random number and identification
 * information between the BMC and the remote console that are, in effect,
 * mutual challenges for a challenge/response. (Unlike IPMI v1.5, the v2.0/RMCP+
 * challenge/response is symmetric. I.e. the remote console and BMC both issues
 * challenges,and both need to provide valid responses for the session to be
 * activated.)
 *
 * The remote console request (RAKP Message 1) passes a random number and
 * username/privilege information that the BMC will later use to ‘sign’ a
 * response message based on key information associated with the user and the
 * Authentication Algorithm negotiated in the Open Session Request/Response
 * exchange. The BMC responds with RAKP Message 2 and passes a random number and
 * GUID (globally unique ID) for the managed system that the remote console
 * uses according the Authentication Algorithm to sign a response back to the
 * BMC.
 *
 * @param[in] inPayload - Request Data for the command
 * @param[in] handler - Reference to the Message Handler
 *
 * @return Response data for the command
 */
std::vector<uint8_t> RAKP12(std::vector<uint8_t>& inPayload,
                            const message::Handler& handler);

} // namespace command
OpenPOWER on IntegriCloud