summaryrefslogtreecommitdiffstats
path: root/app/channel.cpp
diff options
context:
space:
mode:
authorjayaprakash Mutyala <mutyalax.jayaprakash@intel.com>2019-10-03 19:36:49 +0000
committerVernon Mauery <vernon.mauery@linux.intel.com>2019-10-24 18:11:42 +0000
commit69daefa04a4f7d5ab21480137991b88c6b34ee1d (patch)
tree3ef0ec618652c5d167b3feee556e6836bc66e81a /app/channel.cpp
parentb87034e8ce17f0fbdfcbc8aa669e0bdec987b17e (diff)
downloadphosphor-host-ipmid-69daefa04a4f7d5ab21480137991b88c6b34ee1d.tar.gz
phosphor-host-ipmid-69daefa04a4f7d5ab21480137991b88c6b34ee1d.zip
channel:Fix get channel ciphersuite - payloadtypes
Issue: Get channel CipherSuite command passed with invalid payload type Fix: Added the check now to allow only valid payload types Tested: Command: ipmitool raw 0x06 0x54 0x01 0xff 0x80 Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x54 rsp=0x80): Unknown (0x80) Command: ipmitool raw 0x06 0x54 0x01 0x12 0x80 Response: 01 c0 03 01 41 81 c0 11 03 44 81 Command: ipmitool raw 0x06 0x54 0x01 0x09 0x80 Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x54 rsp=0x80): Unknown (0x80) Command: ipmitool raw 0x06 0x54 0x01 0x02 0x00 Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x54 rsp=0x80): Unknown (0x80) Command: ipmitool raw 0x06 0x54 0x01 0x12 0x00 Response: 01 01 03 41 44 81 Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: I552250736d7e898191ddbb45fd1bff42681b9c63
Diffstat (limited to 'app/channel.cpp')
-rw-r--r--app/channel.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/channel.cpp b/app/channel.cpp
index 1fa5b52..51e953d 100644
--- a/app/channel.cpp
+++ b/app/channel.cpp
@@ -128,6 +128,12 @@ ipmi::RspType<uint8_t, // Channel Number
{
return ipmi::responseInvalidFieldRequest();
}
+ if (!ipmi::isValidPayloadType(static_cast<ipmi::PayloadType>(payloadType)))
+ {
+ log<level::DEBUG>("Get channel cipher suites - Invalid payload type");
+ constexpr uint8_t ccPayloadTypeNotSupported = 0x80;
+ return ipmi::response(ccPayloadTypeNotSupported);
+ }
if (!recordInit)
{
OpenPOWER on IntegriCloud