blob: a6b8703dc4f03e30276f1d0bd272cbbbfec64fdc [file] [log] [blame]
Tom Joseph7cbe2282018-03-21 21:17:33 +05301#include "nlohmann/json.hpp"
Patrick Venture5794fcf2017-10-26 11:11:14 -07002
Ayushi Smriti5c3b72c2019-08-30 13:47:31 +00003#include <ipmid/api.hpp>
Vernon Mauery392050f2019-04-01 14:53:19 -07004
Ayushi Smriti5c3b72c2019-08-30 13:47:31 +00005/** @brief this command is used to look up what authentication, integrity,
6 * confidentiality algorithms are supported.
Tom Joseph7cbe2282018-03-21 21:17:33 +05307 *
Ayushi Smriti5c3b72c2019-08-30 13:47:31 +00008 * @ param ctx - context pointer
9 * @ param channelNumber - channel number
10 * @ param payloadType - payload type
11 * @ param listIndex - list index
12 * @ param algoSelectBit - list algorithms
Tom Joseph7cbe2282018-03-21 21:17:33 +053013 *
Ayushi Smriti5c3b72c2019-08-30 13:47:31 +000014 * @returns ipmi completion code plus response data
15 * - rspChannel - channel number for authentication algorithm.
16 * - rspRecords - cipher suite records.
17 **/
18ipmi::RspType<uint8_t, // Channel Number
19 std::vector<uint8_t> // Cipher Records
20 >
21 getChannelCipherSuites(ipmi::Context::ptr ctx, uint4_t channelNumber,
22 uint4_t reserved1, uint8_t payloadType,
23 uint6_t listIndex, uint1_t reserved2,
24 uint1_t algoSelectBit);
Tom Joseph7cbe2282018-03-21 21:17:33 +053025
26namespace cipher
27{
28
Tom Joseph7cbe2282018-03-21 21:17:33 +053029static constexpr auto listCipherSuite = 0x80;
Tom Joseph7cbe2282018-03-21 21:17:33 +053030
31using Json = nlohmann::json;
Patrick Venture0b02be92018-08-31 11:55:55 -070032static constexpr auto configFile = "/usr/share/ipmi-providers/cipher_list.json";
Tom Joseph7cbe2282018-03-21 21:17:33 +053033static constexpr auto cipher = "cipher";
34static constexpr auto stdCipherSuite = 0xC0;
35static constexpr auto oemCipherSuite = 0xC1;
36static constexpr auto oem = "oemiana";
37static constexpr auto auth = "authentication";
38static constexpr auto integrity = "integrity";
39static constexpr auto integrityTag = 0x40;
40static constexpr auto conf = "confidentiality";
41static constexpr auto confTag = 0x80;
42
Patrick Venture0b02be92018-08-31 11:55:55 -070043} // namespace cipher