transporthandler:Fix get lan config param 22 & 23
Issue: get Lan configuration command for ciphersuite are getting
executed successfully for session less channel.
Fix: get lan config - provided fix by returning error for session
less channel
Test:
Before:
Command: ipmitool raw 0x0c 0x02 0x7 0x16 0x00 0x00 // GetLan cipher support
Response: 11 01 // Success
Command: ipmitool raw 0x0c 0x02 0x7 0x17 0x00 0x00 // Getlan cipher entry
Response: 11 00 11 // Success
After:
Command: ipmitool raw 0x0c 0x02 0x7 0x16 0x00 0x00 // GetLan cipher support
Response: Unable to send RAW command (channel=0x0 netfn=0xc
lun=0x0 cmd=0x2 rsp=0xcc): Invalid data field in request
Command: ipmitool raw 0x0c 0x02 0x7 0x17 0x00 0x00 // Getlan cipher entry
Response: Unable to send RAW command (channel=0x0 netfn=0xc
lun=0x0 cmd=0x2 rsp=0xcc): Invalid data field in request
Before and After: Session based LAN channel 3:
Command: ipmitool raw 0x0c 0x02 0x3 0x16 0x00 0x00 // GetLan cipher support
Response: 11 01 // Success
Command: ipmitool raw 0x0c 0x02 0x3 0x17 0x00 0x00 // Getlan cipher entry
Response: 11 00 11 // Success
Signed-off-by: srikanta mondal <srikantax.mondal@intel.com>
Change-Id: I00d4f85c7461821e25e77efd885a08b859d421ec
diff --git a/transporthandler.cpp b/transporthandler.cpp
index d570996..3813d05 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -1854,6 +1854,11 @@
}
case LanParam::CiphersuiteSupport:
{
+ if (getChannelSessionSupport(channel) ==
+ EChannelSessSupported::none)
+ {
+ return responseInvalidFieldRequest();
+ }
if (!listInit)
{
return responseUnspecifiedError();
@@ -1863,6 +1868,11 @@
}
case LanParam::CiphersuiteEntries:
{
+ if (getChannelSessionSupport(channel) ==
+ EChannelSessSupported::none)
+ {
+ return responseInvalidFieldRequest();
+ }
if (!listInit)
{
return responseUnspecifiedError();