Fix: Set User Password cmd fails with 0xc7 CC

Issue: Set User Password command (47h) fails with 0xc7 req data length
invalid CC on disable/enable user operation.
According to the IPMI spec, the 'password data' req bytes in Set User
Password cmd need not be present if the operation is ‘disable user’ or
‘enable user’.

This change adds proper checks to address the above issue.

Tested:
Executed set user password cmd and verified success response

previous:
root@intel-obmc:~# ipmitool raw 0x06 0x47 0x02 0x00
Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x47
rsp=0xc7): Request data length invalid
root@intel-obmc:~# ipmitool raw 0x06 0x47 0x02 0x01
Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x47
rsp=0xc7): Request data length invalid

After fix:
root@intel-obmc:~# ipmitool raw 0x06 0x47 0x02 0x00

root@intel-obmc:~# ipmitool raw 0x06 0x47 0x02 0x01

Change-Id: Idad719e75abb37d6aebff510ea2339a93bea84dd
Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com>
1 file changed