diff options
author | Nick Bofferding <bofferdn@us.ibm.com> | 2017-10-20 21:13:34 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2017-11-03 09:45:20 -0400 |
commit | 07d75753d59419ea6ba9ee3bd930e0aa8e7e7fd5 (patch) | |
tree | 78633da60312ff8cfd54807f787219036e976621 /src/usr/errl/errludstring.C | |
parent | 47f275a6bd3b2104a82d9786122afd6fe25f05de (diff) | |
download | talos-hostboot-07d75753d59419ea6ba9ee3bd930e0aa8e7e7fd5.tar.gz talos-hostboot-07d75753d59419ea6ba9ee3bd930e0aa8e7e7fd5.zip |
Secure Boot: Enforce PNOR section component IDs
- In secure mode, bootloader will enforce that HBB component ID is set
- In secure mode, Hostboot will enforce that PNOR component IDs are set
Change-Id: I04f3bbc45417b3229003c56e1083e1fc31c01cd7
RTC: 179422
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48711
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/errl/errludstring.C')
-rw-r--r-- | src/usr/errl/errludstring.C | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/src/usr/errl/errludstring.C b/src/usr/errl/errludstring.C index 43943774d..888a303b6 100644 --- a/src/usr/errl/errludstring.C +++ b/src/usr/errl/errludstring.C @@ -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. */ @@ -54,5 +56,57 @@ ErrlUserDetailsString::~ErrlUserDetailsString() } +// ErrlUserDetailsStringSet implementation + +ErrlUserDetailsStringSet::ErrlUserDetailsStringSet() +{ + // Set up ErrlUserDetails instance variables + iv_CompId = ERRL_COMP_ID; + iv_Version = ERRL_UDT_STRING_SET_VER_1; + iv_SubSection = ERRL_UDT_STRING_SET; + + // override the default of false. + iv_merge = true; } +void ErrlUserDetailsStringSet::add( + const char* const i_pDescriptionString, + const char* const i_pString) +{ + // [Object Memory Layout] + // + // Offset Size Description + // ========================================================================= + // 0 X Existing object contents before this call, where X=0 if + // this is the first add call to the object + // X Y NULL terminated description string describing the string + // being logged, where Y=strlen(this string) + length (1) of + // NULL terminator. + // X+Y Z NULL terminated FFDC string, where Z=strlen(this string) + + // length (1) of NULL terminator. + + // Absorb API errors on error path and instead substitue error string for + // any input that is nullptr + const char* const pDescriptionString = (i_pDescriptionString == nullptr) ? + "BUG! Invalid description" : i_pDescriptionString; + const char* const pString = (i_pString == nullptr) ? "BUG! Invalid string" : + i_pString; + + const auto currentSize = static_cast<size_t>(getUsrBufSize()); + const auto descriptionSize = strlen(pDescriptionString)+1; + const auto stringSize = strlen(pString)+1; + const auto newSize = currentSize + descriptionSize + stringSize; + char* const pBuf = reinterpret_cast<char*>( + reallocUsrBuf(newSize)); + strcpy(pBuf+currentSize, pDescriptionString); + strcpy(pBuf+currentSize+descriptionSize,pString); +} + +ErrlUserDetailsStringSet::~ErrlUserDetailsStringSet() +{ + +} + +} // End of ERRORLOG namespace + + |