Fix: execute get channel cipher suite in lan chan
Get channel cipher suites command was executed for non lan channels.
Fixing the same by adding active lan channel support check.
Tested:
ipmitool raw 0x06 0x54 0x01 0x00 0x80
01 c0 03 01 41 81 c0 11 03 44 81
//cmd executed for lan chan 1
ipmitool raw 0x06 0x54 0x00 0x00 0x80
Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
cmd=0x54 rsp=0xcc): Invalid data field in request
//cc resulted for non lan chan 0
Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com>
Change-Id: Ic3c2dfa3f4537be789e2afc912fa8f4c2a49bda4
diff --git a/app/channel.cpp b/app/channel.cpp
index 91cbe88..7006c92 100644
--- a/app/channel.cpp
+++ b/app/channel.cpp
@@ -148,6 +148,15 @@
algoSelectBit ? cipherRecords : supportedAlgorithms;
static constexpr auto respSize = 16;
+ // Session support is available in active LAN channels.
+ if ((ipmi::getChannelSessionSupport(rspChannel) ==
+ ipmi::EChannelSessSupported::none) ||
+ !(ipmi::doesDeviceExist(rspChannel)))
+ {
+ log<level::DEBUG>("Get channel cipher suites - Device does not exist");
+ return ipmi::responseInvalidFieldRequest();
+ }
+
// List index(00h-3Fh), 0h selects the first set of 16, 1h selects the next
// set of 16 and so on.