diff options
author | Ilya Smirnov <ismirno@us.ibm.com> | 2019-01-03 15:09:17 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-01-10 14:53:38 -0600 |
commit | 26f7f6d12b118253c3ba841dacedf34beaa93ff9 (patch) | |
tree | ecd52e5bb661460a1ffc90979436b804321cde40 /src/include/usr/secureboot | |
parent | 21f75b9e4475b92665e4dd8ca182108dab53045f (diff) | |
download | talos-hostboot-26f7f6d12b118253c3ba841dacedf34beaa93ff9.tar.gz talos-hostboot-26f7f6d12b118253c3ba841dacedf34beaa93ff9.zip |
Trustedboot: GetRandom API Changes
New Secure Multinode Comm protocol calls for generation of
random number that is 32 bytes in size. This commit extends
the existing GetRandom API to be able to accept a size of
the random number to be generated by TPM.
Change-Id: Ic6fc1705594f51f121ff75aaa489d6d32fe41409
RTC: 202364
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70116
Tested-by: Jenkins Server <pfd-jenkins+hostboot@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: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/secureboot')
-rw-r--r-- | src/include/usr/secureboot/trustedboot_reasoncodes.H | 3 | ||||
-rw-r--r-- | src/include/usr/secureboot/trustedbootif.H | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/include/usr/secureboot/trustedboot_reasoncodes.H b/src/include/usr/secureboot/trustedboot_reasoncodes.H index 677065d65..8c03fd272 100644 --- a/src/include/usr/secureboot/trustedboot_reasoncodes.H +++ b/src/include/usr/secureboot/trustedboot_reasoncodes.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -103,6 +103,7 @@ namespace TRUSTEDBOOT RC_INVALID_TPM_HANDLE = TRBOOT_COMP_ID | 0xB8, RC_NON_FUNCTIONAL_TPM_HANDLE = TRBOOT_COMP_ID | 0xB9, RC_UNREACHABLE_TPM = TRBOOT_COMP_ID | 0xBA, + RC_RAND_NUM_TOO_BIG = TRBOOT_COMP_ID | 0xBB, }; #ifdef __cplusplus } diff --git a/src/include/usr/secureboot/trustedbootif.H b/src/include/usr/secureboot/trustedbootif.H index 65223c90a..6038ac486 100644 --- a/src/include/usr/secureboot/trustedbootif.H +++ b/src/include/usr/secureboot/trustedbootif.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -245,16 +245,22 @@ namespace TRUSTEDBOOT /** * @brief Generate random numbers via TPM hardware. * - * @parm[in] i_pTpm Pointer to TPM target. In order to succeed, it cannot + * @param[in] i_pTpm Pointer to TPM target. In order to succeed, it cannot * be null and must be a TPM target pointer. The TPM target must * be functional. All of these conditions must be met or an error * log will result. * - * @parm[out] o_randNum A uint64_t reference to be filled with random bits. + * @param[out] o_randNum A pointer to the array to be filled with random + * bits + * + * @param[in] i_randNumSize The desired size (bytes) of the random number + * to be requested from the TPM * * @return errlHndl_t nullptr on success or an error log pointer on failure */ - errlHndl_t GetRandom(const TpmTarget* i_pTpm, uint64_t& o_randNum); + errlHndl_t GetRandom(const TpmTarget* i_pTpm, + uint8_t* o_randNum, + size_t i_randNumSize); #endif /** |