Kloxwork Issue : NULL check after EVP_MD_CTX_new

EVP_MD_CTX_new could return NULL.
This Commit adds a NULL check to avoid NULL pointer dereferencing.

Tested:
By performing firmware update using following steps.

1. Generate fw update random number
 ipmitool raw 0x08 0x26

2. Enter fw update mode
 ipmitool raw 0x08 0x27 0xa8 0xa8 0x32 0x49 0x0a 0x28 0xef 0x40

3. Start Image transfer
 ipmitool raw 0x08 0x29 0x01

4. Set Firmware update options
 ipmitool raw 0x08 0x2B 0x04 0x04 0xe3 0xb0 0xc4 0x42 0x98 0xfc 0x1c
0x14 0x9a 0xfb 0xf4 0xc8 0x99 0x6f 0xb9 0x24 0x27 0xae 0x41 0xe4 0x64
0x9b 0x93 0x4c 0xa4 0x95 0x99 0x1b 0x78 0x52 0xb8 0x55

5. Set file name (file:///tmp/BMC.Bin)
 ipmitool raw 0x08 0x29 0x04 0x13 0x66 0x69 0x6c 0x65 0x3a 0x2f 0x2f
0x2f 0x74 0x6d 0x70 0x2f 0x42 0x4d 0x43 0x2e 0x42 0x69 0x6e

6. End Image transfer
 ipmitool raw 0x08 0x29 0x02

7. Exit fw-update mode
 ipmitool raw 0x08 0x28

Signed-off-by: Arun Lal K M <arun.lal@intel.com>
Change-Id: Iefb83247278bfc58af209dad252f01c4bf01f2f4
1 file changed
tree: 4dee7df4922a33c64dde8ed59ec6bbc5917efdab
  1. cmake/
  2. docs/
  3. include/
  4. non-yocto/
  5. src/
  6. tests/
  7. .clang-format
  8. .gitignore
  9. cmake-format.json
  10. CMakeLists.txt
  11. CMakeLists.txt.in
  12. generate-whitelist.py
  13. ipmi-whitelist.conf
  14. LICENSE
  15. MAINTAINERS
  16. README.md
README.md

Intel IPMI OEM support library

This component is intended to provide Intel-specific IPMI[3] command handlers for OpenBMC. These handlers are intended to integrate BMC with servers based on Intel architecture.

Overview

intel-ipmi-oem serves as an extension[1] to OpenBMC IPMI daemon[2]. It is compiled as a shared library and intended to both:

  • override existing implementation of standard IPMI commands to comply with Intel-specific solutions,
  • provide implementation for non-standard OEM extensions.

Capabilities

Related features provided by the library are grouped in separate source files. Main extensions to vanilla OpenBMC IPMI stack are the following:

  • Acquiring SMBIOS data over IPMI
  • Commands for better integration with Intel hardware
  • Firmware update extensions
  • Extended parsing of IPMI Platform Events[4]

References

  1. OpenBMC IPMI Architecture
  2. Phosphor IPMI Host
  3. IPMI Specification v2.0
  4. Intel Platform Events parsing