Tom Joseph | 7cbe228 | 2018-03-21 21:17:33 +0530 | [diff] [blame] | 1 | #include "nlohmann/json.hpp" |
Patrick Venture | 5794fcf | 2017-10-26 11:11:14 -0700 | [diff] [blame] | 2 | |
Ayushi Smriti | 5c3b72c | 2019-08-30 13:47:31 +0000 | [diff] [blame] | 3 | #include <ipmid/api.hpp> |
Vernon Mauery | 392050f | 2019-04-01 14:53:19 -0700 | [diff] [blame] | 4 | |
Ayushi Smriti | 5c3b72c | 2019-08-30 13:47:31 +0000 | [diff] [blame] | 5 | /** @brief this command is used to look up what authentication, integrity, |
| 6 | * confidentiality algorithms are supported. |
Tom Joseph | 7cbe228 | 2018-03-21 21:17:33 +0530 | [diff] [blame] | 7 | * |
Ayushi Smriti | 5c3b72c | 2019-08-30 13:47:31 +0000 | [diff] [blame] | 8 | * @ 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 Joseph | 7cbe228 | 2018-03-21 21:17:33 +0530 | [diff] [blame] | 13 | * |
Ayushi Smriti | 5c3b72c | 2019-08-30 13:47:31 +0000 | [diff] [blame] | 14 | * @returns ipmi completion code plus response data |
| 15 | * - rspChannel - channel number for authentication algorithm. |
| 16 | * - rspRecords - cipher suite records. |
| 17 | **/ |
| 18 | ipmi::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 Joseph | 7cbe228 | 2018-03-21 21:17:33 +0530 | [diff] [blame] | 25 | |
| 26 | namespace cipher |
| 27 | { |
| 28 | |
Tom Joseph | 7cbe228 | 2018-03-21 21:17:33 +0530 | [diff] [blame] | 29 | static constexpr auto listCipherSuite = 0x80; |
Tom Joseph | 7cbe228 | 2018-03-21 21:17:33 +0530 | [diff] [blame] | 30 | |
| 31 | using Json = nlohmann::json; |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 32 | static constexpr auto configFile = "/usr/share/ipmi-providers/cipher_list.json"; |
Tom Joseph | 7cbe228 | 2018-03-21 21:17:33 +0530 | [diff] [blame] | 33 | static constexpr auto cipher = "cipher"; |
| 34 | static constexpr auto stdCipherSuite = 0xC0; |
| 35 | static constexpr auto oemCipherSuite = 0xC1; |
| 36 | static constexpr auto oem = "oemiana"; |
| 37 | static constexpr auto auth = "authentication"; |
| 38 | static constexpr auto integrity = "integrity"; |
| 39 | static constexpr auto integrityTag = 0x40; |
| 40 | static constexpr auto conf = "confidentiality"; |
| 41 | static constexpr auto confTag = 0x80; |
| 42 | |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 43 | } // namespace cipher |