From 8527fc2b9549b9b6782fdffde29ff8713e677bc4 Mon Sep 17 00:00:00 2001 From: Nick Bofferding Date: Sat, 22 Apr 2017 17:15:03 -0500 Subject: Support gracefully adding signing headers to PNOR sections Change-Id: Ie8ce7672a41c0b6230918911f59ada5443c552f5 RTC: 170650 CMVC-Coreq: 1022416 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39869 Reviewed-by: Stephen M. Cprek Tested-by: Jenkins Server Reviewed-by: Michael Baiocchi Tested-by: FSP CI Jenkins Tested-by: Jenkins OP Build CI Reviewed-by: Daniel M. Crowell --- src/include/usr/pnor/pnorif.H | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src/include') diff --git a/src/include/usr/pnor/pnorif.H b/src/include/usr/pnor/pnorif.H index e4c61c72e..3a2d3e53b 100644 --- a/src/include/usr/pnor/pnorif.H +++ b/src/include/usr/pnor/pnorif.H @@ -221,6 +221,48 @@ const char * SectionIdToString( uint32_t i_secIdIndex ); */ bool cmpSecurebootMagicNumber(const uint8_t* i_vaddr); +// @TODO RTC 173489 +// Remove API once FSP fully supports signing of PNOR sections that did not +// previously have a sha512 header +/** + * @brief Determines whether requested PNOR section has a recognized header + * + * @param[in] i_secId ID of requested section + * @param[in] i_TOC TOC entry for requested section + * @param[out] o_knownHeader Whether header was recognized or not + * + * @return errlHndl_t Error log handle + * @retval nullptr Success! Output parameter valid + * @retval !nullptr Error log pointer; output parameter invalid + */ +errlHndl_t hasKnownHeader( + PNOR::SectionId i_secId, + const PNOR::SectionData_t& i_TOC, + bool& o_knownHeader); + +// @TODO RTC 173489 +// Remove API once FSP fully supports signing of PNOR sections that did not +// previously have a sha512 header +/** + * @brief Read first few bytes of requested section's "potential" header + * + * @param[in] i_secId ID of requested section + * @param[in] i_TOC TOC entry for requested section + * @param[in] i_size Number of bytes to read from the beginning of the + * requested section + * @param[in] o_pData Pointer to a buffer of at least "i_size" bytes to + * hold the returned data. Asserts if nullptr + * + * @return errlHndl_t Error log handle + * @retval nullptr Success! Requested bytes read to output buffer + * @retval !nullptr Error log pointer; output buffer invalid + */ +errlHndl_t readHeaderMagic( + PNOR::SectionId i_secId, + const PNOR::SectionData_t& i_TOC, + size_t i_size, + void* o_pData); + } // PNOR #endif -- cgit v1.2.3