diff options
Diffstat (limited to 'src/include/usr')
-rw-r--r-- | src/include/usr/errl/errlreasoncodes.H | 9 | ||||
-rw-r--r-- | src/include/usr/errl/errludstring.H | 62 | ||||
-rw-r--r-- | src/include/usr/secureboot/secure_reasoncodes.H | 1 | ||||
-rw-r--r-- | src/include/usr/secureboot/service.H | 20 |
4 files changed, 86 insertions, 6 deletions
diff --git a/src/include/usr/errl/errlreasoncodes.H b/src/include/usr/errl/errlreasoncodes.H index 1e7f2ea77..f9d03c246 100644 --- a/src/include/usr/errl/errlreasoncodes.H +++ b/src/include/usr/errl/errlreasoncodes.H @@ -62,7 +62,7 @@ namespace ERRORLOG ERRL_LAST_ERR = ERRL_COMP_ID | 0xFF }; - // Identifiers for ERRL user data sections. + // Identifiers for ERRL user data subsections. enum errlUserDetailDataSubsection { ERRL_UDT_NOFORMAT = 0x00, @@ -74,6 +74,13 @@ namespace ERRORLOG ERRL_UDT_CALLOUT = 0x06, ERRL_UDT_PRINTK = 0x07, ERRL_UDT_SENSOR = 0x08, + ERRL_UDT_STRING_SET = 0x09, + }; + + // Identifiers for ERRL user data subsection versions + enum errlUserDetailDataSubsectionVersion + { + ERRL_UDT_STRING_SET_VER_1 = 0x01, }; }; diff --git a/src/include/usr/errl/errludstring.H b/src/include/usr/errl/errludstring.H index f8e4cd3d7..c3d8ecdee 100644 --- a/src/include/usr/errl/errludstring.H +++ b/src/include/usr/errl/errludstring.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -57,10 +59,60 @@ public: */ virtual ~ErrlUserDetailsString(); -private: - // Disabled - ErrlUserDetailsString(const ErrlUserDetailsString &); - ErrlUserDetailsString & operator=(const ErrlUserDetailsString &); + private: + + // Disable compiler provided default functions + ErrlUserDetailsString( + const ErrlUserDetailsString &); + ErrlUserDetailsString & operator=( + const ErrlUserDetailsString &); + ErrlUserDetailsString ( + ErrlUserDetailsString&&) = delete; + ErrlUserDetailsString& operator = ( + ErrlUserDetailsString&&) = delete; +}; + +/** + * @class ErrlUserDetailsStringSet + * + * @brief Adds multiple, tagged FFDC strings to an error log as user details + * data + */ +class ErrlUserDetailsStringSet : public ErrlUserDetails +{ + + public: + + /** + * @brief Constructor; creates the object + */ + ErrlUserDetailsStringSet(); + + /** + * @brief Adds a new tagged string to the object's string cache + * + * @param[in] i_pDescriptionString Description of the string to add. Must + * not be nullptr or function will substitute an error message. + * @param[in] i_pString The string to add. Must not be nullptr or function + * will substitute an error message. + */ + void add(const char* i_pDescriptionString, + const char* i_pString); + + /** + * @brief Destructor + */ + virtual ~ErrlUserDetailsStringSet(); + + // Disable compiler provided default functions + ErrlUserDetailsStringSet( + const ErrlUserDetailsStringSet&) = delete; + ErrlUserDetailsStringSet& operator=( + const ErrlUserDetailsStringSet&) = delete; + ErrlUserDetailsStringSet ( + ErrlUserDetailsStringSet&&) = delete; + ErrlUserDetailsStringSet& operator = ( + ErrlUserDetailsStringSet&&) = delete; }; } diff --git a/src/include/usr/secureboot/secure_reasoncodes.H b/src/include/usr/secureboot/secure_reasoncodes.H index 98fe38d3c..f633ef7b2 100644 --- a/src/include/usr/secureboot/secure_reasoncodes.H +++ b/src/include/usr/secureboot/secure_reasoncodes.H @@ -40,6 +40,7 @@ namespace SECUREBOOT MOD_SECURE_READ_REG = 0x06, MOD_SECURE_WRITE_REG = 0x07, MOD_SECURE_SETTINGS_INIT = 0x08, + MOD_SECURE_VERIFY_COMPONENT = 0x09, }; enum SECUREReasonCode diff --git a/src/include/usr/secureboot/service.H b/src/include/usr/secureboot/service.H index 4c4d43d3c..c4dc31334 100644 --- a/src/include/usr/secureboot/service.H +++ b/src/include/usr/secureboot/service.H @@ -58,6 +58,8 @@ typedef uint8_t PAGE_TABLE_ENTRY_t[HASH_PAGE_TABLE_ENTRY_SIZE]; namespace SECUREBOOT { + class ContainerHeader; + /** @brief Perform initialization of Secureboot for the Base image. * * - Copy secure header from original location. @@ -223,6 +225,24 @@ namespace SECUREBOOT const SHA512_t* i_hwKeyHash = nullptr); /** + * @brief Verify component ID in a container header against a reference + * component ID. Up to 8 ASCII characters, not including NULL, will be + * compared (thus, it is critical that all components are unique with + * respect to the first 8 bytes). + * + * @param[in] i_containerHeader Verified container's header + * @param[in] i_pComponentString Reference component ID string; must not be + * nullptr or function will assert. + * + * @return errlHndl_t Error log handle + * @retval nullptr Component ID verification succeeded + * @retval !nullptr Error; component ID verification failed + */ + errlHndl_t verifyComponent( + const ContainerHeader& i_containerHeader, + const char* i_pComponentId); + + /** * @brief Hash Signed Blob * * @param[in] i_blob Void pointer to effective address of blob |