Value setting for IPMI clear security keys

Support to set the value for ClearSecurityKeys property which can be used to
indicate when certain security keys need to be cleared or reset those values
back to its default state from the system by the host. This property is mapped
to an IPMI sensor and default value will be zero. Setting this property does
not gurantee a successful operation as additional conditions like the physical
presence pin or jumper settings will be checked by the host to clear/reset the
sensitive data.

Tested: Verified that the property is getting created with the expected
default value as zero and can be updated to different values using ipmitool
or busctl command.

1. Default value output:
busctl get-property xyz.openbmc_project.Settings
/org/open_power/control/host0/ClearHostSecurityKeys
org.open_power.Control.TPM.SecurityKeys ClearHostSecurityKeys
y 0

ipmitool -I lanplus -H 9.3.185.33 -U root -P 0penBmc raw 0x04 0x2D 0xE8
00 40 00 00

2. Set to a new value as 5 using busctl command:
busctl set-property xyz.openbmc_project.Settings
/org/open_power/control/host0/ClearHostSecurityKeys
org.open_power.Control.TPM.SecurityKeys ClearHostSecurityKeys y 5

3. After setting to a new value as 5:
ipmitool -I lanplus -H 9.3.185.33 -U root -P 0penBmc raw 0x04 0x2D 0xE8
05 40 00 00

4. ipmitool command to set the value as 4
ipmitool -I lanplus -H 9.3.185.33 -U root -P 0penBmc raw 0x04 0x30 0xE8
0x00 0x04 0x00 0x00 0x00 0x00 0x00 0x00 0x00

ipmitool -I lanplus -H 9.3.185.33 -U root -P 0penBmc raw 0x04 0x2D 0xE8
09 40 00 00

5. Invalid value test o/p:
ipmitool -I lanplus -H 9.3.185.33 -U root -P 0penBmc raw 0x04 0x30 0xE8
0x00 0x12C 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Given data "0x12C" is invalid.

Signed-off-by: Jayashankar Padath <jayashankar.padath@in.ibm.com>
Change-Id: Ie1a04f38aad970b3dc6d0c2708fcbcf2b75b3785
3 files changed