From 14cbd1e245d766cf2bc8fdd64b3da82451bba6ab Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 13 Aug 2025 14:29:21 -0400 Subject: [PATCH 01/52] scripts: Implement meld-commit to meld by commit Id Signed-off-by: Stefan Berger --- scripts/meld-commit | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 scripts/meld-commit diff --git a/scripts/meld-commit b/scripts/meld-commit new file mode 100755 index 000000000..8528d236b --- /dev/null +++ b/scripts/meld-commit @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +SKIP_FILES="(CMakeLists.txt|.cmake|CMakePresets.json|Makefile.am|configure.ac)$" + +if [ ! -d "$1" ]; then + echo "$1 is not a directory" + exit 1 +fi + +COMMIT="$2" +if [ -z "$2" ]; then + echo "2nd parameter must be a commit id. Not given, so assuming 'HEAD'" + COMMIT="HEAD" +fi + +if [ -z "${TCG_TPM_HOME}" ]; then + echo "TCG_TPM_HOME must be set to the TCG TPM repo checkout." + exit 1 +fi + +if [ ! -d "${TCG_TPM_HOME}" ]; then + echo "TCG_TPM_HOME must point to a directory." + exit 1 +fi + +set -x +LIBTPMS_ROOT="$PWD" + +pushd "${TCG_TPM_HOME}" >/dev/null || exit 1 + +git checkout "${COMMIT}" || exit 1 + +for fname in $(git diff-tree --no-commit-id --name-only "${COMMIT}" -r); do + if [[ $(basename "${fname}") =~ ${SKIP_FILES} ]]; then + continue + fi + mkdir -p "$(dirname "${LIBTPMS_ROOT}/${1}/${fname}")" + touch "${LIBTPMS_ROOT}/${1}/${fname}" + meld "${fname}" "${LIBTPMS_ROOT}/${1}/${fname}" + if [ $(stat -c%s "${LIBTPMS_ROOT}/${1}/${fname}") -eq 0 ]; then + rm -f "${LIBTPMS_ROOT}/${1}/${fname}" + fi +done From f2bb95821b092ee13f5eb2d02366055670bf63fd Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 11 Feb 2026 11:15:27 -0500 Subject: [PATCH 02/52] scripts: Add help screen to meld-all and display if file is 'not upstream' Add a help screen to meld-all and display if a file is not found in the upstream repo. Signed-off-by: Stefan Berger --- scripts/meld-all | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/scripts/meld-all b/scripts/meld-all index 3aae682b6..716ca50b2 100755 --- a/scripts/meld-all +++ b/scripts/meld-all @@ -5,6 +5,27 @@ SKIP_FILES="(Marshal.c|Marshal_fp.h)" NO_MELD_FLAG=$((1<<0)) +help() +{ + cat <<_EOF_ +Usage: TCG_TPM_HOME=... $1 [options] TPM2-directory + +The following options are available: + +--no-meld,--diff-only : Only display diffs between files; the first two lines + are related to the license and are ignore for the diff. +--help : Display this help screen and exit. + +The environmet variable TCG_TPM_HOME must be set and point to +the TCG TPM2 git checkout. + +Example: + +TCG_TPM_HOME=\$HOME/TPM $1 --diff-only src/tpm2 + +_EOF_ +} + main() { local opts f fname upstream flags @@ -74,14 +95,18 @@ main() if [ $((flags & NO_MELD_FLAG)) -eq 0 ]; then meld "${upstrean}" "${f}" else - echo "Something wrong with file $f" + echo "Something is wrong with file $f" fi fi line=$((line+1)) if [ $((flags & NO_MELD_FLAG)) -ne 0 ]; then echo "============================================================================" - echo "${f}" - diff --ignore-trailing-space <(sed -n "${line},\$p" < "${f}") "${upstream}" + if [ ! -f "${upstream}" ]; then + echo "${f}: file does not exist upstream" + else + echo "${f}" + diff --ignore-trailing-space <(sed -n "${line},\$p" < "${f}") "${upstream}" + fi fi if ! diff --ignore-trailing-space <(sed -n "${line},\$p" < "${f}") "${upstream}" &>/dev/null; then if [ $((flags & NO_MELD_FLAG)) -eq 0 ]; then From a8f62e55df8212c16fda516f6e3b2cf84674931c Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 3 Dec 2025 14:24:24 -0500 Subject: [PATCH 03/52] LICENSE: Add copyright notices and BSD license for newer TPM 2 code Signed-off-by: Stefan Berger --- LICENSE | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index a32c52c47..f08e9ad0a 100644 --- a/LICENSE +++ b/LICENSE @@ -35,7 +35,48 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -For the TPM 2 code the following license and notices apply: + +For TPM 2 code that does not explicitly state a license, the following +license and notices apply: + + +TCG Reference Implementation for TPM 2.0 +This code is informative. + +The copyright in this software is being made available under the BSD License, +included below. + +Copyright 2010-2022 Microsoft Corporation +Copyright 2022-2025 Trusted Computing Group and its contributors + +All rights reserved. + + +BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS"" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +For other TPM 2 code the following license and notices apply: Licenses and Notices From d6e7d657a9442b4a8fae3fecbfa4682c7a8b7a6e Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 22 Jul 2025 16:46:41 -0400 Subject: [PATCH 04/52] Sync: Remove USE_BIT_FIELD_STRUCTURES build switch and bit fields Signed-off-by: Stefan Berger --- src/tpm2/GpMacros.h | 87 +-- src/tpm2/PropertyCap.c | 73 +-- src/tpm2/RunCommand.c | 63 +-- src/tpm2/TpmBuildSwitches.h | 10 - src/tpm2/TpmProfile_Common.h | 3 - src/tpm2/TpmTypes.h | 977 +++++++++------------------------ src/tpm2/VerifyConfiguration.h | 1 - 7 files changed, 287 insertions(+), 927 deletions(-) diff --git a/src/tpm2/GpMacros.h b/src/tpm2/GpMacros.h index bc62d4ae3..6b86b1f51 100644 --- a/src/tpm2/GpMacros.h +++ b/src/tpm2/GpMacros.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* This file is a collection of miscellaneous macros. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file is a collection of miscellaneous macros. @@ -444,28 +386,11 @@ // at least once every 292,471,208 years rather than once every 584,942,417 years. #define EXPIRATION_BIT ((UINT64)1 << 63) -// Check for consistency of the bit ordering of bit fields -#if BIG_ENDIAN_TPM && MOST_SIGNIFICANT_BIT_0 && USE_BIT_FIELD_STRUCTURES -# error "Settings not consistent" -#endif - -// These macros are used to handle the variation in handling of bit fields. If -#if USE_BIT_FIELD_STRUCTURES // The default, old version, with bit fields -# define IS_ATTRIBUTE(a, type, b) ((a.b) != 0) -# define SET_ATTRIBUTE(a, type, b) (a.b = SET) -# define CLEAR_ATTRIBUTE(a, type, b) (a.b = CLEAR) -# define GET_ATTRIBUTE(a, type, b) (a.b) -# define TPMA_ZERO_INITIALIZER() \ - { \ - 0 \ - } -#else -# define IS_ATTRIBUTE(a, type, b) ((a & type##_##b) != 0) -# define SET_ATTRIBUTE(a, type, b) (a |= type##_##b) -# define CLEAR_ATTRIBUTE(a, type, b) (a &= ~type##_##b) -# define GET_ATTRIBUTE(a, type, b) (type)((a & type##_##b) >> type##_##b##_SHIFT) -# define TPMA_ZERO_INITIALIZER() (0) -#endif +#define IS_ATTRIBUTE(a, type, b) ((a & type##_##b) != 0) +#define SET_ATTRIBUTE(a, type, b) (a |= type##_##b) +#define CLEAR_ATTRIBUTE(a, type, b) (a &= ~type##_##b) +#define GET_ATTRIBUTE(a, type, b) (type)((a & type##_##b) >> type##_##b##_SHIFT) +#define TPMA_ZERO_INITIALIZER() (0) // These macros determine if the values in this file are referenced or instanced. // Global.c defines GLOBAL_C so all the values in this file will be instanced in diff --git a/src/tpm2/PropertyCap.c b/src/tpm2/PropertyCap.c index ffc89d622..817981d7a 100644 --- a/src/tpm2/PropertyCap.c +++ b/src/tpm2/PropertyCap.c @@ -1,62 +1,5 @@ -/********************************************************************************/ -/* */ -/* For accessing the TPM_CAP_TPM_PROPERTY values */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2025 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + //** Description // This file contains the functions that are used for accessing the // TPM_CAP_TPM_PROPERTY values. @@ -209,10 +152,8 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property SET_ATTRIBUTE(attributes.att, TPMA_MEMORY, sharedNV); SET_ATTRIBUTE(attributes.att, TPMA_MEMORY, objectCopiedToRam); - // Note: For a LSb0 machine, the bits in a bit field are in the correct - // order even if the machine is MSB0. For a MSb0 machine, a TPMA will - // be an integer manipulated by masking (USE_BIT_FIELD_STRUCTURES will - // be NO) so the bits are manipulate correctly. + // A TPMA will be an integer manipulated by masking so the bits + // are manipulated correctly regardless of machine endianness. *value = attributes.u32; break; } @@ -431,10 +372,8 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property // In this implementation, EPS is always generated by TPM SET_ATTRIBUTE(flags.attr, TPMA_PERMANENT, tpmGeneratedEPS); - // Note: For a LSb0 machine, the bits in a bit field are in the correct - // order even if the machine is MSB0. For a MSb0 machine, a TPMA will - // be an integer manipulated by masking (USE_BIT_FIELD_STRUCTURES will - // be NO) so the bits are manipulate correctly. + // A TPMA will be an integer manipulated by masking so the bits + // are manipulated correctly regardless of machine endianness. *value = flags.u32; break; } diff --git a/src/tpm2/RunCommand.c b/src/tpm2/RunCommand.c index 77709ff23..5bba6dca4 100644 --- a/src/tpm2/RunCommand.c +++ b/src/tpm2/RunCommand.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Platform specific entry and fail processing */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: RunCommand.c 1476 2019-06-10 19:32:03Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //**Introduction // This module provides the platform specific entry and fail processing. The @@ -69,7 +10,7 @@ // code will have set the flag to indicate that the TPM is in failure mode. // This call will then recursively call ExecuteCommand in order to build the // failure mode response. When ExecuteCommand() returns to _plat__Fail(), the -// platform will do some platform specif operation to return to the environment in +// platform will do some platform specific operation to return to the environment in // which the TPM is executing. For a simulator, setjmp/longjmp is used. For an OS, // a system exit to the OS would be appropriate. diff --git a/src/tpm2/TpmBuildSwitches.h b/src/tpm2/TpmBuildSwitches.h index 033383fe7..b0c3fb085 100644 --- a/src/tpm2/TpmBuildSwitches.h +++ b/src/tpm2/TpmBuildSwitches.h @@ -223,16 +223,6 @@ // in compressed form. #define COMPRESSED_LISTS NO /* libtpms: change in v0.10 */ -// This define is used to eliminate the use of bit-fields. It can be enabled for big- -// or little-endian machines. For big-endian architectures that numbers bits in -// registers from left to right (MSb0) this must be enabled. Little-endian machines -// number from right to left with the least significant bit having assigned a bit -// number of 0. These are LSb0 machines (they are also little-endian so they are also -// least-significant byte 0 (LSB0) machines. Big-endian (MSB0) machines may number in -// either direction (MSb0 or LSb0). For an MSB0+MSb0 machine this value is required to -// be 'NO' -#define USE_BIT_FIELD_STRUCTURES NO - // Enable the generation of RSA primes using a sieve. #define RSA_KEY_SIEVE YES diff --git a/src/tpm2/TpmProfile_Common.h b/src/tpm2/TpmProfile_Common.h index ac295b7bc..25986dbe5 100644 --- a/src/tpm2/TpmProfile_Common.h +++ b/src/tpm2/TpmProfile_Common.h @@ -114,9 +114,6 @@ #define BIG_ENDIAN_TPM NO #endif #define LITTLE_ENDIAN_TPM !BIG_ENDIAN_TPM -// Does the processor put the most-significant bit at bit position 0? -#define MOST_SIGNIFICANT_BIT_0 NO -#define LEAST_SIGNIFICANT_BIT_0 !MOST_SIGNIFICANT_BIT_0 // Does processor support Auto align? #define AUTO_ALIGN NO diff --git a/src/tpm2/TpmTypes.h b/src/tpm2/TpmTypes.h index 9968573df..07b98db4e 100644 --- a/src/tpm2/TpmTypes.h +++ b/src/tpm2/TpmTypes.h @@ -992,62 +992,31 @@ typedef TPM_HANDLE TPM_HC; UINT32 x = BYTE_ARRAY_TO_UINT32(a); \ i = UINT32_TO_TPMA_ALGORITHM(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned asymmetric : 1; - unsigned symmetric : 1; - unsigned hash : 1; - unsigned object : 1; - unsigned Reserved_bits_at_4 : 4; - unsigned signing : 1; - unsigned encrypting : 1; - unsigned method : 1; - unsigned Reserved_bits_at_11 : 21; -} TPMA_ALGORITHM; - -// Initializer for the bit-field structure -# define TPMA_ALGORITHM_INITIALIZER(asymmetric, \ - symmetric, \ - hash, \ - object, \ - bits_at_4, \ - signing, \ - encrypting, \ - method, \ - bits_at_11) \ - { \ - asymmetric, symmetric, hash, object, bits_at_4, signing, encrypting, \ - method, bits_at_11 \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_ALGORITHM Bits" (Part 2: Structures) using bit masking typedef UINT32 TPMA_ALGORITHM; -# define TPMA_ALGORITHM_asymmetric (TPMA_ALGORITHM)(1 << 0) -# define TPMA_ALGORITHM_symmetric (TPMA_ALGORITHM)(1 << 1) -# define TPMA_ALGORITHM_hash (TPMA_ALGORITHM)(1 << 2) -# define TPMA_ALGORITHM_object (TPMA_ALGORITHM)(1 << 3) -# define TPMA_ALGORITHM_signing (TPMA_ALGORITHM)(1 << 8) -# define TPMA_ALGORITHM_encrypting (TPMA_ALGORITHM)(1 << 9) -# define TPMA_ALGORITHM_method (TPMA_ALGORITHM)(1 << 10) +#define TPMA_ALGORITHM_asymmetric (TPMA_ALGORITHM)(1 << 0) +#define TPMA_ALGORITHM_symmetric (TPMA_ALGORITHM)(1 << 1) +#define TPMA_ALGORITHM_hash (TPMA_ALGORITHM)(1 << 2) +#define TPMA_ALGORITHM_object (TPMA_ALGORITHM)(1 << 3) +#define TPMA_ALGORITHM_signing (TPMA_ALGORITHM)(1 << 8) +#define TPMA_ALGORITHM_encrypting (TPMA_ALGORITHM)(1 << 9) +#define TPMA_ALGORITHM_method (TPMA_ALGORITHM)(1 << 10) #define TPMA_ALGORITHM_reserved 0xfffff8f0 // libtpms added // This is the initializer for a TPMA_ALGORITHM bit array. -# define TPMA_ALGORITHM_INITIALIZER(asymmetric, \ - symmetric, \ - hash, \ - object, \ - bits_at_4, \ - signing, \ - encrypting, \ - method, \ - bits_at_11) \ - (TPMA_ALGORITHM)((asymmetric << 0) + (symmetric << 1) + (hash << 2) \ - + (object << 3) + (signing << 8) + (encrypting << 9) \ - + (method << 10)) - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_ALGORITHM_INITIALIZER(asymmetric, \ + symmetric, \ + hash, \ + object, \ + bits_at_4, \ + signing, \ + encrypting, \ + method, \ + bits_at_11) \ + (TPMA_ALGORITHM)((asymmetric << 0) + (symmetric << 1) + (hash << 2) \ + + (object << 3) + (signing << 8) + (encrypting << 9) \ + + (method << 10)) // Table "Definition of TPMA_OBJECT Bits" (Part 2: Structures) #define TYPE_OF_TPMA_OBJECT UINT32 @@ -1060,51 +1029,25 @@ typedef UINT32 TPMA_ALGORITHM; UINT32 x = BYTE_ARRAY_TO_UINT32(a); \ i = UINT32_TO_TPMA_OBJECT(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned Reserved_bit_at_0 : 1; - unsigned fixedTPM : 1; - unsigned stClear : 1; - unsigned Reserved_bit_at_3 : 1; - unsigned fixedParent : 1; - unsigned sensitiveDataOrigin : 1; - unsigned userWithAuth : 1; - unsigned adminWithPolicy : 1; - unsigned firmwareLimited : 1; - unsigned svnLimited : 1; - unsigned noDA : 1; - unsigned encryptedDuplication : 1; - unsigned Reserved_bits_at_12 : 4; - unsigned restricted : 1; - unsigned decrypt : 1; - unsigned sign : 1; - unsigned x509sign : 1; - unsigned Reserved_bits_at_20 : 12; -} TPMA_OBJECT; - -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_OBJECT Bits" (Part 2: Structures) using bit masking typedef UINT32 TPMA_OBJECT; -# define TPMA_OBJECT_fixedTPM (TPMA_OBJECT)(1 << 1) -# define TPMA_OBJECT_stClear (TPMA_OBJECT)(1 << 2) -# define TPMA_OBJECT_fixedParent (TPMA_OBJECT)(1 << 4) -# define TPMA_OBJECT_sensitiveDataOrigin (TPMA_OBJECT)(1 << 5) -# define TPMA_OBJECT_userWithAuth (TPMA_OBJECT)(1 << 6) -# define TPMA_OBJECT_adminWithPolicy (TPMA_OBJECT)(1 << 7) -# define TPMA_OBJECT_firmwareLimited (TPMA_OBJECT)(1 << 8) -# define TPMA_OBJECT_svnLimited (TPMA_OBJECT)(1 << 9) -# define TPMA_OBJECT_noDA (TPMA_OBJECT)(1 << 10) -# define TPMA_OBJECT_encryptedDuplication (TPMA_OBJECT)(1 << 11) -# define TPMA_OBJECT_restricted (TPMA_OBJECT)(1 << 16) -# define TPMA_OBJECT_decrypt (TPMA_OBJECT)(1 << 17) -# define TPMA_OBJECT_sign (TPMA_OBJECT)(1 << 18) -# define TPMA_OBJECT_x509sign (TPMA_OBJECT)(1 << 19) +#define TPMA_OBJECT_fixedTPM (TPMA_OBJECT)(1 << 1) +#define TPMA_OBJECT_stClear (TPMA_OBJECT)(1 << 2) +#define TPMA_OBJECT_fixedParent (TPMA_OBJECT)(1 << 4) +#define TPMA_OBJECT_sensitiveDataOrigin (TPMA_OBJECT)(1 << 5) +#define TPMA_OBJECT_userWithAuth (TPMA_OBJECT)(1 << 6) +#define TPMA_OBJECT_adminWithPolicy (TPMA_OBJECT)(1 << 7) +#define TPMA_OBJECT_firmwareLimited (TPMA_OBJECT)(1 << 8) +#define TPMA_OBJECT_svnLimited (TPMA_OBJECT)(1 << 9) +#define TPMA_OBJECT_noDA (TPMA_OBJECT)(1 << 10) +#define TPMA_OBJECT_encryptedDuplication (TPMA_OBJECT)(1 << 11) +#define TPMA_OBJECT_restricted (TPMA_OBJECT)(1 << 16) +#define TPMA_OBJECT_decrypt (TPMA_OBJECT)(1 << 17) +#define TPMA_OBJECT_sign (TPMA_OBJECT)(1 << 18) +#define TPMA_OBJECT_x509sign (TPMA_OBJECT)(1 << 19) #define TPMA_OBJECT_reserved ((TPMA_OBJECT)0xfff0f009) // libtpms added -#endif // USE_BIT_FIELD_STRUCTURES - // Table "Definition of TPMA_SESSION Bits" (Part 2: Structures) #define TYPE_OF_TPMA_SESSION UINT8 #define TPMA_SESSION_TO_UINT8(a) (*((UINT8*)&(a))) @@ -1116,55 +1059,23 @@ typedef UINT32 TPMA_OBJECT; UINT8 x = BYTE_ARRAY_TO_UINT8(a); \ i = UINT8_TO_TPMA_SESSION(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned continueSession : 1; - unsigned auditExclusive : 1; - unsigned auditReset : 1; - unsigned Reserved_bits_at_3 : 2; - unsigned decrypt : 1; - unsigned encrypt : 1; - unsigned audit : 1; -} TPMA_SESSION; - -// Initializer for the bit-field structure -# define TPMA_SESSION_INITIALIZER(continuesession, \ - auditexclusive, \ - auditreset, \ - bits_at_3, \ - decrypt, \ - encrypt, \ - audit) \ - { \ - continuesession, auditexclusive, auditreset, bits_at_3, decrypt, encrypt, \ - audit \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_SESSION Bits" (Part 2: Structures) using bit masking typedef UINT8 TPMA_SESSION; -# define TPMA_SESSION_continueSession (TPMA_SESSION)(1 << 0) -# define TPMA_SESSION_auditExclusive (TPMA_SESSION)(1 << 1) -# define TPMA_SESSION_auditReset (TPMA_SESSION)(1 << 2) -# define TPMA_SESSION_decrypt (TPMA_SESSION)(1 << 5) -# define TPMA_SESSION_encrypt (TPMA_SESSION)(1 << 6) -# define TPMA_SESSION_audit (TPMA_SESSION)(1 << 7) +#define TPMA_SESSION_continueSession (TPMA_SESSION)(1 << 0) +#define TPMA_SESSION_auditExclusive (TPMA_SESSION)(1 << 1) +#define TPMA_SESSION_auditReset (TPMA_SESSION)(1 << 2) +#define TPMA_SESSION_decrypt (TPMA_SESSION)(1 << 5) +#define TPMA_SESSION_encrypt (TPMA_SESSION)(1 << 6) +#define TPMA_SESSION_audit (TPMA_SESSION)(1 << 7) #define TPMA_SESSION_reserved 0x18 // libtpms added // This is the initializer for a TPMA_SESSION bit array. -# define TPMA_SESSION_INITIALIZER(continuesession, \ - auditexclusive, \ - auditreset, \ - bits_at_3, \ - decrypt, \ - encrypt, \ - audit) \ - (TPMA_SESSION)((continuesession << 0) + (auditexclusive << 1) \ - + (auditreset << 2) + (decrypt << 5) + (encrypt << 6) \ - + (audit << 7)) - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_SESSION_INITIALIZER( \ + continuesession, auditexclusive, auditreset, bits_at_3, decrypt, encrypt, audit) \ + (TPMA_SESSION)((continuesession << 0) + (auditexclusive << 1) \ + + (auditreset << 2) + (decrypt << 5) + (encrypt << 6) \ + + (audit << 7)) // Table "Definition of TPMA_LOCALITY Bits" (Part 2: Structures) #define TYPE_OF_TPMA_LOCALITY UINT8 @@ -1177,44 +1088,22 @@ typedef UINT8 TPMA_SESSION; UINT8 x = BYTE_ARRAY_TO_UINT8(a); \ i = UINT8_TO_TPMA_LOCALITY(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned TPM_LOC_ZERO : 1; - unsigned TPM_LOC_ONE : 1; - unsigned TPM_LOC_TWO : 1; - unsigned TPM_LOC_THREE : 1; - unsigned TPM_LOC_FOUR : 1; - unsigned Extended : 3; -} TPMA_LOCALITY; - -// Initializer for the bit-field structure -# define TPMA_LOCALITY_INITIALIZER( \ - tpm_loc_zero, tpm_loc_one, tpm_loc_two, tpm_loc_three, tpm_loc_four, extended) \ - { \ - tpm_loc_zero, tpm_loc_one, tpm_loc_two, tpm_loc_three, tpm_loc_four, \ - extended \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_LOCALITY Bits" (Part 2: Structures) using bit masking typedef UINT8 TPMA_LOCALITY; -# define TPMA_LOCALITY_TPM_LOC_ZERO (TPMA_LOCALITY)(1 << 0) -# define TPMA_LOCALITY_TPM_LOC_ONE (TPMA_LOCALITY)(1 << 1) -# define TPMA_LOCALITY_TPM_LOC_TWO (TPMA_LOCALITY)(1 << 2) -# define TPMA_LOCALITY_TPM_LOC_THREE (TPMA_LOCALITY)(1 << 3) -# define TPMA_LOCALITY_TPM_LOC_FOUR (TPMA_LOCALITY)(1 << 4) -# define TPMA_LOCALITY_Extended (TPMA_LOCALITY)(7 << 5) -# define TPMA_LOCALITY_Extended_SHIFT 5 +#define TPMA_LOCALITY_TPM_LOC_ZERO (TPMA_LOCALITY)(1 << 0) +#define TPMA_LOCALITY_TPM_LOC_ONE (TPMA_LOCALITY)(1 << 1) +#define TPMA_LOCALITY_TPM_LOC_TWO (TPMA_LOCALITY)(1 << 2) +#define TPMA_LOCALITY_TPM_LOC_THREE (TPMA_LOCALITY)(1 << 3) +#define TPMA_LOCALITY_TPM_LOC_FOUR (TPMA_LOCALITY)(1 << 4) +#define TPMA_LOCALITY_Extended (TPMA_LOCALITY)(7 << 5) +#define TPMA_LOCALITY_Extended_SHIFT 5 // This is the initializer for a TPMA_LOCALITY bit array. -# define TPMA_LOCALITY_INITIALIZER( \ - tpm_loc_zero, tpm_loc_one, tpm_loc_two, tpm_loc_three, tpm_loc_four, extended) \ - (TPMA_LOCALITY)((tpm_loc_zero << 0) + (tpm_loc_one << 1) + (tpm_loc_two << 2) \ - + (tpm_loc_three << 3) + (tpm_loc_four << 4) \ - + (extended << 5)) - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_LOCALITY_INITIALIZER( \ + tpm_loc_zero, tpm_loc_one, tpm_loc_two, tpm_loc_three, tpm_loc_four, extended) \ + (TPMA_LOCALITY)((tpm_loc_zero << 0) + (tpm_loc_one << 1) + (tpm_loc_two << 2) \ + + (tpm_loc_three << 3) + (tpm_loc_four << 4) + (extended << 5)) // Table "Definition of TPMA_PERMANENT Bits" (Part 2: Structures) #define TYPE_OF_TPMA_PERMANENT UINT32 @@ -1227,57 +1116,28 @@ typedef UINT8 TPMA_LOCALITY; UINT32 x = BYTE_ARRAY_TO_UINT32(a); \ i = UINT32_TO_TPMA_PERMANENT(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned ownerAuthSet : 1; - unsigned endorsementAuthSet : 1; - unsigned lockoutAuthSet : 1; - unsigned Reserved_bits_at_3 : 5; - unsigned disableClear : 1; - unsigned inLockout : 1; - unsigned tpmGeneratedEPS : 1; - unsigned Reserved_bits_at_11 : 21; -} TPMA_PERMANENT; - -// Initializer for the bit-field structure -# define TPMA_PERMANENT_INITIALIZER(ownerauthset, \ - endorsementauthset, \ - lockoutauthset, \ - bits_at_3, \ - disableclear, \ - inlockout, \ - tpmgeneratedeps, \ - bits_at_11) \ - { \ - ownerauthset, endorsementauthset, lockoutauthset, bits_at_3, disableclear, \ - inlockout, tpmgeneratedeps, bits_at_11 \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_PERMANENT Bits" (Part 2: Structures) using bit masking typedef UINT32 TPMA_PERMANENT; -# define TPMA_PERMANENT_ownerAuthSet (TPMA_PERMANENT)(1 << 0) -# define TPMA_PERMANENT_endorsementAuthSet (TPMA_PERMANENT)(1 << 1) -# define TPMA_PERMANENT_lockoutAuthSet (TPMA_PERMANENT)(1 << 2) -# define TPMA_PERMANENT_disableClear (TPMA_PERMANENT)(1 << 8) -# define TPMA_PERMANENT_inLockout (TPMA_PERMANENT)(1 << 9) -# define TPMA_PERMANENT_tpmGeneratedEPS (TPMA_PERMANENT)(1 << 10) +#define TPMA_PERMANENT_ownerAuthSet (TPMA_PERMANENT)(1 << 0) +#define TPMA_PERMANENT_endorsementAuthSet (TPMA_PERMANENT)(1 << 1) +#define TPMA_PERMANENT_lockoutAuthSet (TPMA_PERMANENT)(1 << 2) +#define TPMA_PERMANENT_disableClear (TPMA_PERMANENT)(1 << 8) +#define TPMA_PERMANENT_inLockout (TPMA_PERMANENT)(1 << 9) +#define TPMA_PERMANENT_tpmGeneratedEPS (TPMA_PERMANENT)(1 << 10) // This is the initializer for a TPMA_PERMANENT bit array. -# define TPMA_PERMANENT_INITIALIZER(ownerauthset, \ - endorsementauthset, \ - lockoutauthset, \ - bits_at_3, \ - disableclear, \ - inlockout, \ - tpmgeneratedeps, \ - bits_at_11) \ - (TPMA_PERMANENT)((ownerauthset << 0) + (endorsementauthset << 1) \ - + (lockoutauthset << 2) + (disableclear << 8) \ - + (inlockout << 9) + (tpmgeneratedeps << 10)) - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_PERMANENT_INITIALIZER(ownerauthset, \ + endorsementauthset, \ + lockoutauthset, \ + bits_at_3, \ + disableclear, \ + inlockout, \ + tpmgeneratedeps, \ + bits_at_11) \ + (TPMA_PERMANENT)((ownerauthset << 0) + (endorsementauthset << 1) \ + + (lockoutauthset << 2) + (disableclear << 8) \ + + (inlockout << 9) + (tpmgeneratedeps << 10)) // Table "Definition of TPMA_STARTUP_CLEAR Bits" (Part 2: Structures) #define TYPE_OF_TPMA_STARTUP_CLEAR UINT32 @@ -1290,40 +1150,20 @@ typedef UINT32 TPMA_PERMANENT; UINT32 x = BYTE_ARRAY_TO_UINT32(a); \ i = UINT32_TO_TPMA_STARTUP_CLEAR(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned phEnable : 1; - unsigned shEnable : 1; - unsigned ehEnable : 1; - unsigned phEnableNV : 1; - unsigned Reserved_bits_at_4 : 27; - unsigned orderly : 1; -} TPMA_STARTUP_CLEAR; - -// Initializer for the bit-field structure -# define TPMA_STARTUP_CLEAR_INITIALIZER( \ - phenable, shenable, ehenable, phenablenv, bits_at_4, orderly) \ - { \ - phenable, shenable, ehenable, phenablenv, bits_at_4, orderly \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_STARTUP_CLEAR Bits" (Part 2: Structures) using bit masking typedef UINT32 TPMA_STARTUP_CLEAR; -# define TPMA_STARTUP_CLEAR_phEnable (TPMA_STARTUP_CLEAR)(1 << 0) -# define TPMA_STARTUP_CLEAR_shEnable (TPMA_STARTUP_CLEAR)(1 << 1) -# define TPMA_STARTUP_CLEAR_ehEnable (TPMA_STARTUP_CLEAR)(1 << 2) -# define TPMA_STARTUP_CLEAR_phEnableNV (TPMA_STARTUP_CLEAR)(1 << 3) -# define TPMA_STARTUP_CLEAR_orderly (TPMA_STARTUP_CLEAR)((UINT32)1 << 31) // libtpms changed: UBSAN +#define TPMA_STARTUP_CLEAR_phEnable (TPMA_STARTUP_CLEAR)(1 << 0) +#define TPMA_STARTUP_CLEAR_shEnable (TPMA_STARTUP_CLEAR)(1 << 1) +#define TPMA_STARTUP_CLEAR_ehEnable (TPMA_STARTUP_CLEAR)(1 << 2) +#define TPMA_STARTUP_CLEAR_phEnableNV (TPMA_STARTUP_CLEAR)(1 << 3) +#define TPMA_STARTUP_CLEAR_orderly (TPMA_STARTUP_CLEAR)((UINT32)1 << 31) // libtpms changed: UBSAN // This is the initializer for a TPMA_STARTUP_CLEAR bit array. -# define TPMA_STARTUP_CLEAR_INITIALIZER( \ - phenable, shenable, ehenable, phenablenv, bits_at_4, orderly) \ - (TPMA_STARTUP_CLEAR)((phenable << 0) + (shenable << 1) + (ehenable << 2) \ - + (phenablenv << 3) + ((UINT32)orderly << 31)) // libtpms chanegd: UBSAN - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_STARTUP_CLEAR_INITIALIZER( \ + phenable, shenable, ehenable, phenablenv, bits_at_4, orderly) \ + (TPMA_STARTUP_CLEAR)((phenable << 0) + (shenable << 1) + (ehenable << 2) \ + + (phenablenv << 3) + ((UINT32)orderly << 31)) // libtpms changed: UBSAN // Table "Definition of TPMA_MEMORY Bits" (Part 2: Structures) #define TYPE_OF_TPMA_MEMORY UINT32 @@ -1336,33 +1176,16 @@ typedef UINT32 TPMA_STARTUP_CLEAR; UINT32 x = BYTE_ARRAY_TO_UINT32(a); \ i = UINT32_TO_TPMA_MEMORY(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned sharedRAM : 1; - unsigned sharedNV : 1; - unsigned objectCopiedToRam : 1; - unsigned Reserved_bits_at_3 : 29; -} TPMA_MEMORY; - -// Initializer for the bit-field structure -# define TPMA_MEMORY_INITIALIZER(sharedram, sharednv, objectcopiedtoram, bits_at_3) \ - { \ - sharedram, sharednv, objectcopiedtoram, bits_at_3 \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_MEMORY Bits" (Part 2: Structures) using bit masking typedef UINT32 TPMA_MEMORY; -# define TPMA_MEMORY_sharedRAM (TPMA_MEMORY)(1 << 0) -# define TPMA_MEMORY_sharedNV (TPMA_MEMORY)(1 << 1) -# define TPMA_MEMORY_objectCopiedToRam (TPMA_MEMORY)(1 << 2) +#define TPMA_MEMORY_sharedRAM (TPMA_MEMORY)(1 << 0) +#define TPMA_MEMORY_sharedNV (TPMA_MEMORY)(1 << 1) +#define TPMA_MEMORY_objectCopiedToRam (TPMA_MEMORY)(1 << 2) // This is the initializer for a TPMA_MEMORY bit array. -# define TPMA_MEMORY_INITIALIZER(sharedram, sharednv, objectcopiedtoram, bits_at_3) \ - (TPMA_MEMORY)((sharedram << 0) + (sharednv << 1) + (objectcopiedtoram << 2)) - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_MEMORY_INITIALIZER(sharedram, sharednv, objectcopiedtoram, bits_at_3) \ + (TPMA_MEMORY)((sharedram << 0) + (sharednv << 1) + (objectcopiedtoram << 2)) // Table "Definition of TPMA_CC Bits" (Part 2: Structures) #define TYPE_OF_TPMA_CC UINT32 @@ -1374,63 +1197,32 @@ typedef UINT32 TPMA_MEMORY; UINT32 x = BYTE_ARRAY_TO_UINT32(a); \ i = UINT32_TO_TPMA_CC(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned commandIndex : 16; - unsigned Reserved_bits_at_16 : 6; - unsigned nv : 1; - unsigned extensive : 1; - unsigned flushed : 1; - unsigned cHandles : 3; - unsigned rHandle : 1; - unsigned V : 1; - unsigned Reserved_bits_at_30 : 2; -} TPMA_CC; - -// Initializer for the bit-field structure -# define TPMA_CC_INITIALIZER(commandindex, \ - bits_at_16, \ - nv, \ - extensive, \ - flushed, \ - chandles, \ - rhandle, \ - v, \ - bits_at_30) \ - { \ - commandindex, bits_at_16, nv, extensive, flushed, chandles, rhandle, v, \ - bits_at_30 \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_CC Bits" (Part 2: Structures) using bit masking typedef TPM_CC TPMA_CC; -# define TPMA_CC_commandIndex (TPMA_CC)(0xFFFF << 0) -# define TPMA_CC_commandIndex_SHIFT 0 -# define TPMA_CC_nv (TPMA_CC)(1 << 22) -# define TPMA_CC_extensive (TPMA_CC)(1 << 23) -# define TPMA_CC_flushed (TPMA_CC)(1 << 24) -# define TPMA_CC_cHandles (TPMA_CC)(7 << 25) -# define TPMA_CC_cHandles_SHIFT 25 -# define TPMA_CC_rHandle (TPMA_CC)(1 << 28) -# define TPMA_CC_V (TPMA_CC)(1 << 29) -# define TPMA_CC_reserved 0xc03f0000 // libtpms added +#define TPMA_CC_commandIndex (TPMA_CC)(0xFFFF << 0) +#define TPMA_CC_commandIndex_SHIFT 0 +#define TPMA_CC_nv (TPMA_CC)(1 << 22) +#define TPMA_CC_extensive (TPMA_CC)(1 << 23) +#define TPMA_CC_flushed (TPMA_CC)(1 << 24) +#define TPMA_CC_cHandles (TPMA_CC)(7 << 25) +#define TPMA_CC_cHandles_SHIFT 25 +#define TPMA_CC_rHandle (TPMA_CC)(1 << 28) +#define TPMA_CC_V (TPMA_CC)(1 << 29) +#define TPMA_CC_reserved 0xc03f0000 // libtpms added // This is the initializer for a TPMA_CC bit array. -# define TPMA_CC_INITIALIZER(commandindex, \ - bits_at_16, \ - nv, \ - extensive, \ - flushed, \ - chandles, \ - rhandle, \ - v, \ - bits_at_30) \ - (TPMA_CC)((commandindex << 0) + (nv << 22) + (extensive << 23) \ - + (flushed << 24) + (chandles << 25) + (rhandle << 28) + (v << 29)) - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_CC_INITIALIZER(commandindex, \ + bits_at_16, \ + nv, \ + extensive, \ + flushed, \ + chandles, \ + rhandle, \ + v, \ + bits_at_30) \ + (TPMA_CC)((commandindex << 0) + (nv << 22) + (extensive << 23) + (flushed << 24) \ + + (chandles << 25) + (rhandle << 28) + (v << 29)) // Table "Definition of TPMA_MODES Bits" (Part 2: Structures) #define TYPE_OF_TPMA_MODES UINT32 @@ -1443,37 +1235,18 @@ typedef TPM_CC TPMA_CC; UINT32 x = BYTE_ARRAY_TO_UINT32(a); \ i = UINT32_TO_TPMA_MODES(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned FIPS_140_2 : 1; - unsigned FIPS_140_3 : 1; - unsigned FIPS_140_3_INDICATOR : 2; - unsigned Reserved_bits_at_4 : 28; -} TPMA_MODES; - -// Initializer for the bit-field structure -# define TPMA_MODES_INITIALIZER( \ - fips_140_2, fips_140_3, fips_140_3_indicator, bits_at_4) \ - { \ - fips_140_2, fips_140_3, fips_140_3_indicator, bits_at_4 \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_MODES Bits" (Part 2: Structures) using bit masking typedef UINT32 TPMA_MODES; -# define TPMA_MODES_FIPS_140_2 (TPMA_MODES)(1 << 0) -# define TPMA_MODES_FIPS_140_3 (TPMA_MODES)(1 << 1) -# define TPMA_MODES_FIPS_140_3_INDICATOR (TPMA_MODES)(3 << 2) -# define TPMA_MODES_FIPS_140_3_INDICATOR_SHIFT 2 +#define TPMA_MODES_FIPS_140_2 (TPMA_MODES)(1 << 0) +#define TPMA_MODES_FIPS_140_3 (TPMA_MODES)(1 << 1) +#define TPMA_MODES_FIPS_140_3_INDICATOR (TPMA_MODES)(3 << 2) +#define TPMA_MODES_FIPS_140_3_INDICATOR_SHIFT 2 // This is the initializer for a TPMA_MODES bit array. -# define TPMA_MODES_INITIALIZER( \ - fips_140_2, fips_140_3, fips_140_3_indicator, bits_at_4) \ - (TPMA_MODES)( \ - (fips_140_2 << 0) + (fips_140_3 << 1) + (fips_140_3_indicator << 2)) - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_MODES_INITIALIZER( \ + fips_140_2, fips_140_3, fips_140_3_indicator, bits_at_4) \ + (TPMA_MODES)((fips_140_2 << 0) + (fips_140_3 << 1) + (fips_140_3_indicator << 2)) // Table "Definition of TPMA_X509_KEY_USAGE Bits" (Part 2: Structures) #define TYPE_OF_TPMA_X509_KEY_USAGE UINT32 @@ -1487,68 +1260,35 @@ typedef UINT32 TPMA_MODES; i = UINT32_TO_TPMA_X509_KEY_USAGE(x); \ } #define TPMA_X509_KEY_USAGE_ALLOWED_BITS (0xff800000) -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned Reserved_bits_at_0 : 23; - unsigned decipherOnly : 1; - unsigned encipherOnly : 1; - unsigned cRLSign : 1; - unsigned keyCertSign : 1; - unsigned keyAgreement : 1; - unsigned dataEncipherment : 1; - unsigned keyEncipherment : 1; - unsigned nonrepudiation : 1; - unsigned digitalSignature : 1; -} TPMA_X509_KEY_USAGE; - -// Initializer for the bit-field structure -# define TPMA_X509_KEY_USAGE_INITIALIZER(bits_at_0, \ - decipheronly, \ - encipheronly, \ - crlsign, \ - keycertsign, \ - keyagreement, \ - dataencipherment, \ - keyencipherment, \ - nonrepudiation, \ - digitalsignature) \ - { \ - bits_at_0, decipheronly, encipheronly, crlsign, keycertsign, keyagreement, \ - dataencipherment, keyencipherment, nonrepudiation, digitalsignature \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_X509_KEY_USAGE Bits" (Part 2: Structures) using bit masking typedef UINT32 TPMA_X509_KEY_USAGE; -# define TPMA_X509_KEY_USAGE_decipherOnly (TPMA_X509_KEY_USAGE)(1 << 23) -# define TPMA_X509_KEY_USAGE_encipherOnly (TPMA_X509_KEY_USAGE)(1 << 24) -# define TPMA_X509_KEY_USAGE_cRLSign (TPMA_X509_KEY_USAGE)(1 << 25) -# define TPMA_X509_KEY_USAGE_keyCertSign (TPMA_X509_KEY_USAGE)(1 << 26) -# define TPMA_X509_KEY_USAGE_keyAgreement (TPMA_X509_KEY_USAGE)(1 << 27) -# define TPMA_X509_KEY_USAGE_dataEncipherment (TPMA_X509_KEY_USAGE)(1 << 28) -# define TPMA_X509_KEY_USAGE_keyEncipherment (TPMA_X509_KEY_USAGE)(1 << 29) -# define TPMA_X509_KEY_USAGE_nonrepudiation (TPMA_X509_KEY_USAGE)(1 << 30) -# define TPMA_X509_KEY_USAGE_digitalSignature (TPMA_X509_KEY_USAGE)((UINT32)1 << 31) // libtpms changed: UBSAN +#define TPMA_X509_KEY_USAGE_decipherOnly (TPMA_X509_KEY_USAGE)(1 << 23) +#define TPMA_X509_KEY_USAGE_encipherOnly (TPMA_X509_KEY_USAGE)(1 << 24) +#define TPMA_X509_KEY_USAGE_cRLSign (TPMA_X509_KEY_USAGE)(1 << 25) +#define TPMA_X509_KEY_USAGE_keyCertSign (TPMA_X509_KEY_USAGE)(1 << 26) +#define TPMA_X509_KEY_USAGE_keyAgreement (TPMA_X509_KEY_USAGE)(1 << 27) +#define TPMA_X509_KEY_USAGE_dataEncipherment (TPMA_X509_KEY_USAGE)(1 << 28) +#define TPMA_X509_KEY_USAGE_keyEncipherment (TPMA_X509_KEY_USAGE)(1 << 29) +#define TPMA_X509_KEY_USAGE_nonrepudiation (TPMA_X509_KEY_USAGE)(1 << 30) +#define TPMA_X509_KEY_USAGE_digitalSignature (TPMA_X509_KEY_USAGE)((UINT32)1 << 31) // libtpms changed: UBSAN // This is the initializer for a TPMA_X509_KEY_USAGE bit array. -# define TPMA_X509_KEY_USAGE_INITIALIZER(bits_at_0, \ - decipheronly, \ - encipheronly, \ - crlsign, \ - keycertsign, \ - keyagreement, \ - dataencipherment, \ - keyencipherment, \ - nonrepudiation, \ - digitalsignature) \ - (TPMA_X509_KEY_USAGE)((decipheronly << 23) + (encipheronly << 24) \ - + (crlsign << 25) + (keycertsign << 26) \ - + (keyagreement << 27) + (dataencipherment << 28) \ - + (keyencipherment << 29) + (nonrepudiation << 30) \ - + ((UINT32)digitalsignature << 31)) // libtpms changed: UBSAN - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_X509_KEY_USAGE_INITIALIZER(bits_at_0, \ + decipheronly, \ + encipheronly, \ + crlsign, \ + keycertsign, \ + keyagreement, \ + dataencipherment, \ + keyencipherment, \ + nonrepudiation, \ + digitalsignature) \ + (TPMA_X509_KEY_USAGE)((decipheronly << 23) + (encipheronly << 24) \ + + (crlsign << 25) + (keycertsign << 26) \ + + (keyagreement << 27) + (dataencipherment << 28) \ + + (keyencipherment << 29) + (nonrepudiation << 30) \ + + ((UINT32)digitalsignature << 31)) // libtpms changed: UBSAN // Table "Definition of TPMA_ACT Bits" (Part 2: Structures) #define TYPE_OF_TPMA_ACT UINT32 @@ -1561,31 +1301,15 @@ typedef UINT32 TPMA_X509_KEY_USAGE; UINT32 x = BYTE_ARRAY_TO_UINT32(a); \ i = UINT32_TO_TPMA_ACT(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned signaled : 1; - unsigned preserveSignaled : 1; - unsigned Reserved_bits_at_2 : 30; -} TPMA_ACT; - -// Initializer for the bit-field structure -# define TPMA_ACT_INITIALIZER(signaled, preservesignaled, bits_at_2) \ - { \ - signaled, preservesignaled, bits_at_2 \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_ACT Bits" (Part 2: Structures) using bit masking typedef UINT32 TPMA_ACT; -# define TPMA_ACT_signaled (TPMA_ACT)(1 << 0) -# define TPMA_ACT_preserveSignaled (TPMA_ACT)(1 << 1) +#define TPMA_ACT_signaled (TPMA_ACT)(1 << 0) +#define TPMA_ACT_preserveSignaled (TPMA_ACT)(1 << 1) // This is the initializer for a TPMA_ACT bit array. -# define TPMA_ACT_INITIALIZER(signaled, preservesignaled, bits_at_2) \ - (TPMA_ACT)((signaled << 0) + (preservesignaled << 1)) - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_ACT_INITIALIZER(signaled, preservesignaled, bits_at_2) \ + (TPMA_ACT)((signaled << 0) + (preservesignaled << 1)) typedef BYTE TPMI_YES_NO; // (Part 2: Structures) typedef TPM_HANDLE TPMI_DH_OBJECT; // (Part 2: Structures) @@ -2791,32 +2515,17 @@ typedef union UINT32 x = BYTE_ARRAY_TO_UINT32(a); \ i = UINT32_TO_TPM_NV_INDEX(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned index : 24; - unsigned RH_NV : 8; -} TPM_NV_INDEX; - -// Initializer for the bit-field structure -# define TPM_NV_INDEX_INITIALIZER(index, rh_nv) \ - { \ - index, rh_nv \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPM_NV_INDEX Bits" (Part 2: Structures) using bit masking typedef UINT32 TPM_NV_INDEX; -# define TPM_NV_INDEX_index (TPM_NV_INDEX)(0xFFFFFF << 0) -# define TPM_NV_INDEX_index_SHIFT 0 -# define TPM_NV_INDEX_RH_NV (TPM_NV_INDEX)((UINT32)0xFF << 24) // libtpms changed: UBSAN -# define TPM_NV_INDEX_RH_NV_SHIFT 24 +#define TPM_NV_INDEX_index (TPM_NV_INDEX)(0xFFFFFF << 0) +#define TPM_NV_INDEX_index_SHIFT 0 +#define TPM_NV_INDEX_RH_NV (TPM_NV_INDEX)(0xFF << 24) +#define TPM_NV_INDEX_RH_NV_SHIFT 24 // This is the initializer for a TPM_NV_INDEX bit array. -# define TPM_NV_INDEX_INITIALIZER(index, rh_nv) \ - (TPM_NV_INDEX)((index << 0) + (rh_nv << 24)) - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPM_NV_INDEX_INITIALIZER(index, rh_nv) \ + (TPM_NV_INDEX)((index << 0) + (rh_nv << 24)) // Table "Definition of TPM_NT Constants" (Part 2: Structures) typedef UINT32 TPM_NT; @@ -2844,131 +2553,67 @@ typedef struct UINT32 x = BYTE_ARRAY_TO_UINT32(a); \ i = UINT32_TO_TPMA_NV(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned PPWRITE : 1; - unsigned OWNERWRITE : 1; - unsigned AUTHWRITE : 1; - unsigned POLICYWRITE : 1; - unsigned TPM_NT : 4; - unsigned Reserved_bits_at_8 : 2; - unsigned POLICY_DELETE : 1; - unsigned WRITELOCKED : 1; - unsigned WRITEALL : 1; - unsigned WRITEDEFINE : 1; - unsigned WRITE_STCLEAR : 1; - unsigned GLOBALLOCK : 1; - unsigned PPREAD : 1; - unsigned OWNERREAD : 1; - unsigned AUTHREAD : 1; - unsigned POLICYREAD : 1; - unsigned Reserved_bits_at_20 : 5; - unsigned NO_DA : 1; - unsigned ORDERLY : 1; - unsigned CLEAR_STCLEAR : 1; - unsigned READLOCKED : 1; - unsigned WRITTEN : 1; - unsigned PLATFORMCREATE : 1; - unsigned READ_STCLEAR : 1; -} TPMA_NV; - -// Initializer for the bit-field structure -# define TPMA_NV_INITIALIZER(ppwrite, \ - ownerwrite, \ - authwrite, \ - policywrite, \ - tpm_nt, \ - bits_at_8, \ - policy_delete, \ - writelocked, \ - writeall, \ - writedefine, \ - write_stclear, \ - globallock, \ - ppread, \ - ownerread, \ - authread, \ - policyread, \ - bits_at_20, \ - no_da, \ - orderly, \ - clear_stclear, \ - readlocked, \ - written, \ - platformcreate, \ - read_stclear) \ - { \ - ppwrite, ownerwrite, authwrite, policywrite, tpm_nt, bits_at_8, \ - policy_delete, writelocked, writeall, writedefine, write_stclear, \ - globallock, ppread, ownerread, authread, policyread, bits_at_20, \ - no_da, orderly, clear_stclear, readlocked, written, platformcreate, \ - read_stclear \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_NV Bits" (Part 2: Structures) using bit masking typedef UINT32 TPMA_NV; -# define TPMA_NV_PPWRITE (TPMA_NV)(1 << 0) -# define TPMA_NV_OWNERWRITE (TPMA_NV)(1 << 1) -# define TPMA_NV_AUTHWRITE (TPMA_NV)(1 << 2) -# define TPMA_NV_POLICYWRITE (TPMA_NV)(1 << 3) -# define TPMA_NV_TPM_NT (TPMA_NV)(0xF << 4) -# define TPMA_NV_TPM_NT_SHIFT 4 -# define TPMA_NV_POLICY_DELETE (TPMA_NV)(1 << 10) -# define TPMA_NV_WRITELOCKED (TPMA_NV)(1 << 11) -# define TPMA_NV_WRITEALL (TPMA_NV)(1 << 12) -# define TPMA_NV_WRITEDEFINE (TPMA_NV)(1 << 13) -# define TPMA_NV_WRITE_STCLEAR (TPMA_NV)(1 << 14) -# define TPMA_NV_GLOBALLOCK (TPMA_NV)(1 << 15) -# define TPMA_NV_PPREAD (TPMA_NV)(1 << 16) -# define TPMA_NV_OWNERREAD (TPMA_NV)(1 << 17) -# define TPMA_NV_AUTHREAD (TPMA_NV)(1 << 18) -# define TPMA_NV_POLICYREAD (TPMA_NV)(1 << 19) -# define TPMA_NV_NO_DA (TPMA_NV)(1 << 25) -# define TPMA_NV_ORDERLY (TPMA_NV)(1 << 26) -# define TPMA_NV_CLEAR_STCLEAR (TPMA_NV)(1 << 27) -# define TPMA_NV_READLOCKED (TPMA_NV)(1 << 28) -# define TPMA_NV_WRITTEN (TPMA_NV)(1 << 29) -# define TPMA_NV_PLATFORMCREATE (TPMA_NV)(1 << 30) -# define TPMA_NV_READ_STCLEAR (TPMA_NV)((UINT32)1 << 31) // libtpms changed: UBSAN -#define TPMA_NV_RESERVED (0x00000300 | 0x01f00000) // libtpms added +#define TPMA_NV_PPWRITE (TPMA_NV)(1 << 0) +#define TPMA_NV_OWNERWRITE (TPMA_NV)(1 << 1) +#define TPMA_NV_AUTHWRITE (TPMA_NV)(1 << 2) +#define TPMA_NV_POLICYWRITE (TPMA_NV)(1 << 3) +#define TPMA_NV_TPM_NT (TPMA_NV)(0xF << 4) +#define TPMA_NV_TPM_NT_SHIFT 4 +#define TPMA_NV_POLICY_DELETE (TPMA_NV)(1 << 10) +#define TPMA_NV_WRITELOCKED (TPMA_NV)(1 << 11) +#define TPMA_NV_WRITEALL (TPMA_NV)(1 << 12) +#define TPMA_NV_WRITEDEFINE (TPMA_NV)(1 << 13) +#define TPMA_NV_WRITE_STCLEAR (TPMA_NV)(1 << 14) +#define TPMA_NV_GLOBALLOCK (TPMA_NV)(1 << 15) +#define TPMA_NV_PPREAD (TPMA_NV)(1 << 16) +#define TPMA_NV_OWNERREAD (TPMA_NV)(1 << 17) +#define TPMA_NV_AUTHREAD (TPMA_NV)(1 << 18) +#define TPMA_NV_POLICYREAD (TPMA_NV)(1 << 19) +#define TPMA_NV_NO_DA (TPMA_NV)(1 << 25) +#define TPMA_NV_ORDERLY (TPMA_NV)(1 << 26) +#define TPMA_NV_CLEAR_STCLEAR (TPMA_NV)(1 << 27) +#define TPMA_NV_READLOCKED (TPMA_NV)(1 << 28) +#define TPMA_NV_WRITTEN (TPMA_NV)(1 << 29) +#define TPMA_NV_PLATFORMCREATE (TPMA_NV)(1 << 30) +#define TPMA_NV_READ_STCLEAR (TPMA_NV)((UINT32)1 << 31) // libtpms changed: UBSAN +#define TPMA_NV_RESERVED (0x00000300 | 0x01f00000) // libtpms added // This is the initializer for a TPMA_NV bit array. -# define TPMA_NV_INITIALIZER(ppwrite, \ - ownerwrite, \ - authwrite, \ - policywrite, \ - tpm_nt, \ - bits_at_8, \ - policy_delete, \ - writelocked, \ - writeall, \ - writedefine, \ - write_stclear, \ - globallock, \ - ppread, \ - ownerread, \ - authread, \ - policyread, \ - bits_at_20, \ - no_da, \ - orderly, \ - clear_stclear, \ - readlocked, \ - written, \ - platformcreate, \ - read_stclear) \ - (TPMA_NV)((ppwrite << 0) + (ownerwrite << 1) + (authwrite << 2) \ - + (policywrite << 3) + (tpm_nt << 4) + (policy_delete << 10) \ - + (writelocked << 11) + (writeall << 12) + (writedefine << 13) \ - + (write_stclear << 14) + (globallock << 15) + (ppread << 16) \ - + (ownerread << 17) + (authread << 18) + (policyread << 19) \ - + (no_da << 25) + (orderly << 26) + (clear_stclear << 27) \ - + (readlocked << 28) + (written << 29) + (platformcreate << 30) \ - + ((UINT32)read_stclear << 31)) // libtpms changed: UBSAN - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_NV_INITIALIZER(ppwrite, \ + ownerwrite, \ + authwrite, \ + policywrite, \ + tpm_nt, \ + bits_at_8, \ + policy_delete, \ + writelocked, \ + writeall, \ + writedefine, \ + write_stclear, \ + globallock, \ + ppread, \ + ownerread, \ + authread, \ + policyread, \ + bits_at_20, \ + no_da, \ + orderly, \ + clear_stclear, \ + readlocked, \ + written, \ + platformcreate, \ + read_stclear) \ + (TPMA_NV)((ppwrite << 0) + (ownerwrite << 1) + (authwrite << 2) \ + + (policywrite << 3) + (tpm_nt << 4) + (policy_delete << 10) \ + + (writelocked << 11) + (writeall << 12) + (writedefine << 13) \ + + (write_stclear << 14) + (globallock << 15) + (ppread << 16) \ + + (ownerread << 17) + (authread << 18) + (policyread << 19) \ + + (no_da << 25) + (orderly << 26) + (clear_stclear << 27) \ + + (readlocked << 28) + (written << 29) + (platformcreate << 30) \ + + (read_stclear << 31)) // Table "Definition of TPMA_NV_EXP Bits" (Part 2: Structures) #define TYPE_OF_TPMA_NV_EXP UINT64 @@ -2981,156 +2626,80 @@ typedef UINT32 TPMA_NV; UINT64 x = BYTE_ARRAY_TO_UINT64(a); \ i = UINT64_TO_TPMA_NV_EXP(x); \ } -#if USE_BIT_FIELD_STRUCTURES -typedef struct -{ - unsigned TPMA_NV_PPWRITE : 1; - unsigned TPMA_NV_OWNERWRITE : 1; - unsigned TPMA_NV_AUTHWRITE : 1; - unsigned TPMA_NV_POLICYWRITE : 1; - unsigned TPM_NT : 4; - unsigned Reserved_bits_at_8 : 2; - unsigned TPMA_NV_POLICY_DELETE : 1; - unsigned TPMA_NV_WRITELOCKED : 1; - unsigned TPMA_NV_WRITEALL : 1; - unsigned TPMA_NV_WRITEDEFINE : 1; - unsigned TPMA_NV_WRITE_STCLEAR : 1; - unsigned TPMA_NV_GLOBALLOCK : 1; - unsigned TPMA_NV_PPREAD : 1; - unsigned TPMA_NV_OWNERREAD : 1; - unsigned TPMA_NV_AUTHREAD : 1; - unsigned TPMA_NV_POLICYREAD : 1; - unsigned Reserved_bits_at_20 : 5; - unsigned TPMA_NV_NO_DA : 1; - unsigned TPMA_NV_ORDERLY : 1; - unsigned TPMA_NV_CLEAR_STCLEAR : 1; - unsigned TPMA_NV_READLOCKED : 1; - unsigned TPMA_NV_WRITTEN : 1; - unsigned TPMA_NV_PLATFORMCREATE : 1; - unsigned TPMA_NV_READ_STCLEAR : 1; - unsigned TPMA_EXTERNAL_NV_ENCRYPTION : 1; - unsigned TPMA_EXTERNAL_NV_INTEGRITY : 1; - unsigned TPMA_EXTERNAL_NV_ANTIROLLBACK : 1; - unsigned Reserved_bits_at_35 : 29; -} TPMA_NV_EXP; - -// Initializer for the bit-field structure -# define TPMA_NV_EXP_INITIALIZER(tpma_nv_ppwrite, \ - tpma_nv_ownerwrite, \ - tpma_nv_authwrite, \ - tpma_nv_policywrite, \ - tpm_nt, \ - bits_at_8, \ - tpma_nv_policy_delete, \ - tpma_nv_writelocked, \ - tpma_nv_writeall, \ - tpma_nv_writedefine, \ - tpma_nv_write_stclear, \ - tpma_nv_globallock, \ - tpma_nv_ppread, \ - tpma_nv_ownerread, \ - tpma_nv_authread, \ - tpma_nv_policyread, \ - bits_at_20, \ - tpma_nv_no_da, \ - tpma_nv_orderly, \ - tpma_nv_clear_stclear, \ - tpma_nv_readlocked, \ - tpma_nv_written, \ - tpma_nv_platformcreate, \ - tpma_nv_read_stclear, \ - tpma_external_nv_encryption, \ - tpma_external_nv_integrity, \ - tpma_external_nv_antirollback, \ - bits_at_35) \ - { \ - tpma_nv_ppwrite, tpma_nv_ownerwrite, tpma_nv_authwrite, \ - tpma_nv_policywrite, tpm_nt, bits_at_8, tpma_nv_policy_delete, \ - tpma_nv_writelocked, tpma_nv_writeall, tpma_nv_writedefine, \ - tpma_nv_write_stclear, tpma_nv_globallock, tpma_nv_ppread, \ - tpma_nv_ownerread, tpma_nv_authread, tpma_nv_policyread, bits_at_20, \ - tpma_nv_no_da, tpma_nv_orderly, tpma_nv_clear_stclear, \ - tpma_nv_readlocked, tpma_nv_written, tpma_nv_platformcreate, \ - tpma_nv_read_stclear, tpma_external_nv_encryption, \ - tpma_external_nv_integrity, tpma_external_nv_antirollback, bits_at_35 \ - } -#else // USE_BIT_FIELD_STRUCTURES // This implements Table "Definition of TPMA_NV_EXP Bits" (Part 2: Structures) using bit masking typedef UINT64 TPMA_NV_EXP; -# define TPMA_NV_EXP_TPMA_NV_PPWRITE (TPMA_NV_EXP)(1 << 0) -# define TPMA_NV_EXP_TPMA_NV_OWNERWRITE (TPMA_NV_EXP)(1 << 1) -# define TPMA_NV_EXP_TPMA_NV_AUTHWRITE (TPMA_NV_EXP)(1 << 2) -# define TPMA_NV_EXP_TPMA_NV_POLICYWRITE (TPMA_NV_EXP)(1 << 3) -# define TPMA_NV_EXP_TPM_NT (TPMA_NV_EXP)(0xF << 4) -# define TPMA_NV_EXP_TPM_NT_SHIFT 4 -# define TPMA_NV_EXP_TPMA_NV_POLICY_DELETE (TPMA_NV_EXP)(1 << 10) -# define TPMA_NV_EXP_TPMA_NV_WRITELOCKED (TPMA_NV_EXP)(1 << 11) -# define TPMA_NV_EXP_TPMA_NV_WRITEALL (TPMA_NV_EXP)(1 << 12) -# define TPMA_NV_EXP_TPMA_NV_WRITEDEFINE (TPMA_NV_EXP)(1 << 13) -# define TPMA_NV_EXP_TPMA_NV_WRITE_STCLEAR (TPMA_NV_EXP)(1 << 14) -# define TPMA_NV_EXP_TPMA_NV_GLOBALLOCK (TPMA_NV_EXP)(1 << 15) -# define TPMA_NV_EXP_TPMA_NV_PPREAD (TPMA_NV_EXP)(1 << 16) -# define TPMA_NV_EXP_TPMA_NV_OWNERREAD (TPMA_NV_EXP)(1 << 17) -# define TPMA_NV_EXP_TPMA_NV_AUTHREAD (TPMA_NV_EXP)(1 << 18) -# define TPMA_NV_EXP_TPMA_NV_POLICYREAD (TPMA_NV_EXP)(1 << 19) -# define TPMA_NV_EXP_TPMA_NV_NO_DA (TPMA_NV_EXP)(1 << 25) -# define TPMA_NV_EXP_TPMA_NV_ORDERLY (TPMA_NV_EXP)(1 << 26) -# define TPMA_NV_EXP_TPMA_NV_CLEAR_STCLEAR (TPMA_NV_EXP)(1 << 27) -# define TPMA_NV_EXP_TPMA_NV_READLOCKED (TPMA_NV_EXP)(1 << 28) -# define TPMA_NV_EXP_TPMA_NV_WRITTEN (TPMA_NV_EXP)(1 << 29) -# define TPMA_NV_EXP_TPMA_NV_PLATFORMCREATE (TPMA_NV_EXP)(1 << 30) -# define TPMA_NV_EXP_TPMA_NV_READ_STCLEAR (TPMA_NV_EXP)((UINT64)1 << 31) // libtpms changed begin: UBSAN -# define TPMA_NV_EXP_TPMA_EXTERNAL_NV_ENCRYPTION (TPMA_NV_EXP)((UINT64)1 << 32) -# define TPMA_NV_EXP_TPMA_EXTERNAL_NV_INTEGRITY (TPMA_NV_EXP)((UINT64)1 << 33) -# define TPMA_NV_EXP_TPMA_EXTERNAL_NV_ANTIROLLBACK (TPMA_NV_EXP)((UINT64)1 << 34) // libtpms changed end -# define TPMA_NV_EXP_reserved 0xfffffff800000000L // libtpms added +#define TPMA_NV_EXP_TPMA_NV_PPWRITE (TPMA_NV_EXP)(1 << 0) +#define TPMA_NV_EXP_TPMA_NV_OWNERWRITE (TPMA_NV_EXP)(1 << 1) +#define TPMA_NV_EXP_TPMA_NV_AUTHWRITE (TPMA_NV_EXP)(1 << 2) +#define TPMA_NV_EXP_TPMA_NV_POLICYWRITE (TPMA_NV_EXP)(1 << 3) +#define TPMA_NV_EXP_TPM_NT (TPMA_NV_EXP)(0xF << 4) +#define TPMA_NV_EXP_TPM_NT_SHIFT 4 +#define TPMA_NV_EXP_TPMA_NV_POLICY_DELETE (TPMA_NV_EXP)(1 << 10) +#define TPMA_NV_EXP_TPMA_NV_WRITELOCKED (TPMA_NV_EXP)(1 << 11) +#define TPMA_NV_EXP_TPMA_NV_WRITEALL (TPMA_NV_EXP)(1 << 12) +#define TPMA_NV_EXP_TPMA_NV_WRITEDEFINE (TPMA_NV_EXP)(1 << 13) +#define TPMA_NV_EXP_TPMA_NV_WRITE_STCLEAR (TPMA_NV_EXP)(1 << 14) +#define TPMA_NV_EXP_TPMA_NV_GLOBALLOCK (TPMA_NV_EXP)(1 << 15) +#define TPMA_NV_EXP_TPMA_NV_PPREAD (TPMA_NV_EXP)(1 << 16) +#define TPMA_NV_EXP_TPMA_NV_OWNERREAD (TPMA_NV_EXP)(1 << 17) +#define TPMA_NV_EXP_TPMA_NV_AUTHREAD (TPMA_NV_EXP)(1 << 18) +#define TPMA_NV_EXP_TPMA_NV_POLICYREAD (TPMA_NV_EXP)(1 << 19) +#define TPMA_NV_EXP_TPMA_NV_NO_DA (TPMA_NV_EXP)(1 << 25) +#define TPMA_NV_EXP_TPMA_NV_ORDERLY (TPMA_NV_EXP)(1 << 26) +#define TPMA_NV_EXP_TPMA_NV_CLEAR_STCLEAR (TPMA_NV_EXP)(1 << 27) +#define TPMA_NV_EXP_TPMA_NV_READLOCKED (TPMA_NV_EXP)(1 << 28) +#define TPMA_NV_EXP_TPMA_NV_WRITTEN (TPMA_NV_EXP)(1 << 29) +#define TPMA_NV_EXP_TPMA_NV_PLATFORMCREATE (TPMA_NV_EXP)(1 << 30) +#define TPMA_NV_EXP_TPMA_NV_READ_STCLEAR (TPMA_NV_EXP)((UINT64)1 << 31) // libtpms changed begin: UBSAN +#define TPMA_NV_EXP_TPMA_EXTERNAL_NV_ENCRYPTION (TPMA_NV_EXP)((UINT64)1 << 32) +#define TPMA_NV_EXP_TPMA_EXTERNAL_NV_INTEGRITY (TPMA_NV_EXP)((UINT64)1 << 33) +#define TPMA_NV_EXP_TPMA_EXTERNAL_NV_ANTIROLLBACK (TPMA_NV_EXP)((UINT64)1 << 34) // libtpms changed end +#define TPMA_NV_EXP_reserved 0xfffffff800000000L // libtpms added // This is the initializer for a TPMA_NV_EXP bit array. -# define TPMA_NV_EXP_INITIALIZER(tpma_nv_ppwrite, \ - tpma_nv_ownerwrite, \ - tpma_nv_authwrite, \ - tpma_nv_policywrite, \ - tpm_nt, \ - bits_at_8, \ - tpma_nv_policy_delete, \ - tpma_nv_writelocked, \ - tpma_nv_writeall, \ - tpma_nv_writedefine, \ - tpma_nv_write_stclear, \ - tpma_nv_globallock, \ - tpma_nv_ppread, \ - tpma_nv_ownerread, \ - tpma_nv_authread, \ - tpma_nv_policyread, \ - bits_at_20, \ - tpma_nv_no_da, \ - tpma_nv_orderly, \ - tpma_nv_clear_stclear, \ - tpma_nv_readlocked, \ - tpma_nv_written, \ - tpma_nv_platformcreate, \ - tpma_nv_read_stclear, \ - tpma_external_nv_encryption, \ - tpma_external_nv_integrity, \ - tpma_external_nv_antirollback, \ - bits_at_35) \ - (TPMA_NV_EXP)((tpma_nv_ppwrite << 0) + (tpma_nv_ownerwrite << 1) \ - + (tpma_nv_authwrite << 2) + (tpma_nv_policywrite << 3) \ - + (tpm_nt << 4) + (tpma_nv_policy_delete << 10) \ - + (tpma_nv_writelocked << 11) + (tpma_nv_writeall << 12) \ - + (tpma_nv_writedefine << 13) + (tpma_nv_write_stclear << 14) \ - + (tpma_nv_globallock << 15) + (tpma_nv_ppread << 16) \ - + (tpma_nv_ownerread << 17) + (tpma_nv_authread << 18) \ - + (tpma_nv_policyread << 19) + (tpma_nv_no_da << 25) \ - + (tpma_nv_orderly << 26) + (tpma_nv_clear_stclear << 27) \ - + (tpma_nv_readlocked << 28) + (tpma_nv_written << 29) \ - + (tpma_nv_platformcreate << 30) + ((UINT64)tpma_nv_read_stclear << 31) /* libtpms changed: UBSAN */ \ - + ((UINT64)tpma_external_nv_encryption << 32) /* libtpms changed: UBSAN */ \ - + ((UINT64)tpma_external_nv_integrity << 33) /* libtpms changed: UBSAN */ \ - + ((UINT64)tpma_external_nv_antirollback << 34)) /* libtpms changed: UBSAN */ - -#endif // USE_BIT_FIELD_STRUCTURES +#define TPMA_NV_EXP_INITIALIZER(tpma_nv_ppwrite, \ + tpma_nv_ownerwrite, \ + tpma_nv_authwrite, \ + tpma_nv_policywrite, \ + tpm_nt, \ + bits_at_8, \ + tpma_nv_policy_delete, \ + tpma_nv_writelocked, \ + tpma_nv_writeall, \ + tpma_nv_writedefine, \ + tpma_nv_write_stclear, \ + tpma_nv_globallock, \ + tpma_nv_ppread, \ + tpma_nv_ownerread, \ + tpma_nv_authread, \ + tpma_nv_policyread, \ + bits_at_20, \ + tpma_nv_no_da, \ + tpma_nv_orderly, \ + tpma_nv_clear_stclear, \ + tpma_nv_readlocked, \ + tpma_nv_written, \ + tpma_nv_platformcreate, \ + tpma_nv_read_stclear, \ + tpma_external_nv_encryption, \ + tpma_external_nv_integrity, \ + tpma_external_nv_antirollback, \ + bits_at_35) \ + (TPMA_NV_EXP)((tpma_nv_ppwrite << 0) + (tpma_nv_ownerwrite << 1) \ + + (tpma_nv_authwrite << 2) + (tpma_nv_policywrite << 3) \ + + (tpm_nt << 4) + (tpma_nv_policy_delete << 10) \ + + (tpma_nv_writelocked << 11) + (tpma_nv_writeall << 12) \ + + (tpma_nv_writedefine << 13) + (tpma_nv_write_stclear << 14) \ + + (tpma_nv_globallock << 15) + (tpma_nv_ppread << 16) \ + + (tpma_nv_ownerread << 17) + (tpma_nv_authread << 18) \ + + (tpma_nv_policyread << 19) + (tpma_nv_no_da << 25) \ + + (tpma_nv_orderly << 26) + (tpma_nv_clear_stclear << 27) \ + + (tpma_nv_readlocked << 28) + (tpma_nv_written << 29) \ + + (tpma_nv_platformcreate << 30) + ((UINT64)tpma_nv_read_stclear << 31) /* libtpms changed: UBSAN */ \ + + ((UINT64)tpma_external_nv_encryption << 32) /* libtpms changed: UBSAN */ \ + + ((UINT64)tpma_external_nv_integrity << 33) /* libtpms changed: UBSAN */ \ + + ((UINT64)tpma_external_nv_antirollback << 34)) /* libtpms changed: UBSAN */ typedef struct { // (Part 2: Structures) diff --git a/src/tpm2/VerifyConfiguration.h b/src/tpm2/VerifyConfiguration.h index 85b05553e..783df58a4 100644 --- a/src/tpm2/VerifyConfiguration.h +++ b/src/tpm2/VerifyConfiguration.h @@ -98,7 +98,6 @@ MUST_BE_0_OR_1(TABLE_DRIVEN_DISPATCH); MUST_BE_0_OR_1(TABLE_DRIVEN_MARSHAL); MUST_BE_0_OR_1(USE_MARSHALING_DEFINES); MUST_BE_0_OR_1(COMPRESSED_LISTS); -MUST_BE_0_OR_1(USE_BIT_FIELD_STRUCTURES); MUST_BE_0_OR_1(RSA_KEY_SIEVE); // Implementation alternatives - changes external behavior From c1bea7e25129990688b1db5f5a2f77d1a50c9181 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 22 Jul 2025 16:51:52 -0400 Subject: [PATCH 05/52] Sync: Remove USE_MARSHALING_DEFINES build switch The build swtich was not used anywhere else. Signed-off-by: Stefan Berger --- src/tpm2/TpmBuildSwitches.h | 68 +--------------------------------- src/tpm2/VerifyConfiguration.h | 61 +----------------------------- 2 files changed, 3 insertions(+), 126 deletions(-) diff --git a/src/tpm2/TpmBuildSwitches.h b/src/tpm2/TpmBuildSwitches.h index b0c3fb085..dc3ffaed4 100644 --- a/src/tpm2/TpmBuildSwitches.h +++ b/src/tpm2/TpmBuildSwitches.h @@ -1,62 +1,5 @@ -/********************************************************************************/ -/* */ -/* Build Switches */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + // This file contains the build switches. This contains switches for multiple // versions of the crypto-library so some may not apply to your environment. @@ -210,13 +153,6 @@ // This define is used to enable the new table-driven marshaling code. #define TABLE_DRIVEN_MARSHAL NO -// This switch allows use of #defines in place of pass-through marshaling or -// unmarshaling code. A pass-through function just calls another function to do -// the required function and does no parameter checking of its own. The -// table-driven dispatcher calls directly to the lowest level -// marshaling/unmarshaling code and by-passes any pass-through functions. -#define USE_MARSHALING_DEFINES YES - // Switch added to support packed lists that leave out space associated with // unimplemented commands. Comment this out to use linear lists. // Note: if vendor specific commands are present, the associated list is always diff --git a/src/tpm2/VerifyConfiguration.h b/src/tpm2/VerifyConfiguration.h index 783df58a4..bac45fd2c 100644 --- a/src/tpm2/VerifyConfiguration.h +++ b/src/tpm2/VerifyConfiguration.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // // This verifies that information expected from the consumer's TpmConfiguration is @@ -96,7 +38,6 @@ MUST_BE_0_OR_1(SKIP_PROOF_ERRORS); // Implementation alternatives - should not change external behavior MUST_BE_0_OR_1(TABLE_DRIVEN_DISPATCH); MUST_BE_0_OR_1(TABLE_DRIVEN_MARSHAL); -MUST_BE_0_OR_1(USE_MARSHALING_DEFINES); MUST_BE_0_OR_1(COMPRESSED_LISTS); MUST_BE_0_OR_1(RSA_KEY_SIEVE); From ce789ebba56fa21ccb5bcd6336e55068722151b8 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 24 Jul 2025 10:21:50 -0400 Subject: [PATCH 06/52] tpm2: Get rid of IS_IMPLEMENTED flag for CC attributes Upstream has gotten rid of the IS_IMPLEMENTED flag but upstream is also using compressed lists where each element in the command lists represents an implemented command. Libtpms does not use compressed lists but we may have a list with gaps in it due to unimplemented commands where this flag may be the only one set and help identify an implemented command. However, since profiles indicate enablement and implementation of commands, and nearly all tests for the IS_IMPLEMENTED flag are paired with a check on the profile with RuntimeCommandsCheckEnabled(), we can get rid of tests for IS_IMPLEMENTED and finally the flag altogether since it is redundant. Also get rid of NOT_IMPLEMENTED flag that was not used anywhere. Signed-off-by: Stefan Berger --- src/tpm2/CommandAttributeData.h | 318 +++++++++++++------------------ src/tpm2/CommandAttributes.h | 92 ++------- src/tpm2/CommandCodeAttributes.c | 102 ++-------- src/tpm2/CommandDispatcher.c | 65 +------ src/tpm2/PP.c | 63 +----- src/tpm2/PropertyCap.c | 18 +- src/tpm2/TpmTypes.h | 8 +- src/tpm2/VerifyConfiguration.h | 2 +- 8 files changed, 183 insertions(+), 485 deletions(-) diff --git a/src/tpm2/CommandAttributeData.h b/src/tpm2/CommandAttributeData.h index ab86ae2a2..968cf8232 100644 --- a/src/tpm2/CommandAttributeData.h +++ b/src/tpm2/CommandAttributeData.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Command code attribute array for GetCapability */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT @@ -67,11 +9,11 @@ #include "CommandAttributes.h" -#if COMPRESSED_LISTS +#if COMPRESSED_LISTS // libtpms added begin # define PAD_LIST 0 #else # define PAD_LIST 1 -#endif +#endif // libtpms added end // This is the command code attribute array for GetCapability. // Both this array and s_commandAttributes provides command code attributes, @@ -475,518 +417,518 @@ const TPMA_CC s_ccAttr [] = { const COMMAND_ATTRIBUTES s_commandAttributes [] = { #if (PAD_LIST || CC_NV_UndefineSpaceSpecial) (COMMAND_ATTRIBUTES)(CC_NV_UndefineSpaceSpecial * // 0x011F - (IS_IMPLEMENTED+HANDLE_1_ADMIN+HANDLE_2_USER+PP_COMMAND)), + (HANDLE_1_ADMIN+HANDLE_2_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_EvictControl) (COMMAND_ATTRIBUTES)(CC_EvictControl * // 0x0120 - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_HierarchyControl) (COMMAND_ATTRIBUTES)(CC_HierarchyControl * // 0x0121 - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_NV_UndefineSpace) (COMMAND_ATTRIBUTES)(CC_NV_UndefineSpace * // 0x0122 - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST) (COMMAND_ATTRIBUTES)(0), // 0x0123 #endif #if (PAD_LIST || CC_ChangeEPS) (COMMAND_ATTRIBUTES)(CC_ChangeEPS * // 0x0124 - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_ChangePPS) (COMMAND_ATTRIBUTES)(CC_ChangePPS * // 0x0125 - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_Clear) (COMMAND_ATTRIBUTES)(CC_Clear * // 0x0126 - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_ClearControl) (COMMAND_ATTRIBUTES)(CC_ClearControl * // 0x0127 - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_ClockSet) (COMMAND_ATTRIBUTES)(CC_ClockSet * // 0x0128 - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_HierarchyChangeAuth) (COMMAND_ATTRIBUTES)(CC_HierarchyChangeAuth * // 0x0129 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_NV_DefineSpace) (COMMAND_ATTRIBUTES)(CC_NV_DefineSpace * // 0x012A - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_PCR_Allocate) (COMMAND_ATTRIBUTES)(CC_PCR_Allocate * // 0x012B - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_PCR_SetAuthPolicy) (COMMAND_ATTRIBUTES)(CC_PCR_SetAuthPolicy * // 0x012C - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_PP_Commands) (COMMAND_ATTRIBUTES)(CC_PP_Commands * // 0x012D - (IS_IMPLEMENTED+HANDLE_1_USER+PP_REQUIRED)), + (HANDLE_1_USER+PP_REQUIRED)), #endif #if (PAD_LIST || CC_SetPrimaryPolicy) (COMMAND_ATTRIBUTES)(CC_SetPrimaryPolicy * // 0x012E - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_FieldUpgradeStart) (COMMAND_ATTRIBUTES)(CC_FieldUpgradeStart * // 0x012F - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_ADMIN+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_ADMIN+PP_COMMAND)), #endif #if (PAD_LIST || CC_ClockRateAdjust) (COMMAND_ATTRIBUTES)(CC_ClockRateAdjust * // 0x0130 - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_CreatePrimary) (COMMAND_ATTRIBUTES)(CC_CreatePrimary * // 0x0131 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+PP_COMMAND+ENCRYPT_2+R_HANDLE)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND+ENCRYPT_2+R_HANDLE)), #endif #if (PAD_LIST || CC_NV_GlobalWriteLock) (COMMAND_ATTRIBUTES)(CC_NV_GlobalWriteLock * // 0x0132 - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_GetCommandAuditDigest) (COMMAND_ATTRIBUTES)(CC_GetCommandAuditDigest * // 0x0133 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+HANDLE_2_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+HANDLE_2_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_NV_Increment) (COMMAND_ATTRIBUTES)(CC_NV_Increment * // 0x0134 - (IS_IMPLEMENTED+HANDLE_1_USER)), + (HANDLE_1_USER)), #endif #if (PAD_LIST || CC_NV_SetBits) (COMMAND_ATTRIBUTES)(CC_NV_SetBits * // 0x0135 - (IS_IMPLEMENTED+HANDLE_1_USER)), + (HANDLE_1_USER)), #endif #if (PAD_LIST || CC_NV_Extend) (COMMAND_ATTRIBUTES)(CC_NV_Extend * // 0x0136 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER)), + (DECRYPT_2+HANDLE_1_USER)), #endif #if (PAD_LIST || CC_NV_Write) (COMMAND_ATTRIBUTES)(CC_NV_Write * // 0x0137 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER)), + (DECRYPT_2+HANDLE_1_USER)), #endif #if (PAD_LIST || CC_NV_WriteLock) (COMMAND_ATTRIBUTES)(CC_NV_WriteLock * // 0x0138 - (IS_IMPLEMENTED+HANDLE_1_USER)), + (HANDLE_1_USER)), #endif #if (PAD_LIST || CC_DictionaryAttackLockReset) (COMMAND_ATTRIBUTES)(CC_DictionaryAttackLockReset * // 0x0139 - (IS_IMPLEMENTED+HANDLE_1_USER)), + (HANDLE_1_USER)), #endif #if (PAD_LIST || CC_DictionaryAttackParameters) (COMMAND_ATTRIBUTES)(CC_DictionaryAttackParameters * // 0x013A - (IS_IMPLEMENTED+HANDLE_1_USER)), + (HANDLE_1_USER)), #endif #if (PAD_LIST || CC_NV_ChangeAuth) (COMMAND_ATTRIBUTES)(CC_NV_ChangeAuth * // 0x013B - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_ADMIN)), + (DECRYPT_2+HANDLE_1_ADMIN)), #endif #if (PAD_LIST || CC_PCR_Event) (COMMAND_ATTRIBUTES)(CC_PCR_Event * // 0x013C - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER)), + (DECRYPT_2+HANDLE_1_USER)), #endif #if (PAD_LIST || CC_PCR_Reset) (COMMAND_ATTRIBUTES)(CC_PCR_Reset * // 0x013D - (IS_IMPLEMENTED+HANDLE_1_USER)), + (HANDLE_1_USER)), #endif #if (PAD_LIST || CC_SequenceComplete) (COMMAND_ATTRIBUTES)(CC_SequenceComplete * // 0x013E - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_SetAlgorithmSet) (COMMAND_ATTRIBUTES)(CC_SetAlgorithmSet * // 0x013F - (IS_IMPLEMENTED+HANDLE_1_USER)), + (HANDLE_1_USER)), #endif #if (PAD_LIST || CC_SetCommandCodeAuditStatus) (COMMAND_ATTRIBUTES)(CC_SetCommandCodeAuditStatus * // 0x0140 - (IS_IMPLEMENTED+HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_FieldUpgradeData) (COMMAND_ATTRIBUTES)(CC_FieldUpgradeData * // 0x0141 - (IS_IMPLEMENTED+DECRYPT_2)), + (DECRYPT_2)), #endif #if (PAD_LIST || CC_IncrementalSelfTest) (COMMAND_ATTRIBUTES)(CC_IncrementalSelfTest * // 0x0142 - (IS_IMPLEMENTED)), + (0)), #endif #if (PAD_LIST || CC_SelfTest) (COMMAND_ATTRIBUTES)(CC_SelfTest * // 0x0143 - (IS_IMPLEMENTED)), + (0)), #endif #if (PAD_LIST || CC_Startup) (COMMAND_ATTRIBUTES)(CC_Startup * // 0x0144 - (IS_IMPLEMENTED+NO_SESSIONS)), + (NO_SESSIONS)), #endif #if (PAD_LIST || CC_Shutdown) (COMMAND_ATTRIBUTES)(CC_Shutdown * // 0x0145 - (IS_IMPLEMENTED)), + (0)), #endif #if (PAD_LIST || CC_StirRandom) (COMMAND_ATTRIBUTES)(CC_StirRandom * // 0x0146 - (IS_IMPLEMENTED+DECRYPT_2)), + (DECRYPT_2)), #endif #if (PAD_LIST || CC_ActivateCredential) (COMMAND_ATTRIBUTES)(CC_ActivateCredential * // 0x0147 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_ADMIN+HANDLE_2_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_ADMIN+HANDLE_2_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_Certify) (COMMAND_ATTRIBUTES)(CC_Certify * // 0x0148 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_ADMIN+HANDLE_2_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_ADMIN+HANDLE_2_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_PolicyNV) (COMMAND_ATTRIBUTES)(CC_PolicyNV * // 0x0149 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ALLOW_TRIAL)), + (DECRYPT_2+HANDLE_1_USER+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_CertifyCreation) (COMMAND_ATTRIBUTES)(CC_CertifyCreation * // 0x014A - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_Duplicate) (COMMAND_ATTRIBUTES)(CC_Duplicate * // 0x014B - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_DUP+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_DUP+ENCRYPT_2)), #endif #if (PAD_LIST || CC_GetTime) (COMMAND_ATTRIBUTES)(CC_GetTime * // 0x014C - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+HANDLE_2_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+HANDLE_2_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_GetSessionAuditDigest) (COMMAND_ATTRIBUTES)(CC_GetSessionAuditDigest * // 0x014D - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+HANDLE_2_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+HANDLE_2_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_NV_Read) (COMMAND_ATTRIBUTES)(CC_NV_Read * // 0x014E - (IS_IMPLEMENTED+HANDLE_1_USER+ENCRYPT_2)), + (HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_NV_ReadLock) (COMMAND_ATTRIBUTES)(CC_NV_ReadLock * // 0x014F - (IS_IMPLEMENTED+HANDLE_1_USER)), + (HANDLE_1_USER)), #endif #if (PAD_LIST || CC_ObjectChangeAuth) (COMMAND_ATTRIBUTES)(CC_ObjectChangeAuth * // 0x0150 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_ADMIN+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_ADMIN+ENCRYPT_2)), #endif #if (PAD_LIST || CC_PolicySecret) (COMMAND_ATTRIBUTES)(CC_PolicySecret * // 0x0151 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ALLOW_TRIAL+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ALLOW_TRIAL+ENCRYPT_2)), #endif #if (PAD_LIST || CC_Rewrap) (COMMAND_ATTRIBUTES)(CC_Rewrap * // 0x0152 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_Create) (COMMAND_ATTRIBUTES)(CC_Create * // 0x0153 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_ECDH_ZGen) (COMMAND_ATTRIBUTES)(CC_ECDH_ZGen * // 0x0154 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || (CC_HMAC || CC_MAC)) (COMMAND_ATTRIBUTES)((CC_HMAC || CC_MAC) * // 0x0155 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_Import) (COMMAND_ATTRIBUTES)(CC_Import * // 0x0156 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_Load) (COMMAND_ATTRIBUTES)(CC_Load * // 0x0157 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2+R_HANDLE)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2+R_HANDLE)), #endif #if (PAD_LIST || CC_Quote) (COMMAND_ATTRIBUTES)(CC_Quote * // 0x0158 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_RSA_Decrypt) (COMMAND_ATTRIBUTES)(CC_RSA_Decrypt * // 0x0159 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST) (COMMAND_ATTRIBUTES)(0), // 0x015A #endif #if (PAD_LIST || (CC_HMAC_Start || CC_MAC_Start)) (COMMAND_ATTRIBUTES)((CC_HMAC_Start || CC_MAC_Start) * // 0x015B - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+R_HANDLE)), + (DECRYPT_2+HANDLE_1_USER+R_HANDLE)), #endif #if (PAD_LIST || CC_SequenceUpdate) (COMMAND_ATTRIBUTES)(CC_SequenceUpdate * // 0x015C - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER)), + (DECRYPT_2+HANDLE_1_USER)), #endif #if (PAD_LIST || CC_Sign) (COMMAND_ATTRIBUTES)(CC_Sign * // 0x015D - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER)), + (DECRYPT_2+HANDLE_1_USER)), #endif #if (PAD_LIST || CC_Unseal) (COMMAND_ATTRIBUTES)(CC_Unseal * // 0x015E - (IS_IMPLEMENTED+HANDLE_1_USER+ENCRYPT_2)), + (HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST) (COMMAND_ATTRIBUTES)(0), // 0x015F #endif #if (PAD_LIST || CC_PolicySigned) (COMMAND_ATTRIBUTES)(CC_PolicySigned * // 0x0160 - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL+ENCRYPT_2)), + (DECRYPT_2+ALLOW_TRIAL+ENCRYPT_2)), #endif #if (PAD_LIST || CC_ContextLoad) (COMMAND_ATTRIBUTES)(CC_ContextLoad * // 0x0161 - (IS_IMPLEMENTED+NO_SESSIONS+R_HANDLE)), + (NO_SESSIONS+R_HANDLE)), #endif #if (PAD_LIST || CC_ContextSave) (COMMAND_ATTRIBUTES)(CC_ContextSave * // 0x0162 - (IS_IMPLEMENTED+NO_SESSIONS)), + (NO_SESSIONS)), #endif #if (PAD_LIST || CC_ECDH_KeyGen) (COMMAND_ATTRIBUTES)(CC_ECDH_KeyGen * // 0x0163 - (IS_IMPLEMENTED+ENCRYPT_2)), + (ENCRYPT_2)), #endif #if (PAD_LIST || CC_EncryptDecrypt) (COMMAND_ATTRIBUTES)(CC_EncryptDecrypt * // 0x0164 - (IS_IMPLEMENTED+HANDLE_1_USER+ENCRYPT_2)), + (HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_FlushContext) (COMMAND_ATTRIBUTES)(CC_FlushContext * // 0x0165 - (IS_IMPLEMENTED+NO_SESSIONS)), + (NO_SESSIONS)), #endif #if (PAD_LIST) (COMMAND_ATTRIBUTES)(0), // 0x0166 #endif #if (PAD_LIST || CC_LoadExternal) (COMMAND_ATTRIBUTES)(CC_LoadExternal * // 0x0167 - (IS_IMPLEMENTED+DECRYPT_2+ENCRYPT_2+R_HANDLE)), + (DECRYPT_2+ENCRYPT_2+R_HANDLE)), #endif #if (PAD_LIST || CC_MakeCredential) (COMMAND_ATTRIBUTES)(CC_MakeCredential * // 0x0168 - (IS_IMPLEMENTED+DECRYPT_2+ENCRYPT_2)), + (DECRYPT_2+ENCRYPT_2)), #endif #if (PAD_LIST || CC_NV_ReadPublic) (COMMAND_ATTRIBUTES)(CC_NV_ReadPublic * // 0x0169 - (IS_IMPLEMENTED+ENCRYPT_2)), + (ENCRYPT_2)), #endif #if (PAD_LIST || CC_PolicyAuthorize) (COMMAND_ATTRIBUTES)(CC_PolicyAuthorize * // 0x016A - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL)), + (DECRYPT_2+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_PolicyAuthValue) (COMMAND_ATTRIBUTES)(CC_PolicyAuthValue * // 0x016B - (IS_IMPLEMENTED+ALLOW_TRIAL)), + (ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_PolicyCommandCode) (COMMAND_ATTRIBUTES)(CC_PolicyCommandCode * // 0x016C - (IS_IMPLEMENTED+ALLOW_TRIAL)), + (ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_PolicyCounterTimer) (COMMAND_ATTRIBUTES)(CC_PolicyCounterTimer * // 0x016D - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL)), + (DECRYPT_2+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_PolicyCpHash) (COMMAND_ATTRIBUTES)(CC_PolicyCpHash * // 0x016E - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL)), + (DECRYPT_2+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_PolicyLocality) (COMMAND_ATTRIBUTES)(CC_PolicyLocality * // 0x016F - (IS_IMPLEMENTED+ALLOW_TRIAL)), + (ALLOW_TRIAL)), #endif -#if (PAD_LIST || CC_PolicyNameHash) +#if (PAD_LIST || CC_PolicyNameHash) (COMMAND_ATTRIBUTES)(CC_PolicyNameHash * // 0x0170 - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL)), + (DECRYPT_2+ALLOW_TRIAL)), #endif -#if (PAD_LIST || CC_PolicyOR) +#if (PAD_LIST || CC_PolicyOR) (COMMAND_ATTRIBUTES)(CC_PolicyOR * // 0x0171 - (IS_IMPLEMENTED+ALLOW_TRIAL)), + (ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_PolicyTicket) (COMMAND_ATTRIBUTES)(CC_PolicyTicket * // 0x0172 - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL)), + (DECRYPT_2+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_ReadPublic) (COMMAND_ATTRIBUTES)(CC_ReadPublic * // 0x0173 - (IS_IMPLEMENTED+ENCRYPT_2)), + (ENCRYPT_2)), #endif #if (PAD_LIST || CC_RSA_Encrypt) (COMMAND_ATTRIBUTES)(CC_RSA_Encrypt * // 0x0174 - (IS_IMPLEMENTED+DECRYPT_2+ENCRYPT_2)), + (DECRYPT_2+ENCRYPT_2)), #endif #if (PAD_LIST) (COMMAND_ATTRIBUTES)(0), // 0x0175 #endif #if (PAD_LIST || CC_StartAuthSession) (COMMAND_ATTRIBUTES)(CC_StartAuthSession * // 0x0176 - (IS_IMPLEMENTED+DECRYPT_2+ENCRYPT_2+R_HANDLE)), + (DECRYPT_2+ENCRYPT_2+R_HANDLE)), #endif #if (PAD_LIST || CC_VerifySignature) (COMMAND_ATTRIBUTES)(CC_VerifySignature * // 0x0177 - (IS_IMPLEMENTED+DECRYPT_2)), + (DECRYPT_2)), #endif #if (PAD_LIST || CC_ECC_Parameters) (COMMAND_ATTRIBUTES)(CC_ECC_Parameters * // 0x0178 - (IS_IMPLEMENTED)), + (0)), #endif #if (PAD_LIST || CC_FirmwareRead) (COMMAND_ATTRIBUTES)(CC_FirmwareRead * // 0x0179 - (IS_IMPLEMENTED+ENCRYPT_2)), + (ENCRYPT_2)), #endif #if (PAD_LIST || CC_GetCapability) (COMMAND_ATTRIBUTES)(CC_GetCapability * // 0x017A - (IS_IMPLEMENTED)), + (0)), #endif #if (PAD_LIST || CC_GetRandom) (COMMAND_ATTRIBUTES)(CC_GetRandom * // 0x017B - (IS_IMPLEMENTED+ENCRYPT_2)), + (ENCRYPT_2)), #endif #if (PAD_LIST || CC_GetTestResult) (COMMAND_ATTRIBUTES)(CC_GetTestResult * // 0x017C - (IS_IMPLEMENTED+ENCRYPT_2)), + (ENCRYPT_2)), #endif #if (PAD_LIST || CC_Hash) (COMMAND_ATTRIBUTES)(CC_Hash * // 0x017D - (IS_IMPLEMENTED+DECRYPT_2+ENCRYPT_2)), + (DECRYPT_2+ENCRYPT_2)), #endif #if (PAD_LIST || CC_PCR_Read) (COMMAND_ATTRIBUTES)(CC_PCR_Read * // 0x017E - (IS_IMPLEMENTED)), + (0)), #endif #if (PAD_LIST || CC_PolicyPCR) (COMMAND_ATTRIBUTES)(CC_PolicyPCR * // 0x017F - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL)), + (DECRYPT_2+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_PolicyRestart) (COMMAND_ATTRIBUTES)(CC_PolicyRestart * // 0x0180 - (IS_IMPLEMENTED+ALLOW_TRIAL)), + (ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_ReadClock) (COMMAND_ATTRIBUTES)(CC_ReadClock * // 0x0181 - (IS_IMPLEMENTED)), + (0)), #endif #if (PAD_LIST || CC_PCR_Extend) (COMMAND_ATTRIBUTES)(CC_PCR_Extend * // 0x0182 - (IS_IMPLEMENTED+HANDLE_1_USER)), + (HANDLE_1_USER)), #endif #if (PAD_LIST || CC_PCR_SetAuthValue) (COMMAND_ATTRIBUTES)(CC_PCR_SetAuthValue * // 0x0183 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER)), + (DECRYPT_2+HANDLE_1_USER)), #endif #if (PAD_LIST || CC_NV_Certify) (COMMAND_ATTRIBUTES)(CC_NV_Certify * // 0x0184 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+HANDLE_2_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+HANDLE_2_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_EventSequenceComplete) (COMMAND_ATTRIBUTES)(CC_EventSequenceComplete * // 0x0185 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+HANDLE_2_USER)), + (DECRYPT_2+HANDLE_1_USER+HANDLE_2_USER)), #endif #if (PAD_LIST || CC_HashSequenceStart) (COMMAND_ATTRIBUTES)(CC_HashSequenceStart * // 0x0186 - (IS_IMPLEMENTED+DECRYPT_2+R_HANDLE)), + (DECRYPT_2+R_HANDLE)), #endif #if (PAD_LIST || CC_PolicyPhysicalPresence) (COMMAND_ATTRIBUTES)(CC_PolicyPhysicalPresence * // 0x0187 - (IS_IMPLEMENTED+ALLOW_TRIAL)), + (ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_PolicyDuplicationSelect) (COMMAND_ATTRIBUTES)(CC_PolicyDuplicationSelect * // 0x0188 - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL)), + (DECRYPT_2+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_PolicyGetDigest) (COMMAND_ATTRIBUTES)(CC_PolicyGetDigest * // 0x0189 - (IS_IMPLEMENTED+ALLOW_TRIAL+ENCRYPT_2)), + (ALLOW_TRIAL+ENCRYPT_2)), #endif #if (PAD_LIST || CC_TestParms) (COMMAND_ATTRIBUTES)(CC_TestParms * // 0x018A - (IS_IMPLEMENTED)), + (0)), #endif #if (PAD_LIST || CC_Commit) (COMMAND_ATTRIBUTES)(CC_Commit * // 0x018B - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_PolicyPassword) (COMMAND_ATTRIBUTES)(CC_PolicyPassword * // 0x018C - (IS_IMPLEMENTED+ALLOW_TRIAL)), + (ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_ZGen_2Phase) (COMMAND_ATTRIBUTES)(CC_ZGen_2Phase * // 0x018D - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_EC_Ephemeral) (COMMAND_ATTRIBUTES)(CC_EC_Ephemeral * // 0x018E - (IS_IMPLEMENTED+ENCRYPT_2)), + (ENCRYPT_2)), #endif #if (PAD_LIST || CC_PolicyNvWritten) (COMMAND_ATTRIBUTES)(CC_PolicyNvWritten * // 0x018F - (IS_IMPLEMENTED+ALLOW_TRIAL)), + (ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_PolicyTemplate) (COMMAND_ATTRIBUTES)(CC_PolicyTemplate * // 0x0190 - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL)), + (DECRYPT_2+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_CreateLoaded) (COMMAND_ATTRIBUTES)(CC_CreateLoaded * // 0x0191 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+PP_COMMAND+ENCRYPT_2+R_HANDLE)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND+ENCRYPT_2+R_HANDLE)), #endif #if (PAD_LIST || CC_PolicyAuthorizeNV) (COMMAND_ATTRIBUTES)(CC_PolicyAuthorizeNV * // 0x0192 - (IS_IMPLEMENTED+HANDLE_1_USER+ALLOW_TRIAL)), + (HANDLE_1_USER+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_EncryptDecrypt2) (COMMAND_ATTRIBUTES)(CC_EncryptDecrypt2 * // 0x0193 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_AC_GetCapability) (COMMAND_ATTRIBUTES)(CC_AC_GetCapability * // 0x0194 - (IS_IMPLEMENTED)), + (0)), #endif #if (PAD_LIST || CC_AC_Send) (COMMAND_ATTRIBUTES)(CC_AC_Send * // 0x0195 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_DUP+HANDLE_2_USER)), + (DECRYPT_2+HANDLE_1_DUP+HANDLE_2_USER)), #endif #if (PAD_LIST || CC_Policy_AC_SendSelect) (COMMAND_ATTRIBUTES)(CC_Policy_AC_SendSelect * // 0x0196 - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL)), + (DECRYPT_2+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_CertifyX509) (COMMAND_ATTRIBUTES)(CC_CertifyX509 * // 0x0197 - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_ADMIN+HANDLE_2_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_ADMIN+HANDLE_2_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_ACT_SetTimeout) (COMMAND_ATTRIBUTES)(CC_ACT_SetTimeout * // 0x0198 - (IS_IMPLEMENTED+HANDLE_1_USER)), + (HANDLE_1_USER)), #endif #if (PAD_LIST || CC_ECC_Encrypt) (COMMAND_ATTRIBUTES)(CC_ECC_Encrypt * // 0x0199 - (IS_IMPLEMENTED+DECRYPT_2+ENCRYPT_2)), + (DECRYPT_2+ENCRYPT_2)), #endif #if (PAD_LIST || CC_ECC_Decrypt) (COMMAND_ATTRIBUTES)(CC_ECC_Decrypt * // 0x019A - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), #endif #if (PAD_LIST || CC_PolicyCapability) (COMMAND_ATTRIBUTES)(CC_PolicyCapability * // 0x019B - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL)), + (DECRYPT_2+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_PolicyParameters) (COMMAND_ATTRIBUTES)(CC_PolicyParameters * // 0x019C - (IS_IMPLEMENTED+DECRYPT_2+ALLOW_TRIAL)), + (DECRYPT_2+ALLOW_TRIAL)), #endif #if (PAD_LIST || CC_NV_DefineSpace2) (COMMAND_ATTRIBUTES)(CC_NV_DefineSpace2 * // 0x019D - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_NV_ReadPublic2) (COMMAND_ATTRIBUTES)(CC_NV_ReadPublic2 * // 0x019E - (IS_IMPLEMENTED+ENCRYPT_2)), + (ENCRYPT_2)), #endif #if (PAD_LIST || CC_SetCapability) (COMMAND_ATTRIBUTES)(CC_SetCapability * // 0x019F - (IS_IMPLEMENTED+DECRYPT_2+HANDLE_1_USER)), + (DECRYPT_2+HANDLE_1_USER)), #endif #if (PAD_LIST || CC_Vendor_TCG_Test) (COMMAND_ATTRIBUTES)(CC_Vendor_TCG_Test * // 0x0000 - (IS_IMPLEMENTED+DECRYPT_2+ENCRYPT_2)), + (DECRYPT_2+ENCRYPT_2)), #endif 0 }; diff --git a/src/tpm2/CommandAttributes.h b/src/tpm2/CommandAttributes.h index 71973a95b..7bcb31174 100644 --- a/src/tpm2/CommandAttributes.h +++ b/src/tpm2/CommandAttributes.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Command Attributes */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CommandAttributes.h 1594 2020-03-26 22:15:48Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2020 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmStructures; Version 4.4 Mar 26, 2019 @@ -74,21 +15,20 @@ #define COMMAND_ATTRIBUTES_H typedef UINT16 COMMAND_ATTRIBUTES; -#define NOT_IMPLEMENTED (COMMAND_ATTRIBUTES)(0) -#define ENCRYPT_2 ((COMMAND_ATTRIBUTES)1 << 0) -#define ENCRYPT_4 ((COMMAND_ATTRIBUTES)1 << 1) -#define DECRYPT_2 ((COMMAND_ATTRIBUTES)1 << 2) -#define DECRYPT_4 ((COMMAND_ATTRIBUTES)1 << 3) -#define HANDLE_1_USER ((COMMAND_ATTRIBUTES)1 << 4) -#define HANDLE_1_ADMIN ((COMMAND_ATTRIBUTES)1 << 5) -#define HANDLE_1_DUP ((COMMAND_ATTRIBUTES)1 << 6) -#define HANDLE_2_USER ((COMMAND_ATTRIBUTES)1 << 7) -#define PP_COMMAND ((COMMAND_ATTRIBUTES)1 << 8) -#define IS_IMPLEMENTED ((COMMAND_ATTRIBUTES)1 << 9) -#define NO_SESSIONS ((COMMAND_ATTRIBUTES)1 << 10) -#define NV_COMMAND ((COMMAND_ATTRIBUTES)1 << 11) -#define PP_REQUIRED ((COMMAND_ATTRIBUTES)1 << 12) -#define R_HANDLE ((COMMAND_ATTRIBUTES)1 << 13) -#define ALLOW_TRIAL ((COMMAND_ATTRIBUTES)1 << 14) +#define ENCRYPT_2 ((COMMAND_ATTRIBUTES)1 << 0) +#define ENCRYPT_4 ((COMMAND_ATTRIBUTES)1 << 1) +#define DECRYPT_2 ((COMMAND_ATTRIBUTES)1 << 2) +#define DECRYPT_4 ((COMMAND_ATTRIBUTES)1 << 3) +#define HANDLE_1_USER ((COMMAND_ATTRIBUTES)1 << 4) +#define HANDLE_1_ADMIN ((COMMAND_ATTRIBUTES)1 << 5) +#define HANDLE_1_DUP ((COMMAND_ATTRIBUTES)1 << 6) +#define HANDLE_2_USER ((COMMAND_ATTRIBUTES)1 << 7) +#define PP_COMMAND ((COMMAND_ATTRIBUTES)1 << 8) +// Bit 9 is reserved. (was IS_IMPLEMENTED) +#define NO_SESSIONS ((COMMAND_ATTRIBUTES)1 << 10) +#define NV_COMMAND ((COMMAND_ATTRIBUTES)1 << 11) +#define PP_REQUIRED ((COMMAND_ATTRIBUTES)1 << 12) +#define R_HANDLE ((COMMAND_ATTRIBUTES)1 << 13) +#define ALLOW_TRIAL ((COMMAND_ATTRIBUTES)1 << 14) #endif // COMMAND_ATTRIBUTES_H diff --git a/src/tpm2/CommandCodeAttributes.c b/src/tpm2/CommandCodeAttributes.c index fbba01f65..9cc6e911a 100644 --- a/src/tpm2/CommandCodeAttributes.c +++ b/src/tpm2/CommandCodeAttributes.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Functions for testing various command properties */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the functions for testing various command properties. @@ -84,7 +26,7 @@ typedef UINT16 ATTRIBUTE_TYPE; //** Command Attribute Functions -//*** NextImplementedIndex() +//*** NextImplementedIndex() // libtpms added begin // This function is used when the lists are not compressed. In a compressed list, // only the implemented commands are present. So, a search might find a value // but that value may not be implemented. This function checks to see if the input @@ -99,8 +41,7 @@ static COMMAND_INDEX NextImplementedIndex(COMMAND_INDEX commandIndex) { for(; commandIndex < COMMAND_COUNT; commandIndex++) { - if((s_commandAttributes[commandIndex] & IS_IMPLEMENTED) && // libtpms changed - RuntimeCommandsCheckEnabled(&g_RuntimeProfile.RuntimeCommands, // libtpms added begin + if(RuntimeCommandsCheckEnabled(&g_RuntimeProfile.RuntimeCommands, // libtpms added begin GET_ATTRIBUTE(s_ccAttr[commandIndex], TPMA_CC, commandIndex))) // libtpms added end return commandIndex; @@ -109,7 +50,7 @@ static COMMAND_INDEX NextImplementedIndex(COMMAND_INDEX commandIndex) } #else # define NextImplementedIndex(x) (x) -#endif +#endif // libtpms added end //*** GetClosestCommandIndex() // This function returns the command index for the command with a value that is @@ -221,11 +162,11 @@ GetClosestCommandIndex(TPM_CC commandCode // IN: the command code to start at // the lowest value (needs to be an index for an implemented command if(GET_ATTRIBUTE(s_ccAttr[0], TPMA_CC, commandIndex) >= searchIndex) { - return NextImplementedIndex(0); + return NextImplementedIndex(0); // libtpms changed } else { -#if COMPRESSED_LISTS +#if COMPRESSED_LISTS // libtpms added COMMAND_INDEX commandIndex = UNIMPLEMENTED_COMMAND_INDEX; COMMAND_INDEX min = 0; COMMAND_INDEX max = LIBRARY_COMMAND_ARRAY_SIZE - 1; @@ -262,13 +203,13 @@ GetClosestCommandIndex(TPM_CC commandCode // IN: the command code to start at // Note: this will necessarily be in range because of the earlier check // that the index was within range. return commandIndex + 1; -#else +#else // libtpms added begin // The list is not compressed so offset into the array by the command // code value of the first entry in the list. Then go find the first // implemented command. return NextImplementedIndex( - searchIndex - (COMMAND_INDEX)GET_ATTRIBUTE(s_ccAttr[0], TPMA_CC, commandIndex)); // libtpms changed -#endif + searchIndex - (COMMAND_INDEX)GET_ATTRIBUTE(s_ccAttr[0], TPMA_CC, commandIndex)); +#endif // libtpms added end } } @@ -286,23 +227,22 @@ CommandCodeToCommandIndex(TPM_CC commandCode // IN: the command code to look up COMMAND_INDEX searchIndex = (COMMAND_INDEX)commandCode; BOOL vendor = (commandCode & CC_VEND) != 0; COMMAND_INDEX commandIndex; -#if !COMPRESSED_LISTS +#if !COMPRESSED_LISTS // libtpms added begin if(!vendor) { - commandIndex = searchIndex - (COMMAND_INDEX)GET_ATTRIBUTE(s_ccAttr[0], TPMA_CC, commandIndex); // libtpms changed + commandIndex = searchIndex - (COMMAND_INDEX)GET_ATTRIBUTE(s_ccAttr[0], TPMA_CC, commandIndex); // Check for out of range or unimplemented. // Note, since a COMMAND_INDEX is unsigned, if searchIndex is smaller than // the lowest value of command, it will become a 'negative' number making // it look like a large unsigned number, this will cause it to fail // the unsigned check below. if(commandIndex >= LIBRARY_COMMAND_ARRAY_SIZE - || (s_commandAttributes[commandIndex] & IS_IMPLEMENTED) == 0 - || !RuntimeCommandsCheckEnabled(&g_RuntimeProfile.RuntimeCommands, // libtpms added - commandCode)) // libtpms added + || !RuntimeCommandsCheckEnabled(&g_RuntimeProfile.RuntimeCommands, + commandCode)) return UNIMPLEMENTED_COMMAND_INDEX; return commandIndex; } -#endif +#endif // libtpms added end // Need this code for any vendor code lookup or for compressed lists commandIndex = GetClosestCommandIndex(commandCode); @@ -336,10 +276,7 @@ GetNextCommandIndex(COMMAND_INDEX commandIndex // IN: the starting index GET_ATTRIBUTE(s_ccAttr[commandIndex], TPMA_CC, commandIndex))) continue; // libtpms added end -#if !COMPRESSED_LISTS - if(s_commandAttributes[commandIndex] & IS_IMPLEMENTED) -#endif - return commandIndex; + return commandIndex; } return UNIMPLEMENTED_COMMAND_INDEX; } @@ -534,15 +471,10 @@ CommandCapGetCCList(TPM_CC commandCode, // IN: start command code commandIndex != UNIMPLEMENTED_COMMAND_INDEX; commandIndex = GetNextCommandIndex(commandIndex)) { -#if !COMPRESSED_LISTS - // this check isn't needed for compressed lists. - if(!(s_commandAttributes[commandIndex] & IS_IMPLEMENTED)) - continue; -#endif - if (!RuntimeCommandsCheckEnabled(&g_RuntimeProfile.RuntimeCommands, // libtpms added begin + if (!RuntimeCommandsCheckEnabled(&g_RuntimeProfile.RuntimeCommands, // libtpms added begin GET_ATTRIBUTE(s_ccAttr[commandIndex], TPMA_CC, commandIndex))) - continue; // libtpms added end + continue; // libtpms added end if(commandList->count < count) { // If the list is not full, add the attributes for this command. diff --git a/src/tpm2/CommandDispatcher.c b/src/tpm2/CommandDispatcher.c index 435bbe601..f31c8bc57 100644 --- a/src/tpm2/CommandDispatcher.c +++ b/src/tpm2/CommandDispatcher.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Command Dispatcher */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CommandDispatcher.c 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2021 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //* Includes and Typedefs @@ -150,11 +91,11 @@ typedef struct COMMAND_DESCRIPTOR_t // The types list is constructed with a byte of 0xff at the end of the command // parameters and with an 0xff at the end of the response parameters. -# if COMPRESSED_LISTS +# if COMPRESSED_LISTS // libtpms added begin # define PAD_LIST 0 # else # define PAD_LIST 1 -# endif +# endif // libtpms added end # define _COMMAND_TABLE_DISPATCH_ # include "CommandDispatchData.h" diff --git a/src/tpm2/PP.c b/src/tpm2/PP.c index facdcfbb5..6c1840035 100644 --- a/src/tpm2/PP.c +++ b/src/tpm2/PP.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the functions that support the physical presence operations @@ -87,8 +29,7 @@ void PhysicalPresencePreInstall_Init(void) // Any command that is PP_REQUIRED should be SET for(commandIndex = 0; commandIndex < COMMAND_COUNT; commandIndex++) { - if(s_commandAttributes[commandIndex] & IS_IMPLEMENTED - && s_commandAttributes[commandIndex] & PP_REQUIRED) + if(s_commandAttributes[commandIndex] & PP_REQUIRED) SET_BIT(commandIndex, gp.ppList); } // Write PP list to NV diff --git a/src/tpm2/PropertyCap.c b/src/tpm2/PropertyCap.c index 817981d7a..f4e612338 100644 --- a/src/tpm2/PropertyCap.c +++ b/src/tpm2/PropertyCap.c @@ -284,8 +284,8 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property // vendor-defined commands, this will be the same as the // number of library commands. { -#if COMPRESSED_LISTS - (*value) = RuntimeCommandsCountEnabled(&g_RuntimeProfile.RuntimeCommands); // libtpms changed: was COMMAND_COUNT +#if COMPRESSED_LISTS // libtpms changed begin + (*value) = RuntimeCommandsCountEnabled(&g_RuntimeProfile.RuntimeCommands); // libtpms changed: was COMMAND_COUNT #else COMMAND_INDEX commandIndex; *value = 0; @@ -297,14 +297,14 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property { (*value)++; // count of all implemented } -#endif +#endif // libtpms changed end break; } case TPM_PT_LIBRARY_COMMANDS: // number of commands from the TPM library that are implemented { -#if COMPRESSED_LISTS - *value = RuntimeCommandsCountEnabled(&g_RuntimeProfile.RuntimeCommands); // libtpms changed: was LIBRARY_COMMAND_ARRAY_SIZE +#if COMPRESSED_LISTS // libtpms changed begin + *value = RuntimeCommandsCountEnabled(&g_RuntimeProfile.RuntimeCommands); // libtpms changed: was LIBRARY_COMMAND_ARRAY_SIZE #else COMMAND_INDEX commandIndex; *value = 0; @@ -316,7 +316,7 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property { (*value)++; } -#endif +#endif // libtpms changed end break; } case TPM_PT_VENDOR_COMMANDS: @@ -397,10 +397,8 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property if(g_prevOrderlyState != SU_NONE_VALUE) SET_ATTRIBUTE(flags.attr, TPMA_STARTUP_CLEAR, orderly); - // Note: For a LSb0 machine, the bits in a bit field are in the correct - // order even if the machine is MSB0. For a MSb0 machine, a TPMA will - // be an integer manipulated by masking (USE_BIT_FIELD_STRUCTURES will - // be NO) so the bits are manipulate correctly. + // A TPMA will be an integer manipulated by masking so the bits + // are manipulated correctly regardless of machine endianness. *value = flags.u32; break; } diff --git a/src/tpm2/TpmTypes.h b/src/tpm2/TpmTypes.h index 07b98db4e..12d812ab0 100644 --- a/src/tpm2/TpmTypes.h +++ b/src/tpm2/TpmTypes.h @@ -375,11 +375,11 @@ typedef UINT32 TPM_CC; // packed (only defined commands) or dense // (having entries for unimplemented commands). This overly large macro // computes the size of the array and sets some global constants -#if COMPRESSED_LISTS +#if COMPRESSED_LISTS // libtpms added begin # define ADD_FILL 0 #else # define ADD_FILL 1 -#endif +#endif // libtpms added end #define LIBRARY_COMMAND_ARRAY_SIZE \ (0 + (ADD_FILL || CC_NV_UndefineSpaceSpecial) /* 0x0000011F */ \ + (ADD_FILL || CC_EvictControl) /* 0x00000120 */ \ @@ -511,6 +511,10 @@ typedef UINT32 TPM_CC; + (ADD_FILL || CC_NV_ReadPublic2) /* 0x0000019E */ \ + (ADD_FILL || CC_SetCapability) /* 0x0000019F */ \ ) +#if LIBRARY_COMMAND_ARRAY_SIZE == 0 +# error "No commands are enabled -- something is terribly wrong." +#endif + #define VENDOR_COMMAND_ARRAY_SIZE (CC_Vendor_TCG_Test) #define COMMAND_COUNT (LIBRARY_COMMAND_ARRAY_SIZE + VENDOR_COMMAND_ARRAY_SIZE) diff --git a/src/tpm2/VerifyConfiguration.h b/src/tpm2/VerifyConfiguration.h index bac45fd2c..e1cc0799d 100644 --- a/src/tpm2/VerifyConfiguration.h +++ b/src/tpm2/VerifyConfiguration.h @@ -38,7 +38,7 @@ MUST_BE_0_OR_1(SKIP_PROOF_ERRORS); // Implementation alternatives - should not change external behavior MUST_BE_0_OR_1(TABLE_DRIVEN_DISPATCH); MUST_BE_0_OR_1(TABLE_DRIVEN_MARSHAL); -MUST_BE_0_OR_1(COMPRESSED_LISTS); +MUST_BE_0_OR_1(COMPRESSED_LISTS); // libtpms added MUST_BE_0_OR_1(RSA_KEY_SIEVE); // Implementation alternatives - changes external behavior From 9fa3ee52709b0be1f9ea5780ce9710718eefcc9b Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 22 Jul 2025 16:54:46 -0400 Subject: [PATCH 07/52] Sync: Remove TABLE_DRIVEN_DISPATCH build switch Remove the TABLE_DRIVEN_DISPATCH build switch that was set to 'YES'. Remove code that assumed it to be set to 'NO'. Signed-off-by: Stefan Berger --- src/tpm2/CommandDispatcher.c | 82 +++++----------------------------- src/tpm2/TpmBuildSwitches.h | 4 -- src/tpm2/VerifyConfiguration.h | 1 - 3 files changed, 12 insertions(+), 75 deletions(-) diff --git a/src/tpm2/CommandDispatcher.c b/src/tpm2/CommandDispatcher.c index f31c8bc57..de11158f5 100644 --- a/src/tpm2/CommandDispatcher.c +++ b/src/tpm2/CommandDispatcher.c @@ -5,8 +5,6 @@ #include "Tpm.h" #include "Marshal.h" -#if TABLE_DRIVEN_DISPATCH || TABLE_DRIVEN_MARSHAL - typedef TPM_RC(NoFlagFunction)(void* target, BYTE** buffer, INT32* size); typedef TPM_RC(FlagFunction)(void* target, BYTE** buffer, INT32* size, BOOL flag); @@ -96,18 +94,8 @@ typedef struct COMMAND_DESCRIPTOR_t # else # define PAD_LIST 1 # endif // libtpms added end -# define _COMMAND_TABLE_DISPATCH_ -# include "CommandDispatchData.h" - -# define TEST_COMMAND TPM_CC_Startup - -# define NEW_CC - -#else - -# include "Commands.h" - -#endif +#define _COMMAND_TABLE_DISPATCH_ +#include "CommandDispatchData.h" //* Marshal/Unmarshal Functions @@ -116,8 +104,7 @@ typedef struct COMMAND_DESCRIPTOR_t TPM_RC ParseHandleBuffer(COMMAND* command) { - TPM_RC result; -#if TABLE_DRIVEN_DISPATCH || TABLE_DRIVEN_MARSHAL + TPM_RC result; COMMAND_DESCRIPTOR_t* desc; BYTE* types; BYTE type; @@ -133,8 +120,6 @@ ParseHandleBuffer(COMMAND* command) // Get the associated list of unmarshaling data types. types = &((BYTE*)desc)[desc->typesOffset]; - // if(s_ccAttr[commandIndex].commandIndex == TEST_COMMAND) - // commandIndex = commandIndex; // No handles yet command->handleNum = 0; @@ -146,7 +131,7 @@ ParseHandleBuffer(COMMAND* command) // get the next type type = *types++) { -# if TABLE_DRIVEN_MARSHAL +#if TABLE_DRIVEN_MARSHAL marshalIndex_t index; index = unmarshalArray[dType] | ((type & 0x80) ? NULL_FLAG : 0); result = Unmarshal(index, @@ -154,7 +139,7 @@ ParseHandleBuffer(COMMAND* command) &command->parameterBuffer, &command->parameterSize); -# else +#else // See if unmarshaling of this handle type requires a flag if(dType < HANDLE_FIRST_FLAG_TYPE) { @@ -176,7 +161,7 @@ ParseHandleBuffer(COMMAND* command) &command->parameterSize, (type & 0x80) != 0); } -# endif +#endif // Got a handle // We do this first so that the match for the handle offset of the @@ -187,21 +172,6 @@ ParseHandleBuffer(COMMAND* command) // handle indication set return result + TPM_RC_H + (command->handleNum * TPM_RC_1); } -#else - BYTE** handleBufferStart = &command->parameterBuffer; - INT32* bufferRemainingSize = &command->parameterSize; - TPM_HANDLE* handles = &command->handles[0]; - UINT32* handleCount = &command->handleNum; - *handleCount = 0; - switch(command->code) - { -# include "HandleProcess.h" -# undef handles - default: - FAIL(FATAL_ERROR_INTERNAL); - break; - } -#endif return TPM_RC_SUCCESS; } @@ -211,33 +181,6 @@ ParseHandleBuffer(COMMAND* command) TPM_RC CommandDispatcher(COMMAND* command) { -#if !TABLE_DRIVEN_DISPATCH || TABLE_DRIVEN_MARSHAL - TPM_RC result; - BYTE** paramBuffer = &command->parameterBuffer; - INT32* paramBufferSize = &command->parameterSize; - BYTE** responseBuffer = &command->responseBuffer; - INT32* respParmSize = &command->parameterSize; - INT32 rSize; - TPM_HANDLE* handles = &command->handles[0]; - // - command->handleNum = 0; // The command-specific code knows how - // many handles there are. This is for - // cataloging the number of response - // handles - MemoryIoBufferAllocationReset(); // Initialize so that allocation will - // work properly - switch(GetCommandCode(command->index)) - { -# include "CommandDispatcher.h" - - default: - FAIL(FATAL_ERROR_INTERNAL); - break; - } -Exit: - MemoryIoBufferZero(); - return result; -#else COMMAND_DESCRIPTOR_t* desc; BYTE* types; BYTE type; @@ -307,7 +250,7 @@ CommandDispatcher(COMMAND* command) for(; (dType = (type & 0x7F)) <= PARAMETER_LAST_TYPE; type = *types++) { pNum++; -# if TABLE_DRIVEN_MARSHAL +#if TABLE_DRIVEN_MARSHAL { marshalIndex_t index = unmarshalArray[dType]; index |= (type & 0x80) ? NULL_FLAG : 0; @@ -316,7 +259,7 @@ CommandDispatcher(COMMAND* command) &command->parameterBuffer, &command->parameterSize); } -# else +#else if(dType < PARAMETER_FIRST_FLAG_TYPE) { NoFlagFunction* f = (NoFlagFunction*)unmarshalArray[dType]; @@ -332,7 +275,7 @@ CommandDispatcher(COMMAND* command) &command->parameterSize, (type & 0x80) != 0); } -# endif +#endif if(result != TPM_RC_SUCCESS) { result += TPM_RC_P + (TPM_RC_1 * pNum); @@ -405,21 +348,20 @@ CommandDispatcher(COMMAND* command) for(; (dType = (type & 0x7F)) <= RESPONSE_PARAMETER_LAST_TYPE && !g_inFailureMode; type = *types++) { -# if TABLE_DRIVEN_MARSHAL +#if TABLE_DRIVEN_MARSHAL marshalIndex_t index = marshalArray[dType]; command->parameterSize += Marshal( index, &commandOut[offset], &command->responseBuffer, &maxOutSize); -# else +#else const MARSHAL_t f = marshalArray[dType]; command->parameterSize += f(&commandOut[offset], &command->responseBuffer, &maxOutSize); -# endif +#endif offset = *offsets++; } result = (maxOutSize < 0) ? TPM_RC_FAILURE : TPM_RC_SUCCESS; Exit: MemoryIoBufferZero(); return result; -#endif } diff --git a/src/tpm2/TpmBuildSwitches.h b/src/tpm2/TpmBuildSwitches.h index dc3ffaed4..664596e19 100644 --- a/src/tpm2/TpmBuildSwitches.h +++ b/src/tpm2/TpmBuildSwitches.h @@ -146,10 +146,6 @@ // Implementation alternatives - don't change external behavior //////////////////////////////////////////////////////////////// -// Define TABLE_DRIVEN_DISPATCH to use tables rather than case statements -// for command dispatch and handle unmarshaling -#define TABLE_DRIVEN_DISPATCH YES - // This define is used to enable the new table-driven marshaling code. #define TABLE_DRIVEN_MARSHAL NO diff --git a/src/tpm2/VerifyConfiguration.h b/src/tpm2/VerifyConfiguration.h index e1cc0799d..83129bd5e 100644 --- a/src/tpm2/VerifyConfiguration.h +++ b/src/tpm2/VerifyConfiguration.h @@ -36,7 +36,6 @@ MUST_BE_0_OR_1(USE_SPEC_COMPLIANT_PROOFS); MUST_BE_0_OR_1(SKIP_PROOF_ERRORS); // Implementation alternatives - should not change external behavior -MUST_BE_0_OR_1(TABLE_DRIVEN_DISPATCH); MUST_BE_0_OR_1(TABLE_DRIVEN_MARSHAL); MUST_BE_0_OR_1(COMPRESSED_LISTS); // libtpms added MUST_BE_0_OR_1(RSA_KEY_SIEVE); From bcc973c0a27d87141ba537ccb4a09bf37e15869e Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 6 Aug 2025 11:47:14 -0400 Subject: [PATCH 08/52] Sync: Sync on white space changes Resolve only white space changes on a previously applied patch resolving a CVE where my version looked slightly different. Signed-off-by: Stefan Berger --- src/tpm2/CryptUtil.c | 70 +++++++++++++++-------------- src/tpm2/crypto/CryptHash_fp.h | 4 +- src/tpm2/crypto/CryptUtil_fp.h | 3 +- src/tpm2/crypto/openssl/CryptHash.c | 4 +- 4 files changed, 43 insertions(+), 38 deletions(-) diff --git a/src/tpm2/CryptUtil.c b/src/tpm2/CryptUtil.c index 3775b23f4..0d483345a 100644 --- a/src/tpm2/CryptUtil.c +++ b/src/tpm2/CryptUtil.c @@ -73,8 +73,8 @@ //****************************************************************************/ //*** CryptHmacSign() -// Sign a digest using an HMAC key. This an HMAC of a digest, not an HMAC of a -// message. +// Sign a digest using an HMAC key. This is an HMAC of a digest, not an HMAC of +// a message. // Return Type: TPM_RC // TPM_RC_HASH not a valid hash static TPM_RC CryptHmacSign(TPMT_SIGNATURE* signature, // OUT: signature @@ -92,11 +92,11 @@ static TPM_RC CryptHmacSign(TPMT_SIGNATURE* signature, // OUT: signature g_RuntimeProfile.stateFormatLevel)) return TPM_RC_KEY_SIZE; // libtpms added end - if (signature->sigAlg == TPM_ALG_HMAC) + if(signature->sigAlg == TPM_ALG_HMAC) { - digestSize = CryptHmacStart2B(&hmacState, - signature->signature.any.hashAlg, - &signKey->sensitive.sensitive.bits.b); + digestSize = CryptHmacStart2B(&hmacState, + signature->signature.any.hashAlg, + &signKey->sensitive.sensitive.bits.b); CryptDigestUpdate2B(&hmacState.hashState, &hashData->b); CryptHmacEnd(&hmacState, digestSize, (BYTE*)&signature->signature.hmac.digest); return TPM_RC_SUCCESS; @@ -1316,7 +1316,8 @@ BOOL CryptIsSplitSign(TPM_ALG_ID scheme // IN: the algorithm selector } //*** CryptIsAsymSignScheme() -// This function indicates if a scheme algorithm is a sign algorithm. +// This function indicates if a scheme algorithm is a sign algorithm valid for the +// public key type. BOOL CryptIsAsymSignScheme(TPMI_ALG_PUBLIC publicType, // IN: Type of the object TPMI_ALG_ASYM_SCHEME scheme // IN: the scheme ) @@ -1380,7 +1381,7 @@ BOOL CryptIsAsymSignScheme(TPMI_ALG_PUBLIC publicType, // IN: Type of the // that the scheme signing algorithm is compatible with the signing object type // and that the scheme specifies a valid hash algorithm. static BOOL CryptIsValidSignScheme(TPMI_ALG_PUBLIC publicType, // IN: Type of the object - TPMT_SIG_SCHEME* scheme // IN: the signing scheme + TPMT_SIG_SCHEME* scheme // IN: the signing scheme ) { BOOL isValidSignScheme = TRUE; @@ -1388,27 +1389,27 @@ static BOOL CryptIsValidSignScheme(TPMI_ALG_PUBLIC publicType, // IN: Type of switch(publicType) { #if ALG_RSA - case TPM_ALG_RSA: - isValidSignScheme = CryptIsAsymSignScheme(publicType, scheme->scheme); - break; + case TPM_ALG_RSA: + isValidSignScheme = CryptIsAsymSignScheme(publicType, scheme->scheme); + break; #endif // ALG_RSA #if ALG_ECC - case TPM_ALG_ECC: - isValidSignScheme = CryptIsAsymSignScheme(publicType, scheme->scheme); - break; + case TPM_ALG_ECC: + isValidSignScheme = CryptIsAsymSignScheme(publicType, scheme->scheme); + break; #endif // ALG_ECC - case TPM_ALG_KEYEDHASH: - if(scheme->scheme != TPM_ALG_HMAC) - { - isValidSignScheme = FALSE; - } - break; + case TPM_ALG_KEYEDHASH: + if(scheme->scheme != TPM_ALG_HMAC) + { + isValidSignScheme = FALSE; + } + break; - default: - isValidSignScheme = FALSE; - break; + default: + isValidSignScheme = FALSE; + break; } // Ensure that a valid hash algorithm is specified. Pass 'flag' = FALSE to @@ -1422,7 +1423,7 @@ static BOOL CryptIsValidSignScheme(TPMI_ALG_PUBLIC publicType, // IN: Type of // hash algorithm IDs are the same for all signature scheme types.) if(!CryptHashIsValidAlg(scheme->details.any.hashAlg, /* flag = */ FALSE)) { - isValidSignScheme = FALSE; + isValidSignScheme = FALSE; } return isValidSignScheme; @@ -1483,12 +1484,14 @@ BOOL CryptIsAsymDecryptScheme(TPMI_ALG_PUBLIC publicType, // IN: Type of the ob //*** CryptSelectSignScheme() // This function is used by the attestation and signing commands. It implements -// the rules for selecting the signature scheme to use in signing. This function -// requires that the signing key either be TPM_RH_NULL or be loaded. +// the rules for selecting the signature scheme to use in signing and validates +// that the selected scheme is compatible with the key type. It also ensures +// the selected scheme specifies a valid hash algorithm. This function requires +// that the signing key either be TPM_RH_NULL or be loaded. // // If a default scheme is defined in object, the default scheme should be chosen, // otherwise, the input scheme should be chosen. -// In the case that both object and input scheme has a non-NULL scheme +// In the case that both object and input scheme have a non-NULL scheme // algorithm, if the schemes are compatible, the input scheme will be chosen. // // This function should not be called if 'signObject->publicArea.type' == @@ -1499,7 +1502,9 @@ BOOL CryptIsAsymDecryptScheme(TPMI_ALG_PUBLIC publicType, // IN: Type of the ob // FALSE(0) both 'scheme' and key's default scheme are empty; or // 'scheme' is empty while key's default scheme requires // explicit input scheme (split signing); or -// non-empty default key scheme differs from 'scheme' +// non-empty default key scheme differs from 'scheme'; or +// 'scheme' not valid for key type; or invalid hash +// algorithm specified; or key type is ALG_SYMCIPHER BOOL CryptSelectSignScheme(OBJECT* signObject, // IN: signing key TPMT_SIG_SCHEME* scheme // IN/OUT: signing scheme ) @@ -1524,13 +1529,13 @@ BOOL CryptSelectSignScheme(OBJECT* signObject, // IN: signing key // Get a pointer to the scheme object. if(CryptIsAsymAlgorithm(publicArea->type)) { - objectScheme = - (TPMT_SIG_SCHEME*)&publicArea->parameters.asymDetail.scheme; + objectScheme = + (TPMT_SIG_SCHEME*)&publicArea->parameters.asymDetail.scheme; } else if(publicArea->type == TPM_ALG_KEYEDHASH) { objectScheme = - (TPMT_SIG_SCHEME*)&publicArea->parameters.keyedHashDetail.scheme; + (TPMT_SIG_SCHEME*)&publicArea->parameters.keyedHashDetail.scheme; } else { @@ -1546,8 +1551,6 @@ BOOL CryptSelectSignScheme(OBJECT* signObject, // IN: signing key { // Input and default can't both be NULL OK = (scheme->scheme != TPM_ALG_NULL); - // Assume that the scheme is compatible with the key. If not, - // an error will be generated in the signing operation. } else if(scheme->scheme == TPM_ALG_NULL) { @@ -1582,6 +1585,7 @@ BOOL CryptSelectSignScheme(OBJECT* signObject, // IN: signing key // valid hash algorithm specified. OK = CryptIsValidSignScheme(publicArea->type, scheme); } + } return OK; } diff --git a/src/tpm2/crypto/CryptHash_fp.h b/src/tpm2/crypto/CryptHash_fp.h index 2a7f33ea4..8c9d890a1 100644 --- a/src/tpm2/crypto/CryptHash_fp.h +++ b/src/tpm2/crypto/CryptHash_fp.h @@ -89,9 +89,9 @@ CryptGetHashDef(TPM_ALG_ID hashAlg); // Return Type: BOOL // TRUE(1) hashAlg is a valid, implemented hash on this TPM // FALSE(0) hashAlg is not valid for this TPM -BOOL CryptHashIsValidAlg(TPM_ALG_ID hashAlg, // IN: the algorithm to check +BOOL CryptHashIsValidAlg(TPM_ALG_ID hashAlg, // IN: the algorithm to check BOOL isAlgNullValid // IN: TRUE if TPM_ALG_NULL is to be treated - // as a valid hash + // as a valid hash ); //*** CryptHashGetAlgByIndex() diff --git a/src/tpm2/crypto/CryptUtil_fp.h b/src/tpm2/crypto/CryptUtil_fp.h index 24063b81d..1c7d0edf9 100644 --- a/src/tpm2/crypto/CryptUtil_fp.h +++ b/src/tpm2/crypto/CryptUtil_fp.h @@ -296,7 +296,8 @@ BOOL CryptIsSplitSign(TPM_ALG_ID scheme // IN: the algorithm selector ); //*** CryptIsAsymSignScheme() -// This function indicates if a scheme algorithm is a sign algorithm. +// This function indicates if a scheme algorithm is a sign algorithm valid for the +// public key type. BOOL CryptIsAsymSignScheme(TPMI_ALG_PUBLIC publicType, // IN: Type of the object TPMI_ALG_ASYM_SCHEME scheme // IN: the scheme ); diff --git a/src/tpm2/crypto/openssl/CryptHash.c b/src/tpm2/crypto/openssl/CryptHash.c index 13e5099f9..5c746053e 100644 --- a/src/tpm2/crypto/openssl/CryptHash.c +++ b/src/tpm2/crypto/openssl/CryptHash.c @@ -137,9 +137,9 @@ CryptGetHashDef(TPM_ALG_ID hashAlg) // Return Type: BOOL // TRUE(1) hashAlg is a valid, implemented hash on this TPM // FALSE(0) hashAlg is not valid for this TPM -BOOL CryptHashIsValidAlg(TPM_ALG_ID hashAlg, // IN: the algorithm to check +BOOL CryptHashIsValidAlg(TPM_ALG_ID hashAlg, // IN: the algorithm to check BOOL isAlgNullValid // IN: TRUE if TPM_ALG_NULL is to be treated - // as a valid hash + // as a valid hash ) { if(hashAlg == TPM_ALG_NULL) From 761ac799846515b94fb2c92472aa750ca7038597 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 22 Jul 2025 17:57:12 -0400 Subject: [PATCH 09/52] Sync: Introduce ReadOnlyControl command but do not activate it Signed-off-by: Stefan Berger --- src/Makefile.am | 2 + src/tpm2/CommandAttributeData.h | 69 ++++++++------- src/tpm2/CommandAttributes.h | 1 + src/tpm2/CommandCodeAttributes.c | 8 ++ src/tpm2/CommandCodeAttributes_fp.h | 63 +------------ src/tpm2/CommandDispatchData.h | 97 ++++++++------------ src/tpm2/EACommands.c | 7 ++ src/tpm2/ExecCommand.c | 71 +++------------ src/tpm2/Global.h | 69 +++------------ src/tpm2/Hierarchy.c | 65 ++------------ src/tpm2/NVCommands.c | 30 +++++++ src/tpm2/NV_spt.c | 133 ++++++++++++++-------------- src/tpm2/NV_spt_fp.h | 84 ++++++------------ src/tpm2/PropertyCap.c | 7 +- src/tpm2/ReadOnlyControl.c | 31 +++++++ src/tpm2/ReadOnlyControl_fp.h | 24 +++++ src/tpm2/RuntimeCommands.c | 3 +- src/tpm2/TpmProfile_CommandList.h | 61 +------------ src/tpm2/TpmTypes.h | 72 ++------------- 19 files changed, 321 insertions(+), 576 deletions(-) create mode 100644 src/tpm2/ReadOnlyControl.c create mode 100644 src/tpm2/ReadOnlyControl_fp.h diff --git a/src/Makefile.am b/src/Makefile.am index cfabb746b..0824436ac 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -256,6 +256,7 @@ libtpms_tpm2_la_SOURCES = \ tpm2/PrimeData.c \ tpm2/PropertyCap.c \ tpm2/RandomCommands.c \ + tpm2/ReadOnlyControl.c \ tpm2/Response.c \ tpm2/ResponseCodeProcessing.c \ tpm2/RunCommand.c \ @@ -496,6 +497,7 @@ noinst_HEADERS += \ tpm2/PropertyCap_fp.h \ tpm2/Quote_fp.h \ tpm2/ReadClock_fp.h \ + tpm2/ReadOnlyControl_fp.h \ tpm2/ReadPublic_fp.h \ tpm2/ResponseCodeProcessing_fp.h \ tpm2/Response_fp.h \ diff --git a/src/tpm2/CommandAttributeData.h b/src/tpm2/CommandAttributeData.h index 968cf8232..6b5fd00d8 100644 --- a/src/tpm2/CommandAttributeData.h +++ b/src/tpm2/CommandAttributeData.h @@ -406,6 +406,9 @@ const TPMA_CC s_ccAttr [] = { #if (PAD_LIST || CC_SetCapability) TPMA_CC_INITIALIZER(0x019F, 0, 1, 0, 0, 1, 0, 0, 0), #endif +#if (PAD_LIST || CC_ReadOnlyControl) + TPMA_CC_INITIALIZER(0x01A0, 0, 1, 0, 0, 1, 0, 0, 0), +#endif #if (PAD_LIST || CC_Vendor_TCG_Test) TPMA_CC_INITIALIZER(0x0000, 0, 0, 0, 0, 0, 0, 1, 0), #endif @@ -417,82 +420,82 @@ const TPMA_CC s_ccAttr [] = { const COMMAND_ATTRIBUTES s_commandAttributes [] = { #if (PAD_LIST || CC_NV_UndefineSpaceSpecial) (COMMAND_ATTRIBUTES)(CC_NV_UndefineSpaceSpecial * // 0x011F - (HANDLE_1_ADMIN+HANDLE_2_USER+PP_COMMAND)), + (HANDLE_1_ADMIN+HANDLE_2_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_EvictControl) (COMMAND_ATTRIBUTES)(CC_EvictControl * // 0x0120 - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_HierarchyControl) (COMMAND_ATTRIBUTES)(CC_HierarchyControl * // 0x0121 - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_NV_UndefineSpace) (COMMAND_ATTRIBUTES)(CC_NV_UndefineSpace * // 0x0122 - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST) (COMMAND_ATTRIBUTES)(0), // 0x0123 #endif #if (PAD_LIST || CC_ChangeEPS) (COMMAND_ATTRIBUTES)(CC_ChangeEPS * // 0x0124 - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_ChangePPS) (COMMAND_ATTRIBUTES)(CC_ChangePPS * // 0x0125 - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_Clear) (COMMAND_ATTRIBUTES)(CC_Clear * // 0x0126 - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_ClearControl) (COMMAND_ATTRIBUTES)(CC_ClearControl * // 0x0127 - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_ClockSet) (COMMAND_ATTRIBUTES)(CC_ClockSet * // 0x0128 - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_HierarchyChangeAuth) (COMMAND_ATTRIBUTES)(CC_HierarchyChangeAuth * // 0x0129 - (DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_NV_DefineSpace) (COMMAND_ATTRIBUTES)(CC_NV_DefineSpace * // 0x012A - (DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_PCR_Allocate) (COMMAND_ATTRIBUTES)(CC_PCR_Allocate * // 0x012B - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_PCR_SetAuthPolicy) (COMMAND_ATTRIBUTES)(CC_PCR_SetAuthPolicy * // 0x012C - (DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_PP_Commands) (COMMAND_ATTRIBUTES)(CC_PP_Commands * // 0x012D - (HANDLE_1_USER+PP_REQUIRED)), + (HANDLE_1_USER+PP_REQUIRED+RO_DISALLOW)), #endif #if (PAD_LIST || CC_SetPrimaryPolicy) (COMMAND_ATTRIBUTES)(CC_SetPrimaryPolicy * // 0x012E - (DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_FieldUpgradeStart) (COMMAND_ATTRIBUTES)(CC_FieldUpgradeStart * // 0x012F - (DECRYPT_2+HANDLE_1_ADMIN+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_ADMIN+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_ClockRateAdjust) (COMMAND_ATTRIBUTES)(CC_ClockRateAdjust * // 0x0130 - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_CreatePrimary) (COMMAND_ATTRIBUTES)(CC_CreatePrimary * // 0x0131 - (DECRYPT_2+HANDLE_1_USER+PP_COMMAND+ENCRYPT_2+R_HANDLE)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND+ENCRYPT_2+R_HANDLE+RO_DISALLOW)), #endif #if (PAD_LIST || CC_NV_GlobalWriteLock) (COMMAND_ATTRIBUTES)(CC_NV_GlobalWriteLock * // 0x0132 - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_GetCommandAuditDigest) (COMMAND_ATTRIBUTES)(CC_GetCommandAuditDigest * // 0x0133 @@ -500,7 +503,7 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { #endif #if (PAD_LIST || CC_NV_Increment) (COMMAND_ATTRIBUTES)(CC_NV_Increment * // 0x0134 - (HANDLE_1_USER)), + (HANDLE_1_USER+RO_DISALLOW)), #endif #if (PAD_LIST || CC_NV_SetBits) (COMMAND_ATTRIBUTES)(CC_NV_SetBits * // 0x0135 @@ -524,11 +527,11 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { #endif #if (PAD_LIST || CC_DictionaryAttackParameters) (COMMAND_ATTRIBUTES)(CC_DictionaryAttackParameters * // 0x013A - (HANDLE_1_USER)), + (HANDLE_1_USER+RO_DISALLOW)), #endif #if (PAD_LIST || CC_NV_ChangeAuth) (COMMAND_ATTRIBUTES)(CC_NV_ChangeAuth * // 0x013B - (DECRYPT_2+HANDLE_1_ADMIN)), + (DECRYPT_2+HANDLE_1_ADMIN+RO_DISALLOW)), #endif #if (PAD_LIST || CC_PCR_Event) (COMMAND_ATTRIBUTES)(CC_PCR_Event * // 0x013C @@ -544,15 +547,15 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { #endif #if (PAD_LIST || CC_SetAlgorithmSet) (COMMAND_ATTRIBUTES)(CC_SetAlgorithmSet * // 0x013F - (HANDLE_1_USER)), + (HANDLE_1_USER+RO_DISALLOW)), #endif #if (PAD_LIST || CC_SetCommandCodeAuditStatus) (COMMAND_ATTRIBUTES)(CC_SetCommandCodeAuditStatus * // 0x0140 - (HANDLE_1_USER+PP_COMMAND)), + (HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_FieldUpgradeData) (COMMAND_ATTRIBUTES)(CC_FieldUpgradeData * // 0x0141 - (DECRYPT_2)), + (DECRYPT_2+RO_DISALLOW)), #endif #if (PAD_LIST || CC_IncrementalSelfTest) (COMMAND_ATTRIBUTES)(CC_IncrementalSelfTest * // 0x0142 @@ -612,7 +615,7 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { #endif #if (PAD_LIST || CC_ObjectChangeAuth) (COMMAND_ATTRIBUTES)(CC_ObjectChangeAuth * // 0x0150 - (DECRYPT_2+HANDLE_1_ADMIN+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_ADMIN+ENCRYPT_2+RO_DISALLOW)), #endif #if (PAD_LIST || CC_PolicySecret) (COMMAND_ATTRIBUTES)(CC_PolicySecret * // 0x0151 @@ -624,7 +627,7 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { #endif #if (PAD_LIST || CC_Create) (COMMAND_ATTRIBUTES)(CC_Create * // 0x0153 - (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2)), + (DECRYPT_2+HANDLE_1_USER+ENCRYPT_2+RO_DISALLOW)), #endif #if (PAD_LIST || CC_ECDH_ZGen) (COMMAND_ATTRIBUTES)(CC_ECDH_ZGen * // 0x0154 @@ -812,7 +815,7 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { #endif #if (PAD_LIST || CC_PCR_SetAuthValue) (COMMAND_ATTRIBUTES)(CC_PCR_SetAuthValue * // 0x0183 - (DECRYPT_2+HANDLE_1_USER)), + (DECRYPT_2+HANDLE_1_USER+RO_DISALLOW)), #endif #if (PAD_LIST || CC_NV_Certify) (COMMAND_ATTRIBUTES)(CC_NV_Certify * // 0x0184 @@ -868,7 +871,7 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { #endif #if (PAD_LIST || CC_CreateLoaded) (COMMAND_ATTRIBUTES)(CC_CreateLoaded * // 0x0191 - (DECRYPT_2+HANDLE_1_USER+PP_COMMAND+ENCRYPT_2+R_HANDLE)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND+ENCRYPT_2+R_HANDLE+RO_DISALLOW)), #endif #if (PAD_LIST || CC_PolicyAuthorizeNV) (COMMAND_ATTRIBUTES)(CC_PolicyAuthorizeNV * // 0x0192 @@ -916,7 +919,7 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { #endif #if (PAD_LIST || CC_NV_DefineSpace2) (COMMAND_ATTRIBUTES)(CC_NV_DefineSpace2 * // 0x019D - (DECRYPT_2+HANDLE_1_USER+PP_COMMAND)), + (DECRYPT_2+HANDLE_1_USER+PP_COMMAND+RO_DISALLOW)), #endif #if (PAD_LIST || CC_NV_ReadPublic2) (COMMAND_ATTRIBUTES)(CC_NV_ReadPublic2 * // 0x019E @@ -924,7 +927,11 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { #endif #if (PAD_LIST || CC_SetCapability) (COMMAND_ATTRIBUTES)(CC_SetCapability * // 0x019F - (DECRYPT_2+HANDLE_1_USER)), + (DECRYPT_2+HANDLE_1_USER+RO_DISALLOW)), +#endif +#if (PAD_LIST || CC_ReadOnlyControl) + (COMMAND_ATTRIBUTES)(CC_ReadOnlyControl * // 0x01A0 + (HANDLE_1_USER+PP_COMMAND)), #endif #if (PAD_LIST || CC_Vendor_TCG_Test) (COMMAND_ATTRIBUTES)(CC_Vendor_TCG_Test * // 0x0000 diff --git a/src/tpm2/CommandAttributes.h b/src/tpm2/CommandAttributes.h index 7bcb31174..33d0af841 100644 --- a/src/tpm2/CommandAttributes.h +++ b/src/tpm2/CommandAttributes.h @@ -30,5 +30,6 @@ typedef UINT16 COMMAND_ATTRIBUTES; #define PP_REQUIRED ((COMMAND_ATTRIBUTES)1 << 12) #define R_HANDLE ((COMMAND_ATTRIBUTES)1 << 13) #define ALLOW_TRIAL ((COMMAND_ATTRIBUTES)1 << 14) +#define RO_DISALLOW (((COMMAND_ATTRIBUTES)1 << 15) * CC_ReadOnlyControl) #endif // COMMAND_ATTRIBUTES_H diff --git a/src/tpm2/CommandCodeAttributes.c b/src/tpm2/CommandCodeAttributes.c index 9cc6e911a..6dfc0a023 100644 --- a/src/tpm2/CommandCodeAttributes.c +++ b/src/tpm2/CommandCodeAttributes.c @@ -379,6 +379,14 @@ BOOL IsHandleInResponse(COMMAND_INDEX commandIndex) return ((s_commandAttributes[commandIndex] & R_HANDLE) != 0); } + +//*** IsDisallowedInReadOnlyMode() +// This function determines if a command is disallowed when operating in Read-Only mode +BOOL IsDisallowedInReadOnlyMode(COMMAND_INDEX commandIndex) +{ + return ((s_commandAttributes[commandIndex] & RO_DISALLOW) != 0); +} + //*** IsWriteOperation() // Checks to see if an operation will write to an NV Index and is subject to being // blocked by read-lock diff --git a/src/tpm2/CommandCodeAttributes_fp.h b/src/tpm2/CommandCodeAttributes_fp.h index de5d8def2..38e499a6b 100644 --- a/src/tpm2/CommandCodeAttributes_fp.h +++ b/src/tpm2/CommandCodeAttributes_fp.h @@ -1,62 +1,3 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -151,6 +92,10 @@ BOOL IsSessionAllowed(COMMAND_INDEX commandIndex // IN: the command to be check // This function determines if a command has a handle in the response BOOL IsHandleInResponse(COMMAND_INDEX commandIndex); +//*** IsDisallowedInReadOnlyMode() +// This function determines if a command is disallowed when operating in Read-Only mode +BOOL IsDisallowedInReadOnlyMode(COMMAND_INDEX commandIndex); + //*** IsWriteOperation() // Checks to see if an operation will write to an NV Index and is subject to being // blocked by read-lock diff --git a/src/tpm2/CommandDispatchData.h b/src/tpm2/CommandDispatchData.h index a236ffaf9..e0a6b0278 100644 --- a/src/tpm2/CommandDispatchData.h +++ b/src/tpm2/CommandDispatchData.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Command DIspatch Data */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT @@ -5061,6 +5003,40 @@ SetCapability_COMMAND_DESCRIPTOR_t _SetCapabilityData = { #define _SetCapabilityDataAddress 0 #endif // CC_SetCapability +#if CC_ReadOnlyControl +#include "ReadOnlyControl_fp.h" + +typedef TPM_RC (ReadOnlyControl_Entry)( + ReadOnlyControl_In* in +); + +typedef const struct +{ + ReadOnlyControl_Entry *entry; + UINT16 inSize; + UINT16 outSize; + UINT16 offsetOfTypes; + UINT16 paramOffsets[1]; + BYTE types[4]; +} ReadOnlyControl_COMMAND_DESCRIPTOR_t; + +ReadOnlyControl_COMMAND_DESCRIPTOR_t _ReadOnlyControlData = { + /* entry */ &TPM2_ReadOnlyControl, + /* inSize */ (UINT16)(sizeof(ReadOnlyControl_In)), + /* outSize */ 0, + /* offsetOfTypes */ offsetof(ReadOnlyControl_COMMAND_DESCRIPTOR_t, types), + /* offsets */ {(UINT16)(offsetof(ReadOnlyControl_In, state))}, + /* types */ {TPMI_RH_PLATFORM_H_UNMARSHAL, + TPMI_YES_NO_P_UNMARSHAL, + END_OF_LIST, + END_OF_LIST} +}; + +#define _ReadOnlyControlDataAddress (&_ReadOnlyControlData) +#else +#define _ReadOnlyControlDataAddress 0 +#endif // CC_ReadOnlyControl + #if CC_AC_Send #include "AC_Send_fp.h" @@ -5620,6 +5596,9 @@ COMMAND_DESCRIPTOR_t* s_CommandDataArray[] = { #if (PAD_LIST || CC_SetCapability) (COMMAND_DESCRIPTOR_t*)_SetCapabilityDataAddress, #endif // CC_SetCapability +#if (PAD_LIST || CC_ReadControl) + (COMMAND_DESCRIPTOR_t*)_ReadOnlyControlDataAddress, +#endif // CC_ReadOnlyControl #if (PAD_LIST || CC_Vendor_TCG_Test) (COMMAND_DESCRIPTOR_t*)_Vendor_TCG_TestDataAddress, #endif // CC_Vendor_TCG_Test diff --git a/src/tpm2/EACommands.c b/src/tpm2/EACommands.c index 44eb88cf8..b313d73bc 100644 --- a/src/tpm2/EACommands.c +++ b/src/tpm2/EACommands.c @@ -244,6 +244,13 @@ TPM2_PolicySecret(PolicySecret_In* in, // IN: input parameter list SESSION* session; TPM2B_NAME entityName; UINT64 authTimeout = 0; + +# if CC_ReadOnlyControl + // Don't allow on PIN PASS or PIN FAIL indices when in Read-Only mode + if(gc.readOnly && NvIsPinCountedIndex(in->authHandle)) + return TPM_RC_READ_ONLY; +# endif // CC_ReadOnlyControl + // Input Validation // Get pointer to the session structure session = SessionGet(in->policySession); diff --git a/src/tpm2/ExecCommand.c b/src/tpm2/ExecCommand.c index 069f3e3a1..670384565 100644 --- a/src/tpm2/ExecCommand.c +++ b/src/tpm2/ExecCommand.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* ExecCommand */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // @@ -212,6 +154,17 @@ LIB_EXPORT void ExecuteCommand( result = TPM_RC_COMMAND_CODE; goto Cleanup; } +#if CC_ReadOnlyControl + // Check if the TPM is operating in Read-Only mode. If so, reject commands + // that are disallowed in this mode before performing any further auth checks. + // The execution of some commands may still be disallowed under certain conditions, + // but those will be evaluated in the corresponding command implementation. + if(gc.readOnly && IsDisallowedInReadOnlyMode(command.index)) + { + result = TPM_RC_READ_ONLY; + goto Cleanup; + } +#endif #if FIELD_UPGRADE_IMPLEMENTED == YES // If the TPM is in FUM, then the only allowed command is // TPM_CC_FieldUpgradeData. diff --git a/src/tpm2/Global.h b/src/tpm2/Global.h index b9b2a35d9..015e0d399 100644 --- a/src/tpm2/Global.h +++ b/src/tpm2/Global.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Internal Global Type Definitions */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description @@ -1068,6 +1010,15 @@ typedef struct state_clear_data BYTE reserved[STATE_CLEAR_DATA_PADDING]; # endif #endif // libtpms added + +#if CC_ReadOnlyControl +#error Need Marshaling/Unmarshaling support + //***************************************************************************** + // Read-Only Control + //***************************************************************************** + BOOL readOnly; // default reset is CLEAR +#endif + } STATE_CLEAR_DATA; EXTERN STATE_CLEAR_DATA gc; diff --git a/src/tpm2/Hierarchy.c b/src/tpm2/Hierarchy.c index 22328c72b..3c786381c 100644 --- a/src/tpm2/Hierarchy.c +++ b/src/tpm2/Hierarchy.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Managing and accessing the hierarchy-related values */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the functions used for managing and accessing the @@ -176,6 +118,11 @@ BOOL HierarchyStartup(STARTUP_TYPE type // IN: start up type // enable the storage and endorsement hierarchies and the platformNV gc.shEnable = gc.ehEnable = gc.phEnableNV = TRUE; + +#if CC_ReadOnlyControl + // clear read-only mode + gc.readOnly = FALSE; +#endif } // nullProof and nullSeed are updated at every TPM_RESET diff --git a/src/tpm2/NVCommands.c b/src/tpm2/NVCommands.c index 528924a44..bd5690b88 100644 --- a/src/tpm2/NVCommands.c +++ b/src/tpm2/NVCommands.c @@ -181,6 +181,12 @@ TPM2_NV_Write( TPMA_NV attributes = nvIndex->publicArea.attributes; TPM_RC result; // Input Validation + + // Common Read-Only mode check. May return TPM_RC_READ_ONLY + result = NvReadOnlyModeChecks(attributes); + if(result != TPM_RC_SUCCESS) + return result; + // Common access checks, NvWriteAccessCheck() may return TPM_RC_NV_AUTHORIZATION // or TPM_RC_NV_LOCKED result = NvWriteAccessChecks(in->authHandle, @@ -281,6 +287,12 @@ TPM2_NV_Extend( TPM2B_DIGEST newDigest; HASH_STATE hashState; // Input Validation + + // Common Read-Only mode check. May return TPM_RC_READ_ONLY + result = NvReadOnlyModeChecks(nvIndex->publicArea.attributes); + if(result != TPM_RC_SUCCESS) + return result; + // Common access checks, NvWriteAccessCheck() may return TPM_RC_NV_AUTHORIZATION // or TPM_RC_NV_LOCKED result = NvWriteAccessChecks(in->authHandle, @@ -330,6 +342,12 @@ TPM2_NV_SetBits( UINT64 oldValue; UINT64 newValue; // Input Validation + + // Common Read-Only mode check. May return TPM_RC_READ_ONLY + result = NvReadOnlyModeChecks(nvIndex->publicArea.attributes); + if(result != TPM_RC_SUCCESS) + return result; + // Common access checks, NvWriteAccessCheck() may return TPM_RC_NV_AUTHORIZATION // or TPM_RC_NV_LOCKED result = NvWriteAccessChecks(in->authHandle, @@ -365,6 +383,12 @@ TPM2_NV_WriteLock( NV_INDEX *nvIndex = NvGetIndexInfo(in->nvIndex, &locator); TPMA_NV nvAttributes = nvIndex->publicArea.attributes; // Input Validation: + + // Common Read-Only mode check. May return TPM_RC_READ_ONLY + result = NvReadOnlyModeChecks(nvIndex->publicArea.attributes); + if(result != TPM_RC_SUCCESS) + return result; + // Common access checks, NvWriteAccessCheck() may return TPM_RC_NV_AUTHORIZATION // or TPM_RC_NV_LOCKED result = NvWriteAccessChecks(in->authHandle, in->nvIndex, nvAttributes); @@ -464,6 +488,12 @@ TPM2_NV_ReadLock( NV_INDEX *nvIndex = NvGetIndexInfo(in->nvIndex, &locator); TPMA_NV nvAttributes = nvIndex->publicArea.attributes; // Input Validation + + // Common Read-Only mode check. May return TPM_RC_READ_ONLY + result = NvReadOnlyModeChecks(nvIndex->publicArea.attributes); + if(result != TPM_RC_SUCCESS) + return result; + // Common read access checks. NvReadAccessChecks() may return // TPM_RC_NV_AUTHORIZATION, TPM_RC_NV_LOCKED, or TPM_RC_NV_UNINITIALIZED result = NvReadAccessChecks(in->authHandle, diff --git a/src/tpm2/NV_spt.c b/src/tpm2/NV_spt.c index ab217a49c..8d34b1772 100644 --- a/src/tpm2/NV_spt.c +++ b/src/tpm2/NV_spt.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 -2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes #include "Tpm.h" @@ -154,6 +96,34 @@ NvWriteAccessChecks( return TPM_RC_SUCCESS; } +//*** NvReadOnlyModeChecks() +// Common routine to verify whether an NV command is allowed on an index +// with the given 'attributes' while the TPM is in Read-Only mode +// Used by TPM2_NV_Write, TPM2_NV_Extend, TPM2_SetBits, TPM2_NV_WriteLock +// and TPM2_NV_ReadLock +// Return Type: TPM_RC +// TPM_RC_SUCCESS The command is allowed +// TPM_RC_READ_ONLY The TPM is in Read-Only mode and the command is +// not allowed +// +TPM_RC +NvReadOnlyModeChecks( + TPMA_NV attributes // IN: the attributes of the index to check +) +{ + +# if CC_ReadOnlyControl + // When in Read-Only mode only allow the commands listed above on an + // index with the ORDERLY and CLEAR_STCLEAR attributes set + if(gc.readOnly && + !(IS_ATTRIBUTE(attributes, TPMA_NV, ORDERLY) && + IS_ATTRIBUTE(attributes, TPMA_NV, CLEAR_STCLEAR))) + return TPM_RC_READ_ONLY; +# endif // CC_ReadOnlyControl + + return TPM_RC_SUCCESS; +} + //*** NvClearOrderly() // This function is used to cause gp.orderlyState to be cleared to the // non-orderly state. @@ -166,6 +136,29 @@ NvClearOrderly(void) return TPM_RC_SUCCESS; } +//*** GetIndexAttributesByHandle() +// Function to return the TPMA_NV attributes of an index given a handle +// On success 'attributes' is set to receive the result +// Return Type: BOOL +// TRUE(1) 'index' is found +// FALSE(0) 'index' is not found or not an NV index handle +static BOOL GetIndexAttributesByHandle( + TPM_HANDLE index, // IN: index handle + TPMA_NV* attributes // OUT: index attributes +) +{ + if(HandleGetType(index) == TPM_HT_NV_INDEX) + { + NV_INDEX* nvIndex = NvGetIndexInfo(index, NULL); + if(nvIndex != NULL) + { + *attributes = nvIndex->publicArea.attributes; + return TRUE; + } + } + return FALSE; +} + //*** NvIsPinPassIndex() // Function to check to see if an NV index is a PIN Pass Index // Return Type: BOOL @@ -174,13 +167,23 @@ NvClearOrderly(void) BOOL NvIsPinPassIndex(TPM_HANDLE index // IN: Handle to check ) { - if(HandleGetType(index) == TPM_HT_NV_INDEX) - { - NV_INDEX* nvIndex = NvGetIndexInfo(index, NULL); + TPMA_NV attributes; + return GetIndexAttributesByHandle(index, &attributes) && + IsNvPinPassIndex(attributes); +} - return IsNvPinPassIndex(nvIndex->publicArea.attributes); - } - return FALSE; +//*** NvIsPinCountedIndex() +// Function to check to see if an NV index is either a PIN Pass +// or a PIN FAIL Index +// Return Type: BOOL +// TRUE(1) is pin pass or pin fail +// FALSE(0) is neither pin pass nor pin fail +BOOL NvIsPinCountedIndex(TPM_HANDLE index // IN: Handle to check +) +{ + TPMA_NV attributes; + return GetIndexAttributesByHandle(index, &attributes) && + (IsNvPinPassIndex(attributes) || IsNvPinFailIndex(attributes)); } //*** NvGetIndexName() diff --git a/src/tpm2/NV_spt_fp.h b/src/tpm2/NV_spt_fp.h index bd134b58f..201cd2cee 100644 --- a/src/tpm2/NV_spt_fp.h +++ b/src/tpm2/NV_spt_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -97,6 +39,21 @@ NvWriteAccessChecks( TPMA_NV attributes // IN: the attributes of 'nvHandle' ); +//*** NvReadOnlyModeChecks() +// Common routine to verify whether an NV command is allowed on an index +// with the given 'attributes' while the TPM is in Read-Only mode +// Used by TPM2_NV_Write, TPM2_NV_Extend, TPM2_SetBits, TPM2_NV_WriteLock +// and TPM2_NV_ReadLock +// Return Type: TPM_RC +// TPM_RC_SUCCESS The command is allowed +// TPM_RC_READ_ONLY The TPM is in Read-Only mode and the command is +// not allowed +// +TPM_RC +NvReadOnlyModeChecks( + TPMA_NV attributes // IN: the attributes of the index to check +); + //*** NvClearOrderly() // This function is used to cause gp.orderlyState to be cleared to the // non-orderly state. @@ -111,6 +68,15 @@ NvClearOrderly(void); BOOL NvIsPinPassIndex(TPM_HANDLE index // IN: Handle to check ); +//*** NvIsPinCountedIndex() +// Function to check to see if an NV index is either a PIN Pass +// or a PIN FAIL Index +// Return Type: BOOL +// TRUE(1) is pin pass or pin fail +// FALSE(0) is neither pin pass nor pin fail +BOOL NvIsPinCountedIndex(TPM_HANDLE index // IN: Handle to check +); + //*** NvGetIndexName() // This function computes the Name of an index // The 'name' buffer receives the bytes of the Name and the return value diff --git a/src/tpm2/PropertyCap.c b/src/tpm2/PropertyCap.c index f4e612338..f9e401307 100644 --- a/src/tpm2/PropertyCap.c +++ b/src/tpm2/PropertyCap.c @@ -280,9 +280,6 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property break; case TPM_PT_TOTAL_COMMANDS: // total number of commands implemented in the TPM - // Since the reference implementation does not have any - // vendor-defined commands, this will be the same as the - // number of library commands. { #if COMPRESSED_LISTS // libtpms changed begin (*value) = RuntimeCommandsCountEnabled(&g_RuntimeProfile.RuntimeCommands); // libtpms changed: was COMMAND_COUNT @@ -394,6 +391,10 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property SET_ATTRIBUTE(flags.attr, TPMA_STARTUP_CLEAR, ehEnable); if(gc.phEnableNV) SET_ATTRIBUTE(flags.attr, TPMA_STARTUP_CLEAR, phEnableNV); +#if CC_ReadOnlyControl + if(gc.readOnly) + SET_ATTRIBUTE(flags.attr, TPMA_STARTUP_CLEAR, readOnly); +#endif if(g_prevOrderlyState != SU_NONE_VALUE) SET_ATTRIBUTE(flags.attr, TPMA_STARTUP_CLEAR, orderly); diff --git a/src/tpm2/ReadOnlyControl.c b/src/tpm2/ReadOnlyControl.c new file mode 100644 index 000000000..9daa9f0e6 --- /dev/null +++ b/src/tpm2/ReadOnlyControl.c @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "ReadOnlyControl_fp.h" + +#if CC_ReadOnlyControl // Conditional expansion of this file + +/*(See part 3 specification) +// Enable or disable read-only mode of operation +*/ +TPM_RC +TPM2_ReadOnlyControl(ReadOnlyControl_In* in // IN: input parameter list +) +{ + if(in->state != gc.readOnly) + { + // Before changing the internal state, make sure that NV is available. + // Only need to update NV if changing the orderly state + RETURN_IF_ORDERLY; + + // modify the read-only state + gc.readOnly = in->state; + + // orderly state should be cleared because of the update to state clear data + // This gets processed in ExecuteCommand() on the way out. + g_clearOrderly = TRUE; + } + return TPM_RC_SUCCESS; +} + +#endif // CC_ReadOnlyControl diff --git a/src/tpm2/ReadOnlyControl_fp.h b/src/tpm2/ReadOnlyControl_fp.h new file mode 100644 index 000000000..2204f45f6 --- /dev/null +++ b/src/tpm2/ReadOnlyControl_fp.h @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: BSD-2-Clause + + +#if CC_ReadOnlyControl // Command must be enabled + +# ifndef _TPM_INCLUDE_PRIVATE_PROTOTYPES_READONLYCONTROL_FP_H_ +# define _TPM_INCLUDE_PRIVATE_PROTOTYPES_READONLYCONTROL_FP_H_ + +// Input structure definition +typedef struct +{ + TPMI_RH_PLATFORM authHandle; + TPMI_YES_NO state; +} ReadOnlyControl_In; + +// Response code modifiers +# define ReadOnlyControl_authHandle (TPM_RC_H + TPM_RC_1) +# define ReadOnlyControl_state (TPM_RC_P + TPM_RC_1) + +// Function prototype +TPM_RC TPM2_ReadOnlyControl(ReadOnlyControl_In* in); + +# endif // _TPM_INCLUDE_PRIVATE_PROTOTYPES_READONLYCONTROL_FP_H_ +#endif // CC_ReadOnlyControl diff --git a/src/tpm2/RuntimeCommands.c b/src/tpm2/RuntimeCommands.c index 6e2b01747..06adde148 100644 --- a/src/tpm2/RuntimeCommands.c +++ b/src/tpm2/RuntimeCommands.c @@ -191,10 +191,11 @@ static const struct { COMMAND(NV_DefineSpace2, true, 0), // not supported COMMAND(NV_ReadPublic2, true, 0), // not supported COMMAND(SetCapability, true, 0), // not supported + COMMAND(ReadOnlyControl, true, 0), // not supported /* all new commands added here MUST have CAN_BE_DISABLE = true */ #undef COMMAND }; -MUST_BE(TPM_CC_LAST == TPM_CC_SetCapability); /* force update of above list when new commands added */ +MUST_BE(TPM_CC_LAST == TPM_CC_ReadOnlyControl); /* force update of above list when new commands added */ static void RuntimeCommandsEnableAllCommands(struct RuntimeCommands *RuntimeCommands, diff --git a/src/tpm2/TpmProfile_CommandList.h b/src/tpm2/TpmProfile_CommandList.h index ec9ce200c..ad7a619a4 100644 --- a/src/tpm2/TpmProfile_CommandList.h +++ b/src/tpm2/TpmProfile_CommandList.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // this file defines the desired command list that should be built into the @@ -221,5 +163,6 @@ #define CC_NV_DefineSpace2 CC_NO /* libtpms: NO */ #define CC_NV_ReadPublic2 CC_NO /* libtpms: NO */ #define CC_SetCapability CC_NO /* libtpms: NO */ +#define CC_ReadOnlyControl CC_NO /* libtpms: NO */ #endif // _TPM_PROFILE_COMMAND_LIST_H_ diff --git a/src/tpm2/TpmTypes.h b/src/tpm2/TpmTypes.h index 12d812ab0..8632e251a 100644 --- a/src/tpm2/TpmTypes.h +++ b/src/tpm2/TpmTypes.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM Part 2 Headers */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT @@ -361,7 +303,8 @@ typedef UINT32 TPM_CC; #define TPM_CC_NV_DefineSpace2 (TPM_CC)(0x0000019D) #define TPM_CC_NV_ReadPublic2 (TPM_CC)(0x0000019E) #define TPM_CC_SetCapability (TPM_CC)(0x0000019F) -#define TPM_CC_LAST (TPM_CC)(0x0000019F) +#define TPM_CC_ReadOnlyControl (TPM_CC)(0x000001A0) +#define TPM_CC_LAST (TPM_CC)(0x000001A0) #define CC_VEND (TPM_CC)(0x20000000) #define TPM_CC_Vendor_TCG_Test (TPM_CC)(0x20000000) @@ -510,6 +453,7 @@ typedef UINT32 TPM_CC; + (ADD_FILL || CC_NV_DefineSpace2) /* 0x0000019D */ \ + (ADD_FILL || CC_NV_ReadPublic2) /* 0x0000019E */ \ + (ADD_FILL || CC_SetCapability) /* 0x0000019F */ \ + + (ADD_FILL || CC_ReadOnlyControl) /* 0x000001A0 */ \ ) #if LIBRARY_COMMAND_ARRAY_SIZE == 0 # error "No commands are enabled -- something is terribly wrong." @@ -558,6 +502,7 @@ typedef UINT32 TPM_RC; #define TPM_RC_NEEDS_TEST (TPM_RC)(RC_VER1 + 0x053) #define TPM_RC_NO_RESULT (TPM_RC)(RC_VER1 + 0x054) #define TPM_RC_SENSITIVE (TPM_RC)(RC_VER1 + 0x055) +#define TPM_RC_READ_ONLY (TPM_RC)(RC_VER1 + 0x056) #define RC_MAX_FM0 (TPM_RC)(RC_VER1 + 0x07F) #define RC_FMT1 (TPM_RC)(0x080) #define TPM_RC_ASYMMETRIC (TPM_RC)(RC_FMT1 + 0x001) @@ -1050,7 +995,7 @@ typedef UINT32 TPMA_OBJECT; #define TPMA_OBJECT_decrypt (TPMA_OBJECT)(1 << 17) #define TPMA_OBJECT_sign (TPMA_OBJECT)(1 << 18) #define TPMA_OBJECT_x509sign (TPMA_OBJECT)(1 << 19) -#define TPMA_OBJECT_reserved ((TPMA_OBJECT)0xfff0f009) // libtpms added +#define TPMA_OBJECT_reserved ((TPMA_OBJECT)0xfff0f009) // libtpms added // Table "Definition of TPMA_SESSION Bits" (Part 2: Structures) #define TYPE_OF_TPMA_SESSION UINT8 @@ -1161,13 +1106,14 @@ typedef UINT32 TPMA_STARTUP_CLEAR; #define TPMA_STARTUP_CLEAR_shEnable (TPMA_STARTUP_CLEAR)(1 << 1) #define TPMA_STARTUP_CLEAR_ehEnable (TPMA_STARTUP_CLEAR)(1 << 2) #define TPMA_STARTUP_CLEAR_phEnableNV (TPMA_STARTUP_CLEAR)(1 << 3) +#define TPMA_STARTUP_CLEAR_readOnly (TPMA_STARTUP_CLEAR)(1 << 4) #define TPMA_STARTUP_CLEAR_orderly (TPMA_STARTUP_CLEAR)((UINT32)1 << 31) // libtpms changed: UBSAN // This is the initializer for a TPMA_STARTUP_CLEAR bit array. #define TPMA_STARTUP_CLEAR_INITIALIZER( \ - phenable, shenable, ehenable, phenablenv, bits_at_4, orderly) \ + phenable, shenable, ehenable, phenablenv, readonly, bits_at_5, orderly) \ (TPMA_STARTUP_CLEAR)((phenable << 0) + (shenable << 1) + (ehenable << 2) \ - + (phenablenv << 3) + ((UINT32)orderly << 31)) // libtpms changed: UBSAN + + (phenablenv << 3) + (readonly << 4) + ((UINT32)orderly << 31)) // libtpms changed: UBSAN // Table "Definition of TPMA_MEMORY Bits" (Part 2: Structures) #define TYPE_OF_TPMA_MEMORY UINT32 From 917bd6702e275f8e5c6e34284e6571e66f791372 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 22 Jul 2025 22:50:32 -0400 Subject: [PATCH 10/52] Sync: Introduce PolicyTransportSPDM command but do not activate it Signed-off-by: Stefan Berger --- src/Makefile.am | 4 + src/tpm2/Capabilities.h | 65 ++------------ src/tpm2/CapabilityCommands.c | 15 ++++ src/tpm2/CommandAttributeData.h | 7 ++ src/tpm2/CommandDispatchData.h | 39 +++++++++ src/tpm2/Global.h | 28 +++++- src/tpm2/InternalRoutines.h | 64 +------------- src/tpm2/Marshal.c | 87 +++++++++++++++++++ src/tpm2/Marshal_fp.h | 16 ++++ src/tpm2/PolicyTransportSPDM.c | 139 ++++++++++++++++++++++++++++++ src/tpm2/PolicyTransportSPDM_fp.h | 26 ++++++ src/tpm2/RuntimeCommands.c | 3 +- src/tpm2/SecChannel.c | 108 +++++++++++++++++++++++ src/tpm2/SecChannel_fp.h | 38 ++++++++ src/tpm2/SessionProcess.c | 82 ++++++++++++++++++ src/tpm2/SessionProcess_fp.h | 11 +++ src/tpm2/TpmProfile_CommandList.h | 1 + src/tpm2/TpmProfile_Common.h | 65 ++------------ src/tpm2/TpmTypes.h | 117 ++++++++++++++++--------- src/tpm2/Unmarshal.c | 4 + 20 files changed, 697 insertions(+), 222 deletions(-) create mode 100644 src/tpm2/PolicyTransportSPDM.c create mode 100644 src/tpm2/PolicyTransportSPDM_fp.h create mode 100644 src/tpm2/SecChannel.c create mode 100644 src/tpm2/SecChannel_fp.h diff --git a/src/Makefile.am b/src/Makefile.am index 0824436ac..4a7099d37 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -249,6 +249,7 @@ libtpms_tpm2_la_SOURCES = \ tpm2/PlatformData.c \ tpm2/PlatformPcr.c \ tpm2/Policy_spt.c \ + tpm2/PolicyTransportSPDM.c \ tpm2/Power.c \ tpm2/PowerPlat.c \ tpm2/PP.c \ @@ -260,6 +261,7 @@ libtpms_tpm2_la_SOURCES = \ tpm2/Response.c \ tpm2/ResponseCodeProcessing.c \ tpm2/RunCommand.c \ + tpm2/SecChannel.c \ tpm2/Session.c \ tpm2/SessionCommands.c \ tpm2/SessionProcess.c \ @@ -490,6 +492,7 @@ noinst_HEADERS += \ tpm2/Policy_spt_fp.h \ tpm2/PolicyTemplate_fp.h \ tpm2/PolicyTicket_fp.h \ + tpm2/PolicyTransportSPDM_fp.h \ tpm2/Power_fp.h \ tpm2/PP_Commands_fp.h \ tpm2/PP_fp.h \ @@ -505,6 +508,7 @@ noinst_HEADERS += \ tpm2/RsaTestData.h \ tpm2/RSA_Decrypt_fp.h \ tpm2/RSA_Encrypt_fp.h \ + tpm2/SecChannel_fp.h \ tpm2/SelfTest.h \ tpm2/SelfTest_fp.h \ tpm2/SequenceComplete_fp.h \ diff --git a/src/tpm2/Capabilities.h b/src/tpm2/Capabilities.h index 572f40fea..192117f4c 100644 --- a/src/tpm2/Capabilities.h +++ b/src/tpm2/Capabilities.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Number of capability values that will fit into the largest data buffer */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Capabilities.h 1519 2019-11-15 20:43:51Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _CAPABILITIES_H #define _CAPABILITIES_H @@ -72,5 +13,9 @@ #define MAX_TAGGED_POLICIES (MAX_CAP_DATA / sizeof(TPMS_TAGGED_POLICY)) #define MAX_ACT_DATA (MAX_CAP_DATA / sizeof(TPMS_ACT_DATA)) #define MAX_AC_CAPABILITIES (MAX_CAP_DATA / sizeof(TPMS_AC_OUTPUT)) +#if SEC_CHANNEL_SUPPORT +# define MAX_PUB_KEYS (MAX_CAP_DATA / sizeof(TPM2B_PUBLIC)) +# define MAX_SPDM_SESS_INFO (MAX_CAP_DATA / sizeof(TPMS_SPDM_SESSION_INFO)) +#endif // SEC_CHANNEL_SUPPORT #endif diff --git a/src/tpm2/CapabilityCommands.c b/src/tpm2/CapabilityCommands.c index 0ea86ea27..a4af06655 100644 --- a/src/tpm2/CapabilityCommands.c +++ b/src/tpm2/CapabilityCommands.c @@ -187,6 +187,21 @@ TPM2_GetCapability( in->propertyCount, &data->actData); break; +# if SEC_CHANNEL_SUPPORT + case TPM_CAP_PUB_KEYS: + // This reference implementation supports only a single TPM SPDM public key + if((TPM_PUB_KEY)in->property != TPM_PUB_KEY_TPM_SPDM_00) + return TPM_RCS_VALUE + RC_GetCapability_property; + out->moreData = SpdmCapGetTpmPubKeys( + (TPM_PUB_KEY)in->property, in->propertyCount, &data->pubKeys); + break; + case TPM_CAP_SPDM_SESSION_INFO: + // Input property must be 0 + if(in->property != 0) + return TPM_RCS_VALUE + RC_GetCapability_property; + out->moreData = SpdmCapGetSessionInfo(&data->spdmSessionInfo); + break; +# endif // SEC_CHANNEL_SUPPORT case TPM_CAP_VENDOR_PROPERTY: // vendor property is not implemented default: diff --git a/src/tpm2/CommandAttributeData.h b/src/tpm2/CommandAttributeData.h index 6b5fd00d8..e4dd122f4 100644 --- a/src/tpm2/CommandAttributeData.h +++ b/src/tpm2/CommandAttributeData.h @@ -409,6 +409,9 @@ const TPMA_CC s_ccAttr [] = { #if (PAD_LIST || CC_ReadOnlyControl) TPMA_CC_INITIALIZER(0x01A0, 0, 1, 0, 0, 1, 0, 0, 0), #endif +#if (PAD_LIST || CC_PolicyTransportSPDM) + TPMA_CC_INITIALIZER(0x01A1, 0, 0, 0, 0, 1, 0, 0, 0), +#endif #if (PAD_LIST || CC_Vendor_TCG_Test) TPMA_CC_INITIALIZER(0x0000, 0, 0, 0, 0, 0, 0, 1, 0), #endif @@ -933,6 +936,10 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { (COMMAND_ATTRIBUTES)(CC_ReadOnlyControl * // 0x01A0 (HANDLE_1_USER+PP_COMMAND)), #endif +#if (PAD_LIST || CC_PolicyTransportSPDM) + (COMMAND_ATTRIBUTES)(CC_PolicyTransportSPDM * // 0x01A1 + (DECRYPT_2+ALLOW_TRIAL)), +#endif #if (PAD_LIST || CC_Vendor_TCG_Test) (COMMAND_ATTRIBUTES)(CC_Vendor_TCG_Test * // 0x0000 (DECRYPT_2+ENCRYPT_2)), diff --git a/src/tpm2/CommandDispatchData.h b/src/tpm2/CommandDispatchData.h index e0a6b0278..ac52c8e05 100644 --- a/src/tpm2/CommandDispatchData.h +++ b/src/tpm2/CommandDispatchData.h @@ -3507,6 +3507,42 @@ PolicyParameters_COMMAND_DESCRIPTOR_t _PolicyParametersData = { #define _PolicyParametersDataAddress 0 #endif // CC_PolicyParameters +#if CC_PolicyTransportSPDM +#include "PolicyTransportSPDM_fp.h" + +typedef TPM_RC (PolicyTransportSPDM_Entry)( + PolicyTransportSPDM_In* in +); + +typedef const struct +{ + PolicyTransportSPDM_Entry *entry; + UINT16 inSize; + UINT16 outSize; + UINT16 offsetOfTypes; + UINT16 paramOffsets[2]; + BYTE types[5]; +} PolicyTransportSPDM_COMMAND_DESCRIPTOR_t; + +PolicyTransportSPDM_COMMAND_DESCRIPTOR_t _PolicyTransportSPDMData = { + /* entry */ &TPM2_PolicyTransportSPDM, + /* inSize */ (UINT16)(sizeof(PolicyTransportSPDM_In)), + /* outSize */ 0, + /* offsetOfTypes */ offsetof(PolicyTransportSPDM_COMMAND_DESCRIPTOR_t, types), + /* offsets */ {(UINT16)(offsetof(PolicyTransportSPDM_In, reqKeyName)), + (UINT16)(offsetof(PolicyTransportSPDM_In, tpmKeyName))}, + /* types */ {TPMI_SH_POLICY_H_UNMARSHAL, + TPM2B_NAME_P_UNMARSHAL, + TPM2B_NAME_P_UNMARSHAL, + END_OF_LIST, + END_OF_LIST} +}; + +#define _PolicyTransportSPDMDataAddress (&_PolicyTransportSPDMData) +#else +#define _PolicyTransportSPDMDataAddress 0 +#endif // CC_PolicyTransportSPDM + #if CC_CreatePrimary #include "CreatePrimary_fp.h" @@ -5599,6 +5635,9 @@ COMMAND_DESCRIPTOR_t* s_CommandDataArray[] = { #if (PAD_LIST || CC_ReadControl) (COMMAND_DESCRIPTOR_t*)_ReadOnlyControlDataAddress, #endif // CC_ReadOnlyControl +#if (PAD_LIST || CC_PolicyTransportSPDM) + (COMMAND_DESCRIPTOR_t*)_PolicyTransportSPDMDataAddress, +#endif // CC_PolicyTransportSPDM #if (PAD_LIST || CC_Vendor_TCG_Test) (COMMAND_DESCRIPTOR_t*)_Vendor_TCG_TestDataAddress, #endif // CC_Vendor_TCG_Test diff --git a/src/tpm2/Global.h b/src/tpm2/Global.h index 015e0d399..2af88dff7 100644 --- a/src/tpm2/Global.h +++ b/src/tpm2/Global.h @@ -137,7 +137,7 @@ typedef struct #endif // libtpms added unsigned occupied : 1; //15) SET when the slot is occupied. unsigned derivation : 1; //16) SET when the key is a derivation - // parent + // parent unsigned external : 1; //17) SET when the object is loaded with // TPM2_LoadExternal(); unsigned reserved : 14; //18-31) /* libtpms added */ @@ -340,10 +340,26 @@ typedef struct SESSION_ATTRIBUTES // SET if the pHash has been defined. This attribute is not SET unless // 'isPolicy' is SET. unsigned isParametersHashDefined : 1; /* libtpms added: for rev180; @stateFormatLevel 4 */ - unsigned _reserved : 16; //17-32 /* libtpms added */ +# if SEC_CHANNEL_SUPPORT || 1 + // SET if the presence of a secure channel needs to be checked when the policy + // is used for authorization. + unsigned checkSecureChannel : 1; + // SET if the requester secure channel key needs to be checked when the policy + // is used for authorization. This attribute is only SET if checkSecureChannel + // is SET. + unsigned checkReqKey : 1; + // SET if the TPM secure channel key needs to be checked when the policy + // is used for authorization. This attribute is only SET if checkSecureChannel + // is SET. + unsigned checkTpmKey : 1; +# endif // SEC_CHANNEL_SUPPORT + unsigned _reserved : 13; //17-32 /* libtpms added */ #endif /* libtpms added */ #if BIG_ENDIAN_TPM == YES /* libtpms added begin */ - unsigned _reserved : 16; //17-32 + unsigned _reserved : 13; //17-32 + unsigned checkTpmKey : 1; + unsigned checkReqKey : 1; + unsigned checkSecureChannel : 1; unsigned isParametersHashDefined : 1; //16 unsigned isNameHashDefined : 1; //15 unsigned isTemplateHashDefined : 1; //14) SET if the templateHash needs to be @@ -419,6 +435,12 @@ typedef struct SESSION TPM2B_DIGEST policyDigest; // policyHash } u2; // audit log and policyHash may // share space to save memory +# if SEC_CHANNEL_SUPPORT +# if CC_PolicyTransportSPDM +# error Need Marshaling support +# endif + TPM2B_DIGEST scKeyNameHash; // the required secure channel key name hash +# endif // SEC_CHANNEL_SUPPORT } SESSION; # define EXPIRES_ON_RESET INT32_MIN diff --git a/src/tpm2/InternalRoutines.h b/src/tpm2/InternalRoutines.h index 1b598b808..99401614c 100644 --- a/src/tpm2/InternalRoutines.h +++ b/src/tpm2/InternalRoutines.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Include Headers for Internal Routines */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: InternalRoutines.h 1594 2020-03-26 22:15:48Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2020 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef INTERNAL_ROUTINES_H #define INTERNAL_ROUTINES_H @@ -84,6 +25,9 @@ #include "ACT_spt_fp.h" #include "PCR_fp.h" #include "DA_fp.h" +# if SEC_CHANNEL_SUPPORT +#include "SecChannel_fp.h" +# endif // SEC_CHANNEL_SUPPORT #include "TpmFail_fp.h" #include "SessionProcess_fp.h" diff --git a/src/tpm2/Marshal.c b/src/tpm2/Marshal.c index 7c77a4d5b..ef4b3cb27 100644 --- a/src/tpm2/Marshal.c +++ b/src/tpm2/Marshal.c @@ -713,6 +713,20 @@ TPMS_ACT_DATA_Marshal(TPMS_ACT_DATA *source, BYTE **buffer, INT32 *size) return written; } +# if SEC_CHANNEL_SUPPORT +// Table "Definition of TPMS_SPDM_SESSION_INFO Structure" (Part 2: Structures) + +UINT16 +TPMS_SPDM_SESSION_INFO_Marshal(TPMS_SPDM_SESSION_INFO* source, BYTE** buffer, INT32* size) +{ + UINT16 written = 0; + + written += TPM2B_NAME_Marshal((TPM2B_NAME*)&(source->reqKeyName), buffer, size); + written += TPM2B_NAME_Marshal((TPM2B_NAME*)&(source->tpmKeyName), buffer, size); + return written; +} +# endif // SEC_CHANNEL_SUPPORT + /* Table 2:94 - Definition of TPMS_TAGGED_PROPERTY Structure (StructuresTable()) */ UINT16 @@ -922,6 +936,38 @@ TPML_ACT_DATA_Marshal(TPML_ACT_DATA *source, BYTE **buffer, INT32 *size) return written; } +# if SEC_CHANNEL_SUPPORT +// Table "Definition of TPML_PUB_KEY Structure" (Part 2: Structures) +UINT16 +TPML_PUB_KEY_Marshal(TPML_PUB_KEY* source, BYTE** buffer, INT32* size) +{ + UINT16 written = 0; + + written += UINT32_Marshal((UINT32*)&(source->count), buffer, size); + written += TPM2B_PUBLIC_Array_Marshal((TPM2B_PUBLIC*)&(source->pubKeys), + buffer, + size, + (INT32)source->count); + return written; +} + +// Table "Definition of TPML_SPDM_SESSION_INFO Structure" (Part 2: Structures) + +UINT16 +TPML_SPDM_SESSION_INFO_Marshal(TPML_SPDM_SESSION_INFO* source, BYTE** buffer, INT32* size) +{ + UINT16 written = 0; + + written += UINT32_Marshal((UINT32*)&(source->count), buffer, size); + written += TPMS_SPDM_SESSION_INFO_Array_Marshal( + (TPMS_SPDM_SESSION_INFO*)&(source->spdmSessionInfo), + buffer, + size, + (INT32)source->count); + return written; +} +# endif // SEC_CHANNEL_SUPPORT + /* Table 2:110 - Definition of TPMU_CAPABILITIES Union (StructuresTable()) */ UINT16 @@ -963,6 +1009,15 @@ TPMU_CAPABILITIES_Marshal(TPMU_CAPABILITIES *source, BYTE **buffer, INT32 *size, case TPM_CAP_ACT: written += TPML_ACT_DATA_Marshal(&source->actData, buffer, size); break; +# if SEC_CHANNEL_SUPPORT + case TPM_CAP_PUB_KEYS: + written += TPML_PUB_KEY_Marshal((TPML_PUB_KEY*)&(source->pubKeys), buffer, size); + break; + case TPM_CAP_SPDM_SESSION_INFO: + written += TPML_SPDM_SESSION_INFO_Marshal( + (TPML_SPDM_SESSION_INFO*)&(source->spdmSessionInfo), buffer, size); + break; +# endif // SEC_CHANNEL_SUPPORT default: pAssert(FALSE); } @@ -2401,3 +2456,35 @@ TPML_AC_CAPABILITIES_Marshal(TPML_AC_CAPABILITIES *source, BYTE **buffer, INT32 return written; } +# if SEC_CHANNEL_SUPPORT +// Array Marshal for TPM2B_PUBLIC +UINT16 +TPM2B_PUBLIC_Array_Marshal( + TPM2B_PUBLIC* source, BYTE** buffer, INT32* size, INT32 count) +{ + UINT16 written = 0; + INT32 i; + + for(i = 0; i < count; i++) + { + written += TPM2B_PUBLIC_Marshal(&source[i], buffer, size); + } + return written; +} + +// Array Marshal for TPMS_SPDM_SESSION_INFO +UINT16 +TPMS_SPDM_SESSION_INFO_Array_Marshal( + TPMS_SPDM_SESSION_INFO* source, BYTE** buffer, INT32* size, INT32 count) +{ + UINT16 written = 0; + INT32 i; + + for(i = 0; i < count; i++) + { + written += TPMS_SPDM_SESSION_INFO_Marshal(&source[i], buffer, size); + } + return written; +} + +# endif // SEC_CHANNEL_SUPPORT \ No newline at end of file diff --git a/src/tpm2/Marshal_fp.h b/src/tpm2/Marshal_fp.h index ccf42c4c2..08686ac02 100644 --- a/src/tpm2/Marshal_fp.h +++ b/src/tpm2/Marshal_fp.h @@ -176,6 +176,10 @@ extern "C" { TPMS_TAGGED_POLICY_Marshal(TPMS_TAGGED_POLICY *source, BYTE **buffer, INT32 *size); UINT16 TPMS_ACT_DATA_Marshal(TPMS_ACT_DATA *source, BYTE **buffer, INT32 *size); +# if SEC_CHANNEL_SUPPORT + UINT16 + TPMS_SPDM_SESSION_INFO_Marshal(TPMS_SPDM_SESSION_INFO* source, BYTE** buffer, INT32* size); +# endif // SEC_CHANNEL_SUPPORT UINT16 TPMS_TAGGED_PROPERTY_Marshal(TPMS_TAGGED_PROPERTY *source, BYTE **buffer, INT32 *size); UINT16 @@ -204,6 +208,12 @@ extern "C" { TPML_TAGGED_POLICY_Marshal(TPML_TAGGED_POLICY *source, BYTE **buffer, INT32 *size); UINT16 TPML_ACT_DATA_Marshal(TPML_ACT_DATA *source, BYTE **buffer, INT32 *size); +#if SEC_CHANNEL_SUPPORT + UINT16 + TPML_PUB_KEY_Marshal(TPML_PUB_KEY* source, BYTE** buffer, INT32* size); + UINT16 + TPML_SPDM_SESSION_INFO_Marshal(TPML_SPDM_SESSION_INFO* source, BYTE** buffer, INT32* size); +#endif UINT16 TPMU_CAPABILITIES_Marshal(TPMU_CAPABILITIES *source, BYTE **buffer, INT32 *size, UINT32 selector); UINT16 @@ -414,6 +424,12 @@ extern "C" { TPMS_SET_CAPABILITY_DATA_Unmarshal(TPMS_SET_CAPABILITY_DATA* target, BYTE** buffer, INT32* size); TPM_RC TPM2B_SET_CAPABILITY_DATA_Unmarshal(TPM2B_SET_CAPABILITY_DATA* target, BYTE** buffer, INT32* size); +# if SEC_CHANNEL_SUPPORT + UINT16 + TPM2B_PUBLIC_Array_Marshal(TPM2B_PUBLIC* source, BYTE** buffer, INT32* size, INT32 count); + UINT16 + TPMS_SPDM_SESSION_INFO_Array_Marshal(TPMS_SPDM_SESSION_INFO* source, BYTE** buffer, INT32* size, INT32 count); +# endif // SEC_CHANNEL_SUPPORT #ifdef __cplusplus } #endif diff --git a/src/tpm2/PolicyTransportSPDM.c b/src/tpm2/PolicyTransportSPDM.c new file mode 100644 index 000000000..421d55d2f --- /dev/null +++ b/src/tpm2/PolicyTransportSPDM.c @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "PolicyTransportSPDM_fp.h" + +#if CC_PolicyTransportSPDM // Conditional expansion of this file + +/*(See part 3 specification) +// Add secure channel restrictions to the policyDigest +*/ +// Return Type: TPM_RC +// TPM_RC_VALUE TPM2_PolicyTransportSPDM has previously been executed +// TPM_RC_HASH hash algorithm in 'reqKeyName' or 'tpmKeyName' is not supported +// TPM_RC_SIZE 'reqKeyName' or 'tpmKeyName' is not the correct size for its hash algorithm +TPM_RC +TPM2_PolicyTransportSPDM(PolicyTransportSPDM_In* in // IN: input parameter list +) +{ + SESSION* session; + TPM_CC commandCode = TPM_CC_PolicyTransportSPDM; + TPM_ALG_ID hashAlg; + UINT16 digestSize; + HASH_STATE hashState; + TPM2B_DIGEST scKeyNameHash; + + // Input Validation + + // Get pointer to the session structure + session = SessionGet(in->policySession); + + // Check that TPM2_PolicyTransportSPDM has not previously been executed + if(session->attributes.checkSecureChannel == SET) + return TPM_RC_VALUE; + + // If 'reqKeyName' or 'tpmKeyName' are provided, check that they are valid Names + if(in->reqKeyName.t.size != 0) + { + if(in->reqKeyName.t.size < 2) + { + return TPM_RCS_SIZE + RC_PolicyTransportSPDM_reqKeyName; + } + + // Extract from the Name of the key, the algorithm used to compute its Name + hashAlg = BYTE_ARRAY_TO_UINT16(in->reqKeyName.t.name); + + // 'reqKeyName' parameter must use a supported hash algorithm + if(!CryptHashIsValidAlg(hashAlg, FALSE)) + return TPM_RCS_HASH + RC_PolicyTransportSPDM_reqKeyName; + + // and its size must be consistent with the hash algorithm + digestSize = CryptHashGetDigestSize(hashAlg); + if(digestSize != (in->reqKeyName.t.size - 2)) + return TPM_RCS_SIZE + RC_PolicyTransportSPDM_reqKeyName; + } + + if(in->tpmKeyName.t.size != 0) + { + if(in->tpmKeyName.t.size < 2) + { + return TPM_RCS_SIZE + RC_PolicyTransportSPDM_tpmKeyName; + } + + // Extract from the Name of the key, the algorithm used to compute its Name + hashAlg = BYTE_ARRAY_TO_UINT16(in->tpmKeyName.t.name); + + // 'tpmKeyName' parameter must use a supported hash algorithm + if(!CryptHashIsValidAlg(hashAlg, FALSE)) + return TPM_RCS_HASH + RC_PolicyTransportSPDM_tpmKeyName; + + // and its size must be consistent with the hash algorithm + digestSize = CryptHashGetDigestSize(hashAlg); + if(digestSize != (in->tpmKeyName.t.size - 2)) + return TPM_RCS_SIZE + RC_PolicyTransportSPDM_tpmKeyName; + } + + // Internal Data Update + if(in->reqKeyName.t.size != 0 || in->tpmKeyName.t.size != 0) + { + // Compute secure channel key name hash + // scKeyNameHash = hash(reqKeyName.size || reqKeyName.name || tpmKeyName.size || tpmKeyName.name) + // Start hash + scKeyNameHash.t.size = CryptHashStart(&hashState, session->authHashAlg); + + // Add reqKeyName.size + CryptDigestUpdateInt(&hashState, sizeof(UINT16), in->reqKeyName.t.size); + + // Add reqKeyName.name (absent if Empty Buffer) + CryptDigestUpdate2B(&hashState, &in->reqKeyName.b); + + // Add tpmKeyName.size + CryptDigestUpdateInt(&hashState, sizeof(UINT16), in->tpmKeyName.t.size); + + // Add tpmKeyName.name (absent if Empty Buffer) + CryptDigestUpdate2B(&hashState, &in->tpmKeyName.b); + + // Complete digest + CryptHashEnd2B(&hashState, &scKeyNameHash.b); + + // Update scKeyNameHash in session context + session->scKeyNameHash = scKeyNameHash; + } + else + { + scKeyNameHash.t.size = 0; + } + + // Update policy hash + // policyDigestnew = hash(policyDigestold || TPM_CC_PolicyTransportSPDM || scKeyNameHash) + // Start hash + session->u2.policyDigest.t.size = + CryptHashStart(&hashState, session->authHashAlg); + + // Add old digest + CryptDigestUpdate2B(&hashState, &session->u2.policyDigest.b); + + // Add commandCode + CryptDigestUpdateInt(&hashState, sizeof(TPM_CC), commandCode); + + // Add scKeyNameHash (absent if Empty Buffer) + CryptDigestUpdate2B(&hashState, &scKeyNameHash.b); + + // Complete the digest and get the results + CryptHashEnd2B(&hashState, &session->u2.policyDigest.b); + + // Update session context + session->attributes.checkSecureChannel = SET; + if(in->reqKeyName.t.size != 0) + { + session->attributes.checkReqKey = SET; + } + if(in->tpmKeyName.t.size != 0) + { + session->attributes.checkTpmKey = SET; + } + + return TPM_RC_SUCCESS; +} + +#endif // CC_PolicyTransportSPDM diff --git a/src/tpm2/PolicyTransportSPDM_fp.h b/src/tpm2/PolicyTransportSPDM_fp.h new file mode 100644 index 000000000..91f0d459a --- /dev/null +++ b/src/tpm2/PolicyTransportSPDM_fp.h @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#if CC_PolicyTransportSPDM // Command must be enabled + +# ifndef _TPM_INCLUDE_PRIVATE_PROTOTYPES_POLICYTRANSPORTSPDM_FP_H_ +# define _TPM_INCLUDE_PRIVATE_PROTOTYPES_POLICYTRANSPORTSPDM_FP_H_ + +// Input structure definition +typedef struct +{ + TPMI_SH_POLICY policySession; + TPM2B_NAME reqKeyName; + TPM2B_NAME tpmKeyName; +} PolicyTransportSPDM_In; + +// Response code modifiers +# define RC_PolicyTransportSPDM_policySession (TPM_RC_H + TPM_RC_1) +# define RC_PolicyTransportSPDM_reqKeyName (TPM_RC_P + TPM_RC_1) +# define RC_PolicyTransportSPDM_tpmKeyName (TPM_RC_P + TPM_RC_2) + +// Function prototype +TPM_RC +TPM2_PolicyTransportSPDM(PolicyTransportSPDM_In* in); + +# endif // _TPM_INCLUDE_PRIVATE_PROTOTYPES_POLICYTRANSPORTSPDM_FP_H_ +#endif // CC_PolicyTransportSPDM diff --git a/src/tpm2/RuntimeCommands.c b/src/tpm2/RuntimeCommands.c index 06adde148..099201867 100644 --- a/src/tpm2/RuntimeCommands.c +++ b/src/tpm2/RuntimeCommands.c @@ -192,10 +192,11 @@ static const struct { COMMAND(NV_ReadPublic2, true, 0), // not supported COMMAND(SetCapability, true, 0), // not supported COMMAND(ReadOnlyControl, true, 0), // not supported + COMMAND(PolicyTransportSPDM, true, 0), // not supported /* all new commands added here MUST have CAN_BE_DISABLE = true */ #undef COMMAND }; -MUST_BE(TPM_CC_LAST == TPM_CC_ReadOnlyControl); /* force update of above list when new commands added */ +MUST_BE(TPM_CC_LAST == TPM_CC_PolicyTransportSPDM); /* force update of above list when new commands added */ static void RuntimeCommandsEnableAllCommands(struct RuntimeCommands *RuntimeCommands, diff --git a/src/tpm2/SecChannel.c b/src/tpm2/SecChannel.c new file mode 100644 index 000000000..c2db9ad47 --- /dev/null +++ b/src/tpm2/SecChannel.c @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" + +# if SEC_CHANNEL_SUPPORT +// Dummy requester key name +const TPM2B_NAME dummy_reqKeyName = +{{ + 0x0032, // size + // name + { + 0x00, 0x0C, // hashAlg = TPM_ALG_SHA384 + // digest + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 + } +}}; + +//*** GetTpmSpdmPubKey() +// This function is used to get the dummy TPM SPDM public key +void GetTpmSpdmPubKey(TPMT_PUBLIC* tpmPubKey) +{ + tpmPubKey->type = TPM_ALG_ECC; + tpmPubKey->nameAlg = TPM_ALG_SHA384; + tpmPubKey->objectAttributes = 0x00050032; // fixedTPM | fixedParent | sensitiveDataOrigin | restricted | sign; + tpmPubKey->authPolicy.t.size = 0; + tpmPubKey->parameters.eccDetail.symmetric.algorithm = TPM_ALG_NULL; + tpmPubKey->parameters.eccDetail.scheme.scheme = TPM_ALG_ECDSA; + tpmPubKey->parameters.eccDetail.scheme.details.ecdsa.hashAlg = TPM_ALG_SHA384; + tpmPubKey->parameters.eccDetail.curveID = TPM_ECC_NIST_P384; + tpmPubKey->parameters.eccDetail.kdf.scheme = TPM_ALG_NULL; + tpmPubKey->unique.ecc.x.t.size = 0x0030; + tpmPubKey->unique.ecc.y.t.size = 0x0030; + // For the dummy key, use x and y buffer all zeros + memset(tpmPubKey->unique.ecc.x.t.buffer, 0, tpmPubKey->unique.ecc.x.t.size); + memset(tpmPubKey->unique.ecc.y.t.buffer, 0, tpmPubKey->unique.ecc.y.t.size); +} + +//*** SpdmCapGetTpmPubKeys() +// This function is used to get the 'TPM_PUB_KEY' public keys for GetCapability. +// Return Type: TPMI_YES_NO +// NO no more properties to be reported +TPMI_YES_NO +SpdmCapGetTpmPubKeys(TPM_PUB_KEY spdmPubKey, // IN: the starting TPM property + UINT32 count, // IN: maximum number of returned properties + TPML_PUB_KEY* pubKeyList // OUT: property list +) +{ + TPMI_YES_NO more = NO; + + // This reference implementation does not implement SPDM functionality and returns a single dummy TPM SPDM public key + pubKeyList->count = 1; + GetTpmSpdmPubKey(&pubKeyList->pubKeys[0].publicArea); + pubKeyList->pubKeys[0].size = sizeof(TPMT_PUBLIC); + + return more; +} + +//*** SpdmCapGetSessionInfo() +// This function is used to get the SPDM session information for GetCapability. +// This list has only one element. +// Return Type: TPMI_YES_NO +// NO no more properties to be reported +TPMI_YES_NO +SpdmCapGetSessionInfo(TPML_SPDM_SESSION_INFO* spdmSessionInfoList // OUT: property list +) +{ + TPMI_YES_NO more = NO; + + // This reference implementation does not implement SPDM messages + // This function returns dummy SPDM session info + TPMS_SPDM_SESSION_INFO* spdmSessionInfo = &spdmSessionInfoList->spdmSessionInfo[0]; + + if(IsSpdmSessionActive(&spdmSessionInfo->reqKeyName, &spdmSessionInfo->tpmKeyName)) + spdmSessionInfoList->count = 1; + else + // If GetCapability is not sent within an SPDM session, an Empty List is returned + spdmSessionInfoList->count = 0; + + return more; +} + +//*** IsSpdmSessionActive() +// This function indicates whether an SPDM session is active and if so, +// returns the requester and TPM key names associated with the SPDM session. +// Return Type: BOOL +// TRUE(1) SPDM session is active (TPM command is protected by an SPDM session) +BOOL +IsSpdmSessionActive(TPM2B_NAME* reqKeyName, // OUT: the requester key's name associated with the SPDM session + TPM2B_NAME* tpmKeyName // OUT: the TPM key's name associated with the SPDM session +) +{ + TPMT_PUBLIC tpmPubKey; + + // This reference implementation does not implement SPDM messages + // This function returns always TRUE and returns dummy requester and TPM key names + MemoryCopy2B(&reqKeyName->b, + &dummy_reqKeyName.b, + sizeof(dummy_reqKeyName)); + + // Get TPM SPDM pub key and compute its name + GetTpmSpdmPubKey(&tpmPubKey); + PublicMarshalAndComputeName(&tpmPubKey, tpmKeyName); + + return TRUE; +} +# endif // SEC_CHANNEL_SUPPORT diff --git a/src/tpm2/SecChannel_fp.h b/src/tpm2/SecChannel_fp.h new file mode 100644 index 000000000..80990289f --- /dev/null +++ b/src/tpm2/SecChannel_fp.h @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#ifndef _SEC_CHANNEL_FP_H_ +#define _SEC_CHANNEL_FP_H_ + +//*** GetTpmSpdmPubKey() +// This function is used to get the dummy TPM SPDM public key +void GetTpmSpdmPubKey(TPMT_PUBLIC* tpmPubKey); + +//*** SpdmCapGetTpmPubKeys() +// This function is used to get the 'TPM_PUB_KEY' public keys for GetCapability. +// Return Type: TPMI_YES_NO +// NO no more properties to be reported +TPMI_YES_NO +SpdmCapGetTpmPubKeys(TPM_PUB_KEY spdmPubKey, // IN: the starting TPM property + UINT32 count, // IN: maximum number of returned properties + TPML_PUB_KEY* pubKeyList // OUT: property list +); + +//*** SpdmCapGetSessionInfo() +// This function is used to get the SPDM session information for GetCapability. +// Return Type: TPMI_YES_NO +// NO no more properties to be reported +TPMI_YES_NO +SpdmCapGetSessionInfo(TPML_SPDM_SESSION_INFO* spdmSessionInfoList // OUT: property list +); + +//*** IsSpdmSessionActive() +// This function indicates whether an SPDM session is active and if so, +// returns the requester and TPM key names associated with the SPDM session. +// Return Type: BOOL +// TRUE(1) SPDM session is active (TPM command is protected by an SPDM session) +BOOL +IsSpdmSessionActive(TPM2B_NAME* reqKeyName, // OUT: the requester key's name associated with the SPDM session + TPM2B_NAME* tpmKeyName // OUT: the TPM key's name associated with the SPDM session +); + +#endif // _SEC_CHANNEL_FP_H_ diff --git a/src/tpm2/SessionProcess.c b/src/tpm2/SessionProcess.c index b0ffeb3a7..aac951e68 100644 --- a/src/tpm2/SessionProcess.c +++ b/src/tpm2/SessionProcess.c @@ -71,6 +71,9 @@ #include "Tpm.h" #include "ACT.h" #include "Marshal.h" +# if SEC_CHANNEL_SUPPORT +#include "SecChannel_fp.h" +# endif // SEC_CHANNEL_SUPPORT // //** Authorization Support Functions @@ -748,6 +751,64 @@ BOOL CompareParametersHash(COMMAND* command, // IN: main parsing structure return MemoryEqual2B(&session->u1.pHash.b, &pHash.b); } +# if SEC_CHANNEL_SUPPORT +//*** CompareScKeyNameHash() +// This function computes the secure channel key name hash (from the requester and/or TPM key +// used to establish the secure channel session) and compares it to the scKeyNameHash in the +// session data, returning true if they are equal. +BOOL CompareScKeyNameHash(SESSION* session, // IN: session structure + TPM2B_NAME* reqKeyName, // IN: requester secure channel key name + TPM2B_NAME* tpmKeyName // IN: TPM secure channel key name +) +{ + HASH_STATE hashState; + TPM2B_DIGEST scKeyNameHash; + UINT16 zeroSize = 0x0000; + + // Compute secure channel key name hash + // scKeyNameHash = hash(reqKeyName.size || reqKeyName.name || tpmKeyName.size || tpmKeyName.name) + // Start hash + scKeyNameHash.t.size = CryptHashStart(&hashState, session->authHashAlg); + + // Include reqKeyName if it needs to be checked, otherwise include Empty Buffer + if(session->attributes.checkReqKey) + { + // Add reqKeyName.size + CryptDigestUpdateInt(&hashState, sizeof(UINT16), reqKeyName->t.size); + + // Add reqKeyName.name + CryptDigestUpdate2B(&hashState, &reqKeyName->b); + } + else + { + // Add zero size + CryptDigestUpdateInt(&hashState, sizeof(UINT16), zeroSize); + } + + // Include tpmKeyName if it needs to be checked, otherwise include Empty Buffer + if(session->attributes.checkTpmKey) + { + // Add tpmKeyName.size + CryptDigestUpdateInt(&hashState, sizeof(UINT16), tpmKeyName->t.size); + + // Add tpmKeyName.name + CryptDigestUpdate2B(&hashState, &tpmKeyName->b); + } + else + { + // Add zero size + CryptDigestUpdateInt(&hashState, sizeof(UINT16), zeroSize); + } + + // Complete hash + CryptHashEnd2B(&hashState, &scKeyNameHash.b); + + // and compare + return MemoryEqual( + session->scKeyNameHash.t.buffer, scKeyNameHash.t.buffer, scKeyNameHash.t.size); +} +# endif // SEC_CHANNEL_SUPPORT + //*** CheckPWAuthSession() // This function validates the authorization provided in a PWAP session. It // compares the input value to authValue of the authorized entity. Argument @@ -984,6 +1045,8 @@ static TPM_RC CheckSessionHMAC( // TPM_RC_PP PP is required but not asserted // TPM_RC_NV_UNAVAILABLE NV is not available for write // TPM_RC_NV_RATE NV is rate limiting +// TPM_RC_CHANNEL No secure channel is active +// TPM_RC_CHANNEL_KEY Secure channel key is incorrect static TPM_RC CheckPolicyAuthSession( COMMAND* command, // IN: primary parsing structure UINT32 sessionIndex // IN: index of session to be processed @@ -1116,6 +1179,25 @@ static TPM_RC CheckPolicyAuthSession( != (session->attributes.nvWrittenState == SET)) return TPM_RC_POLICY_FAIL; } +# if SEC_CHANNEL_SUPPORT + if(session->attributes.checkSecureChannel) + { + TPM2B_NAME reqKeyName; + TPM2B_NAME tpmKeyName; + + // Check that the authorized TPM command is protected by an SPDM session and + // if so, get the names of the associated requester and TPM key + if(!IsSpdmSessionActive(&reqKeyName, &tpmKeyName)) + return TPM_RC_CHANNEL; + + // If required, check the requester or TPM secure channel key name by comparing scKeyNameHash + if(session->attributes.checkReqKey == SET || session->attributes.checkTpmKey == SET) + { + if(!CompareScKeyNameHash(session, &reqKeyName, &tpmKeyName)) + return TPM_RC_CHANNEL_KEY; + } + } +# endif // SEC_CHANNEL_SUPPORT return TPM_RC_SUCCESS; } diff --git a/src/tpm2/SessionProcess_fp.h b/src/tpm2/SessionProcess_fp.h index 398adb6db..34212022d 100644 --- a/src/tpm2/SessionProcess_fp.h +++ b/src/tpm2/SessionProcess_fp.h @@ -97,6 +97,17 @@ BOOL CompareParametersHash(COMMAND* command, // IN: main parsing structure SESSION* session // IN: session structure with pHash ); +# if SEC_CHANNEL_SUPPORT +//*** CompareScKeyNameHash() +// This function computes the secure channel key name hash (from the requester and/or TPM key +// used to establish the secure channel session) and compares it to the scKeyNameHash in the +// session data, returning true if they are equal. +BOOL CompareScKeyNameHash(SESSION* session, // IN: session structure + TPM2B_NAME* reqKeyName, // IN: requester secure channel key name + TPM2B_NAME* tpmKeyName // IN: TPM secure channel key name +); +# endif // SEC_CHANNEL_SUPPORT + //*** ParseSessionBuffer() // This function is the entry function for command session processing. // It iterates sessions in session area and reports if the required authorization diff --git a/src/tpm2/TpmProfile_CommandList.h b/src/tpm2/TpmProfile_CommandList.h index ad7a619a4..ed3ea823a 100644 --- a/src/tpm2/TpmProfile_CommandList.h +++ b/src/tpm2/TpmProfile_CommandList.h @@ -164,5 +164,6 @@ #define CC_NV_ReadPublic2 CC_NO /* libtpms: NO */ #define CC_SetCapability CC_NO /* libtpms: NO */ #define CC_ReadOnlyControl CC_NO /* libtpms: NO */ +#define CC_PolicyTransportSPDM CC_NO /* libtpms: NO */ #endif // _TPM_PROFILE_COMMAND_LIST_H_ diff --git a/src/tpm2/TpmProfile_Common.h b/src/tpm2/TpmProfile_Common.h index 25986dbe5..e6cc36528 100644 --- a/src/tpm2/TpmProfile_Common.h +++ b/src/tpm2/TpmProfile_Common.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // clang-format off @@ -324,4 +266,9 @@ #define EXTERNAL_NV NO #define PERMANENT_NV NO // libtpms: added +//*********************************************** +// Defines controlling secure channel functionality +//*********************************************** +#define SEC_CHANNEL_SUPPORT NO // libtpms: NO + #endif // _TPM_PROFILE_COMMON_H_ diff --git a/src/tpm2/TpmTypes.h b/src/tpm2/TpmTypes.h index 8632e251a..522b01591 100644 --- a/src/tpm2/TpmTypes.h +++ b/src/tpm2/TpmTypes.h @@ -304,7 +304,8 @@ typedef UINT32 TPM_CC; #define TPM_CC_NV_ReadPublic2 (TPM_CC)(0x0000019E) #define TPM_CC_SetCapability (TPM_CC)(0x0000019F) #define TPM_CC_ReadOnlyControl (TPM_CC)(0x000001A0) -#define TPM_CC_LAST (TPM_CC)(0x000001A0) +#define TPM_CC_PolicyTransportSPDM (TPM_CC)(0x000001A1) +#define TPM_CC_LAST (TPM_CC)(0x000001A1) #define CC_VEND (TPM_CC)(0x20000000) #define TPM_CC_Vendor_TCG_Test (TPM_CC)(0x20000000) @@ -454,6 +455,7 @@ typedef UINT32 TPM_CC; + (ADD_FILL || CC_NV_ReadPublic2) /* 0x0000019E */ \ + (ADD_FILL || CC_SetCapability) /* 0x0000019F */ \ + (ADD_FILL || CC_ReadOnlyControl) /* 0x000001A0 */ \ + + (ADD_FILL || CC_PolicyTransportSPDM) /* 0x000001A1 */ \ ) #if LIBRARY_COMMAND_ARRAY_SIZE == 0 # error "No commands are enabled -- something is terribly wrong." @@ -573,6 +575,8 @@ typedef UINT32 TPM_RC; #define TPM_RCS_ECC_POINT (TPM_RC)(RC_FMT1 + 0x027) #define TPM_RC_FW_LIMITED (TPM_RC)(RC_FMT1 + 0x028) #define TPM_RC_SVN_LIMITED (TPM_RC)(RC_FMT1 + 0x029) +#define TPM_RC_CHANNEL (TPM_RC)(RC_FMT1 + 0x030) +#define TPM_RC_CHANNEL_KEY (TPM_RC)(RC_FMT1 + 0x031) #define RC_WARN (TPM_RC)(0x900) #define TPM_RC_CONTEXT_GAP (TPM_RC)(RC_WARN + 0x001) #define TPM_RC_OBJECT_MEMORY (TPM_RC)(RC_WARN + 0x002) @@ -687,21 +691,23 @@ typedef UINT8 TPM_SE; // Table "Definition of TPM_CAP Constants" (Part 2: Structures) typedef UINT32 TPM_CAP; -#define TYPE_OF_TPM_CAP UINT32 -#define TPM_CAP_FIRST (TPM_CAP)(0x00000000) -#define TPM_CAP_ALGS (TPM_CAP)(0x00000000) -#define TPM_CAP_HANDLES (TPM_CAP)(0x00000001) -#define TPM_CAP_COMMANDS (TPM_CAP)(0x00000002) -#define TPM_CAP_PP_COMMANDS (TPM_CAP)(0x00000003) -#define TPM_CAP_AUDIT_COMMANDS (TPM_CAP)(0x00000004) -#define TPM_CAP_PCRS (TPM_CAP)(0x00000005) -#define TPM_CAP_TPM_PROPERTIES (TPM_CAP)(0x00000006) -#define TPM_CAP_PCR_PROPERTIES (TPM_CAP)(0x00000007) -#define TPM_CAP_ECC_CURVES (TPM_CAP)(0x00000008) -#define TPM_CAP_AUTH_POLICIES (TPM_CAP)(0x00000009) -#define TPM_CAP_ACT (TPM_CAP)(0x0000000A) -#define TPM_CAP_LAST (TPM_CAP)(0x0000000A) -#define TPM_CAP_VENDOR_PROPERTY (TPM_CAP)(0x00000100) +#define TYPE_OF_TPM_CAP UINT32 +#define TPM_CAP_FIRST (TPM_CAP)(0x00000000) +#define TPM_CAP_ALGS (TPM_CAP)(0x00000000) +#define TPM_CAP_HANDLES (TPM_CAP)(0x00000001) +#define TPM_CAP_COMMANDS (TPM_CAP)(0x00000002) +#define TPM_CAP_PP_COMMANDS (TPM_CAP)(0x00000003) +#define TPM_CAP_AUDIT_COMMANDS (TPM_CAP)(0x00000004) +#define TPM_CAP_PCRS (TPM_CAP)(0x00000005) +#define TPM_CAP_TPM_PROPERTIES (TPM_CAP)(0x00000006) +#define TPM_CAP_PCR_PROPERTIES (TPM_CAP)(0x00000007) +#define TPM_CAP_ECC_CURVES (TPM_CAP)(0x00000008) +#define TPM_CAP_AUTH_POLICIES (TPM_CAP)(0x00000009) +#define TPM_CAP_ACT (TPM_CAP)(0x0000000A) +#define TPM_CAP_PUB_KEYS (TPM_CAP)(0x0000000B) +#define TPM_CAP_SPDM_SESSION_INFO (TPM_CAP)(0x0000000C) +#define TPM_CAP_LAST (TPM_CAP)(0x0000000C) +#define TPM_CAP_VENDOR_PROPERTY (TPM_CAP)(0x00000100) // Table "Definition of TPM_PT Constants" (Part 2: Structures) typedef UINT32 TPM_PT; @@ -930,6 +936,11 @@ typedef TPM_HANDLE TPM_HC; #define AC_FIRST (TPM_HC)((HR_AC + 0)) #define AC_LAST (TPM_HC)((HR_AC + 0x0000FFFF)) +// Table "Definition of TPM_PUB_KEY Constants" (Part 2: Structures) +typedef UINT32 TPM_PUB_KEY; +#define TYPE_OF_TPM_PUB_KEY UINT32 +#define TPM_PUB_KEY_TPM_SPDM_00 (TPM_PUB_KEY)(0x00000000) + // Table "Definition of TPMA_ALGORITHM Bits" (Part 2: Structures) #define TYPE_OF_TPMA_ALGORITHM UINT32 #define TPMA_ALGORITHM_TO_UINT32(a) (*((UINT32*)&(a))) @@ -1536,6 +1547,14 @@ typedef struct TPMA_ACT attributes; } TPMS_ACT_DATA; +# if SEC_CHANNEL_SUPPORT +typedef struct +{ // (Part 2: Structures) + TPM2B_NAME reqKeyName; + TPM2B_NAME tpmKeyName; +} TPMS_SPDM_SESSION_INFO; +# endif // SEC_CHANNEL_SUPPORT + typedef struct { // (Part 2: Structures) UINT32 count; @@ -1614,34 +1633,19 @@ typedef struct TPMS_ACT_DATA actData[MAX_ACT_DATA]; } TPML_ACT_DATA; +# if SEC_CHANNEL_SUPPORT typedef struct { // (Part 2: Structures) - UINT32 count; - TPM2B_VENDOR_PROPERTY vendorData[MAX_VENDOR_PROPERTY]; -} TPML_VENDOR_PROPERTY; - -typedef union -{ // (Part 2: Structures) - TPML_ALG_PROPERTY algorithms; - TPML_HANDLE handles; - TPML_CCA command; - TPML_CC ppCommands; - TPML_CC auditCommands; - TPML_PCR_SELECTION assignedPCR; - TPML_TAGGED_TPM_PROPERTY tpmProperties; - TPML_TAGGED_PCR_PROPERTY pcrProperties; -#if ALG_ECC - TPML_ECC_CURVE eccCurves; -#endif // ALG_ECC - TPML_TAGGED_POLICY authPolicies; - TPML_ACT_DATA actData; -} TPMU_CAPABILITIES; + UINT32 count; + TPMS_SPDM_SESSION_INFO spdmSessionInfo[MAX_SPDM_SESS_INFO]; +} TPML_SPDM_SESSION_INFO; +# endif // SEC_CHANNEL_SUPPORT typedef struct { // (Part 2: Structures) - TPM_CAP capability; - TPMU_CAPABILITIES data; -} TPMS_CAPABILITY_DATA; + UINT32 count; + TPM2B_VENDOR_PROPERTY vendorData[MAX_VENDOR_PROPERTY]; +} TPML_VENDOR_PROPERTY; typedef union { // (Part 2: Structures) @@ -2370,6 +2374,41 @@ typedef struct TPMT_PUBLIC publicArea; } TPM2B_PUBLIC; +# if SEC_CHANNEL_SUPPORT +typedef struct +{ // (Part 2: Structures) + UINT32 count; + TPM2B_PUBLIC pubKeys[MAX_PUB_KEYS]; +} TPML_PUB_KEY; +# endif // SEC_CHANNEL_SUPPORT + +typedef union +{ // (Part 2: Structures) + TPML_ALG_PROPERTY algorithms; + TPML_HANDLE handles; + TPML_CCA command; + TPML_CC ppCommands; + TPML_CC auditCommands; + TPML_PCR_SELECTION assignedPCR; + TPML_TAGGED_TPM_PROPERTY tpmProperties; + TPML_TAGGED_PCR_PROPERTY pcrProperties; +#if ALG_ECC + TPML_ECC_CURVE eccCurves; +#endif // ALG_ECC + TPML_TAGGED_POLICY authPolicies; + TPML_ACT_DATA actData; +# if SEC_CHANNEL_SUPPORT + TPML_PUB_KEY pubKeys; + TPML_SPDM_SESSION_INFO spdmSessionInfo; +# endif // SEC_CHANNEL_SUPPORT +} TPMU_CAPABILITIES; + +typedef struct +{ // (Part 2: Structures) + TPM_CAP capability; + TPMU_CAPABILITIES data; +} TPMS_CAPABILITY_DATA; + typedef union { // (Part 2: Structures) struct diff --git a/src/tpm2/Unmarshal.c b/src/tpm2/Unmarshal.c index f33973264..2e319e165 100644 --- a/src/tpm2/Unmarshal.c +++ b/src/tpm2/Unmarshal.c @@ -457,6 +457,10 @@ TPM_CAP_Unmarshal(TPM_CAP *target, BYTE **buffer, INT32 *size) case TPM_CAP_ECC_CURVES: case TPM_CAP_AUTH_POLICIES: case TPM_CAP_ACT: +# if SEC_CHANNEL_SUPPORT + case TPM_CAP_PUB_KEYS: + case TPM_CAP_SPDM_SESSION_INFO: +# endif // SEC_CHANNEL_SUPPORT case TPM_CAP_VENDOR_PROPERTY: break; default: From a3af46921958988addcc2d72490598e3e3bb38b4 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 6 Aug 2025 14:12:22 -0400 Subject: [PATCH 11/52] Sync: Reformat some files Signed-off-by: Stefan Berger --- src/tpm2/CryptUtil.c | 9 +- src/tpm2/Global.h | 22 +-- src/tpm2/InternalRoutines.h | 12 +- src/tpm2/NV.h | 30 ++-- src/tpm2/NV_spt_fp.h | 3 +- src/tpm2/OIDs.h | 91 +++--------- src/tpm2/PRNG_TestVectors.h | 121 +++++----------- src/tpm2/ReadOnlyControl_fp.h | 4 +- src/tpm2/SecChannel_fp.h | 23 +-- src/tpm2/SessionProcess_fp.h | 75 ++-------- src/tpm2/TpmASN1.h | 66 +-------- src/tpm2/crypto/CryptEcc.h | 62 +-------- src/tpm2/crypto/CryptHash.h | 110 ++++----------- src/tpm2/crypto/CryptHash_fp.h | 67 +-------- src/tpm2/crypto/CryptRand.h | 69 +-------- src/tpm2/crypto/CryptRsa.h | 68 +-------- src/tpm2/crypto/openssl/CryptEccKeyExchange.c | 62 +-------- src/tpm2/crypto/openssl/CryptHash.c | 89 +++--------- src/tpm2/crypto/openssl/CryptRand.c | 131 +++++------------- 19 files changed, 211 insertions(+), 903 deletions(-) diff --git a/src/tpm2/CryptUtil.c b/src/tpm2/CryptUtil.c index 0d483345a..40a807f34 100644 --- a/src/tpm2/CryptUtil.c +++ b/src/tpm2/CryptUtil.c @@ -98,7 +98,8 @@ static TPM_RC CryptHmacSign(TPMT_SIGNATURE* signature, // OUT: signature signature->signature.any.hashAlg, &signKey->sensitive.sensitive.bits.b); CryptDigestUpdate2B(&hmacState.hashState, &hashData->b); - CryptHmacEnd(&hmacState, digestSize, (BYTE*)&signature->signature.hmac.digest); + CryptHmacEnd( + &hmacState, digestSize, (BYTE*)&signature->signature.hmac.digest); return TPM_RC_SUCCESS; } return TPM_RC_SCHEME; @@ -1380,8 +1381,9 @@ BOOL CryptIsAsymSignScheme(TPMI_ALG_PUBLIC publicType, // IN: Type of the // This function checks that a signing scheme is valid. This includes verifying // that the scheme signing algorithm is compatible with the signing object type // and that the scheme specifies a valid hash algorithm. -static BOOL CryptIsValidSignScheme(TPMI_ALG_PUBLIC publicType, // IN: Type of the object - TPMT_SIG_SCHEME* scheme // IN: the signing scheme +static BOOL CryptIsValidSignScheme( + TPMI_ALG_PUBLIC publicType, // IN: Type of the object + TPMT_SIG_SCHEME* scheme // IN: the signing scheme ) { BOOL isValidSignScheme = TRUE; @@ -1585,7 +1587,6 @@ BOOL CryptSelectSignScheme(OBJECT* signObject, // IN: signing key // valid hash algorithm specified. OK = CryptIsValidSignScheme(publicArea->type, scheme); } - } return OK; } diff --git a/src/tpm2/Global.h b/src/tpm2/Global.h index 2af88dff7..eee5816cd 100644 --- a/src/tpm2/Global.h +++ b/src/tpm2/Global.h @@ -439,8 +439,8 @@ typedef struct SESSION # if CC_PolicyTransportSPDM # error Need Marshaling support # endif - TPM2B_DIGEST scKeyNameHash; // the required secure channel key name hash -# endif // SEC_CHANNEL_SUPPORT + TPM2B_DIGEST scKeyNameHash; // the required secure channel key name hash +# endif // SEC_CHANNEL_SUPPORT } SESSION; # define EXPIRES_ON_RESET INT32_MIN @@ -820,7 +820,7 @@ typedef struct // This implementation only supports a single group of PCR controlled by // policy. If more are required, then this structure would be changed to // an array. -# if defined NUM_POLICY_PCR_GROUP && NUM_POLICY_PCR_GROUP > 0 +# if defined NUM_POLICY_PCR_GROUP && NUM_POLICY_PCR_GROUP > 0 PCR_POLICY pcrPolicies; # endif @@ -1033,13 +1033,13 @@ typedef struct state_clear_data # endif #endif // libtpms added -#if CC_ReadOnlyControl +# if CC_ReadOnlyControl #error Need Marshaling/Unmarshaling support //***************************************************************************** // Read-Only Control //***************************************************************************** - BOOL readOnly; // default reset is CLEAR -#endif + BOOL readOnly; // default reset is CLEAR +# endif } STATE_CLEAR_DATA; @@ -1086,11 +1086,11 @@ typedef struct state_reset_data // object context. The default reset // value is 0. CONTEXT_SLOT contextArray[MAX_ACTIVE_SESSIONS]; // This array contains - // contains the values used to track - // the version numbers of saved - // contexts (see - // Session.c in for details). The - // default reset value is {0}. + // contains the values used to track + // the version numbers of saved + // contexts (see + // Session.c in for details). The + // default reset value is {0}. CONTEXT_COUNTER contextCounter; // This is the value from which the // 'contextID' is derived. The diff --git a/src/tpm2/InternalRoutines.h b/src/tpm2/InternalRoutines.h index 99401614c..b439b78d2 100644 --- a/src/tpm2/InternalRoutines.h +++ b/src/tpm2/InternalRoutines.h @@ -25,9 +25,9 @@ #include "ACT_spt_fp.h" #include "PCR_fp.h" #include "DA_fp.h" -# if SEC_CHANNEL_SUPPORT -#include "SecChannel_fp.h" -# endif // SEC_CHANNEL_SUPPORT +#if SEC_CHANNEL_SUPPORT +# include "SecChannel_fp.h" +#endif // SEC_CHANNEL_SUPPORT #include "TpmFail_fp.h" #include "SessionProcess_fp.h" @@ -44,9 +44,9 @@ #include "Response_fp.h" #include "CommandDispatcher_fp.h" -#if CC_AC_Send -# include "AC_spt_fp.h" -#endif // CC_AC_Send +#if CC_AC_Send & 0 // libtpms changed: from #ifdef +# include "AC_spt_fp.h" +#endif // CC_AC_Send // Miscellaneous #include "Bits_fp.h" diff --git a/src/tpm2/NV.h b/src/tpm2/NV.h index 9efa08e8d..3eaa156a4 100644 --- a/src/tpm2/NV.h +++ b/src/tpm2/NV.h @@ -74,10 +74,10 @@ #else // If TPM_NT_ORDINARY is not defined, then need to synthesize it from the // attributes -# define GetNv_TPM_NV(attributes) \ - (IS_ATTRIBUTE(attributes, TPMA_NV, COUNTER) \ - + (IS_ATTRIBUTE(attributes, TPMA_NV, BITS) << 1) \ - + (IS_ATTRIBUTE(attributes, TPMA_NV, EXTEND) << 2)) +# define GetNv_TPM_NV(attributes) \ + (IS_ATTRIBUTE(attributes, TPMA_NV, COUNTER) \ + + (IS_ATTRIBUTE(attributes, TPMA_NV, BITS) << 1) \ + + (IS_ATTRIBUTE(attributes, TPMA_NV, EXTEND) << 2)) # define TPM_NT_ORDINARY (0) # define TPM_NT_COUNTER (1) # define TPM_NT_BITS (2) @@ -148,21 +148,21 @@ typedef UINT32 NV_LIST_TERMINATOR[3]; // Macro to check that an orderly RAM address is with range. #define ORDERLY_RAM_ADDRESS_OK(start, offset) \ - ((start >= RAM_ORDERLY_START) && ((start + offset - 1) < RAM_ORDERLY_END)) + ((start >= RAM_ORDERLY_START) && ((start + offset - 1) < RAM_ORDERLY_END)) -#define RETURN_IF_NV_IS_NOT_AVAILABLE \ - { \ - if(g_NvStatus != TPM_RC_SUCCESS) \ - return g_NvStatus; \ - } +#define RETURN_IF_NV_IS_NOT_AVAILABLE \ + { \ + if(g_NvStatus != TPM_RC_SUCCESS) \ + return g_NvStatus; \ + } // Routinely have to clear the orderly flag and fail if the // NV is not available so that it can be cleared. -#define RETURN_IF_ORDERLY \ - { \ - if(NvClearOrderly() != TPM_RC_SUCCESS) \ - return g_NvStatus; \ - } +#define RETURN_IF_ORDERLY \ + { \ + if(NvClearOrderly() != TPM_RC_SUCCESS) \ + return g_NvStatus; \ + } #define NV_IS_AVAILABLE (g_NvStatus == TPM_RC_SUCCESS) diff --git a/src/tpm2/NV_spt_fp.h b/src/tpm2/NV_spt_fp.h index 201cd2cee..d32021385 100644 --- a/src/tpm2/NV_spt_fp.h +++ b/src/tpm2/NV_spt_fp.h @@ -50,8 +50,7 @@ NvWriteAccessChecks( // not allowed // TPM_RC -NvReadOnlyModeChecks( - TPMA_NV attributes // IN: the attributes of the index to check +NvReadOnlyModeChecks(TPMA_NV attributes // IN: the attributes of the index to check ); //*** NvClearOrderly() diff --git a/src/tpm2/OIDs.h b/src/tpm2/OIDs.h index d2c9bcbb6..735b55ec0 100644 --- a/src/tpm2/OIDs.h +++ b/src/tpm2/OIDs.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* OID values */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: OIDs.h 1628 2020-05-27 19:35:29Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2020 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _OIDS_H_ @@ -182,37 +123,37 @@ SHA3_512_OID(_); #if ALG_RSA # define OID_MGF1_VALUE \ - 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x08 + 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x08 MAKE_OID(_MGF1); # define OID_RSAPSS_VALUE \ - 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0A + 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0A MAKE_OID(_RSAPSS); // This is the OID to designate the public part of an RSA key. # define OID_PKCS1_PUB_VALUE \ - 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01 + 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01 MAKE_OID(_PKCS1_PUB); // These are used for RSA PKCS1 signature Algorithms # define OID_PKCS1_SHA1_VALUE \ - 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x05 + 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x05 SHA1_OID(_PKCS1_); // (1.2.840.113549.1.1.5) # define OID_PKCS1_SHA256_VALUE \ - 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B + 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B SHA256_OID(_PKCS1_); // (1.2.840.113549.1.1.11) # define OID_PKCS1_SHA384_VALUE \ - 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0C + 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0C SHA384_OID(_PKCS1_); // (1.2.840.113549.1.1.12) # define OID_PKCS1_SHA512_VALUE \ - 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0D + 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0D SHA512_OID(_PKCS1_); //(1.2.840.113549.1.1.13) # define OID_PKCS1_SM3_256_VALUE \ - 0x06, 0x08, 0x2A, 0x81, 0x1C, 0xCF, 0x55, 0x01, 0x83, 0x78 + 0x06, 0x08, 0x2A, 0x81, 0x1C, 0xCF, 0x55, 0x01, 0x83, 0x78 SM3_256_OID(_PKCS1_); // 1.2.156.10197.1.504 # define OID_PKCS1_SHA3_256_VALUE NIST_SIG, 14 @@ -230,19 +171,19 @@ SHA3_512_OID(_PKCS1_); SHA1_OID(_ECDSA_); // (1.2.840.10045.4.1) SHA1 digest signed by an ECDSA key. # define OID_ECDSA_SHA256_VALUE \ - 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02 + 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02 SHA256_OID(_ECDSA_); // (1.2.840.10045.4.3.2) SHA256 digest signed by an ECDSA key. # define OID_ECDSA_SHA384_VALUE \ - 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x03 + 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x03 SHA384_OID(_ECDSA_); // (1.2.840.10045.4.3.3) SHA384 digest signed by an ECDSA key. # define OID_ECDSA_SHA512_VALUE \ - 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x04 + 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x04 SHA512_OID(_ECDSA_); // (1.2.840.10045.4.3.4) SHA512 digest signed by an ECDSA key. # define OID_ECDSA_SM3_256_VALUE \ - 0x06, 0x08, 0x2A, 0x81, 0x1C, 0xCF, 0x55, 0x01, 0x83, 0x75 + 0x06, 0x08, 0x2A, 0x81, 0x1C, 0xCF, 0x55, 0x01, 0x83, 0x75 SM3_256_OID(_ECDSA_); // 1.2.156.10197.1.501 # define OID_ECDSA_SHA3_256_VALUE NIST_SIG, 10 @@ -260,7 +201,7 @@ SHA3_512_OID(_ECDSA_); MAKE_OID(_ECC_PUBLIC); # define OID_ECC_NIST_P192_VALUE \ - 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x01 + 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x01 # if ECC_NIST_P192 MAKE_OID(_ECC_NIST_P192); // (1.2.840.10045.3.1.1) 'nistP192' # endif // ECC_NIST_P192 @@ -271,7 +212,7 @@ MAKE_OID(_ECC_NIST_P224); // (1.3.132.0.33) 'nistP224' # endif // ECC_NIST_P224 # define OID_ECC_NIST_P256_VALUE \ - 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07 + 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07 # if ECC_NIST_P256 MAKE_OID(_ECC_NIST_P256); // (1.2.840.10045.3.1.7) 'nistP256' # endif // ECC_NIST_P256 @@ -298,7 +239,7 @@ MAKE_OID(_ECC_BN_P638); # endif // ECC_BN_P638 # define OID_ECC_SM2_P256_VALUE \ - 0x06, 0x08, 0x2A, 0x81, 0x1C, 0xCF, 0x55, 0x01, 0x82, 0x2D + 0x06, 0x08, 0x2A, 0x81, 0x1C, 0xCF, 0x55, 0x01, 0x82, 0x2D # if ECC_SM2_P256 MAKE_OID(_ECC_SM2_P256); // Don't know where I found this OID. It needs checking # endif // ECC_SM2_P256 diff --git a/src/tpm2/PRNG_TestVectors.h b/src/tpm2/PRNG_TestVectors.h index 3ed24ab03..c716a9b53 100644 --- a/src/tpm2/PRNG_TestVectors.h +++ b/src/tpm2/PRNG_TestVectors.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* PRNG Test Vectors */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PRNG_TestVectors.h 1529 2019-11-21 23:29:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _MSBN_DRBG_TEST_VECTORS_H #define _MSBN_DRBG_TEST_VECTORS_H @@ -92,25 +33,25 @@ ReturnedBits = 946f5182 d54510b9 461248f5 71ca06c9 // Entropy is the size of the state. The state is the size of the key // plus the IV. The IV is a block. If Key = 256 and Block = 128 then State = 384 -# define DRBG_TEST_INITIATE_ENTROPY \ - 0x0d, 0x15, 0xaa, 0x80, 0xb1, 0x6c, 0x3a, 0x10, 0x90, 0x6c, 0xfe, 0xdb, 0x79, \ - 0x5d, 0xae, 0x0b, 0x5b, 0x81, 0x04, 0x1c, 0x5c, 0x5b, 0xfa, 0xcb, 0x37, \ - 0x3d, 0x44, 0x40, 0xd9, 0x12, 0x0f, 0x7e, 0x3d, 0x6c, 0xf9, 0x09, 0x86, \ - 0xcf, 0x52, 0xd8, 0x5d, 0x3e, 0x94, 0x7d, 0x8c, 0x06, 0x1f, 0x91 +# define DRBG_TEST_INITIATE_ENTROPY \ + 0x0d, 0x15, 0xaa, 0x80, 0xb1, 0x6c, 0x3a, 0x10, 0x90, 0x6c, 0xfe, 0xdb, 0x79, \ + 0x5d, 0xae, 0x0b, 0x5b, 0x81, 0x04, 0x1c, 0x5c, 0x5b, 0xfa, 0xcb, 0x37, \ + 0x3d, 0x44, 0x40, 0xd9, 0x12, 0x0f, 0x7e, 0x3d, 0x6c, 0xf9, 0x09, 0x86, \ + 0xcf, 0x52, 0xd8, 0x5d, 0x3e, 0x94, 0x7d, 0x8c, 0x06, 0x1f, 0x91 -# define DRBG_TEST_RESEED_ENTROPY \ - 0x6e, 0xe7, 0x93, 0xa3, 0x39, 0x55, 0xd7, 0x2a, 0xd1, 0x2f, 0xd8, 0x0a, 0x8a, \ - 0x3f, 0xcf, 0x95, 0xed, 0x3b, 0x4d, 0xac, 0x57, 0x95, 0xfe, 0x25, 0xcf, \ - 0x86, 0x9f, 0x7c, 0x27, 0x57, 0x3b, 0xbc, 0x56, 0xf1, 0xac, 0xae, 0x13, \ - 0xa6, 0x50, 0x42, 0xb3, 0x40, 0x09, 0x3c, 0x46, 0x4a, 0x7a, 0x22 +# define DRBG_TEST_RESEED_ENTROPY \ + 0x6e, 0xe7, 0x93, 0xa3, 0x39, 0x55, 0xd7, 0x2a, 0xd1, 0x2f, 0xd8, 0x0a, 0x8a, \ + 0x3f, 0xcf, 0x95, 0xed, 0x3b, 0x4d, 0xac, 0x57, 0x95, 0xfe, 0x25, 0xcf, \ + 0x86, 0x9f, 0x7c, 0x27, 0x57, 0x3b, 0xbc, 0x56, 0xf1, 0xac, 0xae, 0x13, \ + 0xa6, 0x50, 0x42, 0xb3, 0x40, 0x09, 0x3c, 0x46, 0x4a, 0x7a, 0x22 -# define DRBG_TEST_GENERATED_INTERM \ - 0x28, 0xe0, 0xeb, 0xb8, 0x21, 0x01, 0x66, 0x50, 0x8c, 0x8f, 0x65, 0xf2, 0x20, \ - 0x7b, 0xd0, 0xa3 +# define DRBG_TEST_GENERATED_INTERM \ + 0x28, 0xe0, 0xeb, 0xb8, 0x21, 0x01, 0x66, 0x50, 0x8c, 0x8f, 0x65, 0xf2, 0x20, \ + 0x7b, 0xd0, 0xa3 -# define DRBG_TEST_GENERATED \ - 0x94, 0x6f, 0x51, 0x82, 0xd5, 0x45, 0x10, 0xb9, 0x46, 0x12, 0x48, 0xf5, 0x71, \ - 0xca, 0x06, 0xc9 +# define DRBG_TEST_GENERATED \ + 0x94, 0x6f, 0x51, 0x82, 0xd5, 0x45, 0x10, 0xb9, 0x46, 0x12, 0x48, 0xf5, 0x71, \ + 0xca, 0x06, 0xc9 #elif DRBG_KEY_SIZE_BITS == 128 /*(NIST test vector) [AES-128 no df] @@ -135,23 +76,23 @@ AdditionalInput = ReturnedBits = b61850decfd7106d44769a8e6e8c1ad4 */ -# define DRBG_TEST_INITIATE_ENTROPY \ - 0x8f, 0xc1, 0x1b, 0xdb, 0x5a, 0xab, 0xb7, 0xe0, 0x93, 0xb6, 0x14, 0x28, 0xe0, \ - 0x90, 0x73, 0x03, 0xcb, 0x45, 0x9f, 0x3b, 0x60, 0x0d, 0xad, 0x87, 0x09, \ - 0x55, 0xf2, 0x2d, 0xa8, 0x0a, 0x44, 0xf8 +# define DRBG_TEST_INITIATE_ENTROPY \ + 0x8f, 0xc1, 0x1b, 0xdb, 0x5a, 0xab, 0xb7, 0xe0, 0x93, 0xb6, 0x14, 0x28, 0xe0, \ + 0x90, 0x73, 0x03, 0xcb, 0x45, 0x9f, 0x3b, 0x60, 0x0d, 0xad, 0x87, 0x09, \ + 0x55, 0xf2, 0x2d, 0xa8, 0x0a, 0x44, 0xf8 -# define DRBG_TEST_RESEED_ENTROPY \ - 0x0c, 0xd5, 0x3c, 0xd5, 0xec, 0xcd, 0x5a, 0x10, 0xd7, 0xea, 0x26, 0x61, 0x11, \ - 0x25, 0x9b, 0x05, 0x57, 0x4f, 0xc6, 0xdd, 0xd8, 0xbe, 0xd8, 0xbd, 0x72, \ - 0x37, 0x8c, 0xf8, 0x2f, 0x1d, 0xba, 0x2a +# define DRBG_TEST_RESEED_ENTROPY \ + 0x0c, 0xd5, 0x3c, 0xd5, 0xec, 0xcd, 0x5a, 0x10, 0xd7, 0xea, 0x26, 0x61, 0x11, \ + 0x25, 0x9b, 0x05, 0x57, 0x4f, 0xc6, 0xdd, 0xd8, 0xbe, 0xd8, 0xbd, 0x72, \ + 0x37, 0x8c, 0xf8, 0x2f, 0x1d, 0xba, 0x2a -# define DRBG_TEST_GENERATED_INTERM \ - 0xdc, 0x3c, 0xf6, 0xbf, 0x5b, 0xd3, 0x41, 0x13, 0x5f, 0x2c, 0x68, 0x11, 0xa1, \ - 0x07, 0x1c, 0x87 +# define DRBG_TEST_GENERATED_INTERM \ + 0xdc, 0x3c, 0xf6, 0xbf, 0x5b, 0xd3, 0x41, 0x13, 0x5f, 0x2c, 0x68, 0x11, 0xa1, \ + 0x07, 0x1c, 0x87 -# define DRBG_TEST_GENERATED \ - 0xb6, 0x18, 0x50, 0xde, 0xcf, 0xd7, 0x10, 0x6d, 0x44, 0x76, 0x9a, 0x8e, 0x6e, \ - 0x8c, 0x1a, 0xd4 +# define DRBG_TEST_GENERATED \ + 0xb6, 0x18, 0x50, 0xde, 0xcf, 0xd7, 0x10, 0x6d, 0x44, 0x76, 0x9a, 0x8e, 0x6e, \ + 0x8c, 0x1a, 0xd4 #endif diff --git a/src/tpm2/ReadOnlyControl_fp.h b/src/tpm2/ReadOnlyControl_fp.h index 2204f45f6..24338b4e3 100644 --- a/src/tpm2/ReadOnlyControl_fp.h +++ b/src/tpm2/ReadOnlyControl_fp.h @@ -10,12 +10,12 @@ typedef struct { TPMI_RH_PLATFORM authHandle; - TPMI_YES_NO state; + TPMI_YES_NO state; } ReadOnlyControl_In; // Response code modifiers # define ReadOnlyControl_authHandle (TPM_RC_H + TPM_RC_1) -# define ReadOnlyControl_state (TPM_RC_P + TPM_RC_1) +# define ReadOnlyControl_state (TPM_RC_P + TPM_RC_1) // Function prototype TPM_RC TPM2_ReadOnlyControl(ReadOnlyControl_In* in); diff --git a/src/tpm2/SecChannel_fp.h b/src/tpm2/SecChannel_fp.h index 80990289f..905ea494a 100644 --- a/src/tpm2/SecChannel_fp.h +++ b/src/tpm2/SecChannel_fp.h @@ -5,7 +5,7 @@ //*** GetTpmSpdmPubKey() // This function is used to get the dummy TPM SPDM public key -void GetTpmSpdmPubKey(TPMT_PUBLIC* tpmPubKey); +void GetTpmSpdmPubKey(TPMT_PUBLIC* tpmPubKey); //*** SpdmCapGetTpmPubKeys() // This function is used to get the 'TPM_PUB_KEY' public keys for GetCapability. @@ -13,26 +13,29 @@ void GetTpmSpdmPubKey(TPMT_PUBLIC* tpmPubKey); // NO no more properties to be reported TPMI_YES_NO SpdmCapGetTpmPubKeys(TPM_PUB_KEY spdmPubKey, // IN: the starting TPM property - UINT32 count, // IN: maximum number of returned properties - TPML_PUB_KEY* pubKeyList // OUT: property list + UINT32 count, // IN: maximum number of returned properties + TPML_PUB_KEY* pubKeyList // OUT: property list ); //*** SpdmCapGetSessionInfo() -// This function is used to get the SPDM session information for GetCapability. +// This function is used to get the SPDM session information for GetCapability. // Return Type: TPMI_YES_NO // NO no more properties to be reported TPMI_YES_NO -SpdmCapGetSessionInfo(TPML_SPDM_SESSION_INFO* spdmSessionInfoList // OUT: property list +SpdmCapGetSessionInfo( + TPML_SPDM_SESSION_INFO* spdmSessionInfoList // OUT: property list ); //*** IsSpdmSessionActive() -// This function indicates whether an SPDM session is active and if so, -// returns the requester and TPM key names associated with the SPDM session. +// This function indicates whether an SPDM session is active and if so, +// returns the requester and TPM key names associated with the SPDM session. // Return Type: BOOL // TRUE(1) SPDM session is active (TPM command is protected by an SPDM session) -BOOL -IsSpdmSessionActive(TPM2B_NAME* reqKeyName, // OUT: the requester key's name associated with the SPDM session - TPM2B_NAME* tpmKeyName // OUT: the TPM key's name associated with the SPDM session +BOOL IsSpdmSessionActive( + TPM2B_NAME* + reqKeyName, // OUT: the requester key's name associated with the SPDM session + TPM2B_NAME* + tpmKeyName // OUT: the TPM key's name associated with the SPDM session ); #endif // _SEC_CHANNEL_FP_H_ diff --git a/src/tpm2/SessionProcess_fp.h b/src/tpm2/SessionProcess_fp.h index 34212022d..6f88a3c2c 100644 --- a/src/tpm2/SessionProcess_fp.h +++ b/src/tpm2/SessionProcess_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -97,16 +39,17 @@ BOOL CompareParametersHash(COMMAND* command, // IN: main parsing structure SESSION* session // IN: session structure with pHash ); -# if SEC_CHANNEL_SUPPORT +#if SEC_CHANNEL_SUPPORT //*** CompareScKeyNameHash() -// This function computes the secure channel key name hash (from the requester and/or TPM key -// used to establish the secure channel session) and compares it to the scKeyNameHash in the +// This function computes the secure channel key name hash (from the requester and/or TPM key +// used to establish the secure channel session) and compares it to the scKeyNameHash in the // session data, returning true if they are equal. -BOOL CompareScKeyNameHash(SESSION* session, // IN: session structure - TPM2B_NAME* reqKeyName, // IN: requester secure channel key name - TPM2B_NAME* tpmKeyName // IN: TPM secure channel key name +BOOL CompareScKeyNameHash( + SESSION* session, // IN: session structure + TPM2B_NAME* reqKeyName, // IN: requester secure channel key name + TPM2B_NAME* tpmKeyName // IN: TPM secure channel key name ); -# endif // SEC_CHANNEL_SUPPORT +#endif // SEC_CHANNEL_SUPPORT //*** ParseSessionBuffer() // This function is the entry function for command session processing. diff --git a/src/tpm2/TpmASN1.h b/src/tpm2/TpmASN1.h index 21934abba..7e737d22c 100644 --- a/src/tpm2/TpmASN1.h +++ b/src/tpm2/TpmASN1.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Macro and Structure Definitions for the X509 Commands and Functions. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the macro and structure definitions for the X509 commands and @@ -116,9 +58,9 @@ #endif // Checks the validity of the size making sure that there is no wrap around -#define CHECK_SIZE(context, length) \ - GOTO_ERROR_UNLESS((((length) + (context)->offset) >= (context)->offset) \ - && (((length) + (context)->offset) <= (context)->size)) +#define CHECK_SIZE(context, length) \ + GOTO_ERROR_UNLESS((((length) + (context)->offset) >= (context)->offset) \ + && (((length) + (context)->offset) <= (context)->size)) #define NEXT_OCTET(context) ((context)->buffer[(context)->offset++]) #define PEEK_NEXT(context) ((context)->buffer[(context)->offset]) diff --git a/src/tpm2/crypto/CryptEcc.h b/src/tpm2/crypto/CryptEcc.h index 58a864c28..66888a586 100644 --- a/src/tpm2/crypto/CryptEcc.h +++ b/src/tpm2/crypto/CryptEcc.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Structure definitions used for ECC */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // @@ -103,7 +45,7 @@ CRYPT_INT_TYPE(ecc, ECC_BITS); #define CRYPT_ECC_NUM(name) CRYPT_INT_VAR(name, ECC_BITS) #define CRYPT_ECC_INITIALIZED(name, initializer) \ - CRYPT_INT_INITIALIZED(name, ECC_BITS, initializer) + CRYPT_INT_INITIALIZED(name, ECC_BITS, initializer) typedef struct TPM_ECC_CURVE_METADATA { diff --git a/src/tpm2/crypto/CryptHash.h b/src/tpm2/crypto/CryptHash.h index 6a18fe5fc..69a71610f 100644 --- a/src/tpm2/crypto/CryptHash.h +++ b/src/tpm2/crypto/CryptHash.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Hash structure definitions */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CryptHash.h 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2021 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This header contains the hash structure definitions used in the TPM code @@ -154,15 +95,15 @@ typedef struct SMAC_STATE # define IF_IMPLEMENTED_SHA3_512(op) #endif -#define FOR_EACH_HASH(op) \ - IF_IMPLEMENTED_SHA1(op) \ - IF_IMPLEMENTED_SHA256(op) \ - IF_IMPLEMENTED_SHA384(op) \ - IF_IMPLEMENTED_SHA512(op) \ - IF_IMPLEMENTED_SM3_256(op) \ - IF_IMPLEMENTED_SHA3_256(op) \ - IF_IMPLEMENTED_SHA3_384(op) \ - IF_IMPLEMENTED_SHA3_512(op) +#define FOR_EACH_HASH(op) \ + IF_IMPLEMENTED_SHA1(op) \ + IF_IMPLEMENTED_SHA256(op) \ + IF_IMPLEMENTED_SHA384(op) \ + IF_IMPLEMENTED_SHA512(op) \ + IF_IMPLEMENTED_SM3_256(op) \ + IF_IMPLEMENTED_SHA3_256(op) \ + IF_IMPLEMENTED_SHA3_384(op) \ + IF_IMPLEMENTED_SHA3_512(op) #define HASH_TYPE(HASH, Hash) tpmHashState##HASH##_t Hash; typedef union @@ -186,7 +127,7 @@ typedef union typedef ANY_HASH_STATE* PANY_HASH_STATE; typedef const ANY_HASH_STATE* PCANY_HASH_STATE; -#define ALIGNED_SIZE(x, b) ((((x) + (b)-1) / (b)) * (b)) +#define ALIGNED_SIZE(x, b) ((((x) + (b) - 1) / (b)) * (b)) // MAX_HASH_STATE_SIZE will change with each implementation. It is assumed that // a hash state will not be larger than twice the block size plus some // overhead (in this case, 16 bytes). The overall size needs to be as @@ -283,20 +224,21 @@ typedef const struct HASH_DEF_STRUCT // Macro to fill in the HASH_DEF for an algorithm. For SHA1, the instance would be: // HASH_DEF_TEMPLATE(Sha1, SHA1) // This handles the difference in capitalization for the various pieces. -#define HASH_DEF_TEMPLATE(HASH, Hash) \ - HASH_DEF Hash##_Def = {{ \ - (HASH_START_METHOD*)&tpmHashStart_##HASH, \ - (HASH_DATA_METHOD*)&tpmHashData_##HASH, \ - (HASH_END_METHOD*)&tpmHashEnd_##HASH, \ - (HASH_STATE_COPY_METHOD*)&tpmHashStateCopy_##HASH, \ - (HASH_STATE_EXPORT_METHOD*)&tpmHashStateExport_##HASH, \ - (HASH_STATE_IMPORT_METHOD*)&tpmHashStateImport_##HASH, \ - }, \ - HASH##_BLOCK_SIZE, /*block size */ \ - HASH##_DIGEST_SIZE, /*data size */ \ - sizeof(tpmHashState##HASH##_t), \ - TPM_ALG_##HASH, \ - OID_##HASH PKCS1_OID(HASH) ECDSA_OID(HASH)}; +#define HASH_DEF_TEMPLATE(HASH, Hash) \ + HASH_DEF Hash##_Def = \ + {{ \ + (HASH_START_METHOD*)&tpmHashStart_##HASH, \ + (HASH_DATA_METHOD*)&tpmHashData_##HASH, \ + (HASH_END_METHOD*)&tpmHashEnd_##HASH, \ + (HASH_STATE_COPY_METHOD*)&tpmHashStateCopy_##HASH, \ + (HASH_STATE_EXPORT_METHOD*)&tpmHashStateExport_##HASH, \ + (HASH_STATE_IMPORT_METHOD*)&tpmHashStateImport_##HASH, \ + }, \ + HASH##_BLOCK_SIZE, /*block size */ \ + HASH##_DIGEST_SIZE, /*data size */ \ + sizeof(tpmHashState##HASH##_t), \ + TPM_ALG_##HASH, \ + OID_##HASH PKCS1_OID(HASH) ECDSA_OID(HASH)}; // These definitions are for the types that can be in a hash state structure. // These types are used in the cryptographic utilities. This is a define rather than diff --git a/src/tpm2/crypto/CryptHash_fp.h b/src/tpm2/crypto/CryptHash_fp.h index 8c9d890a1..97772c2c4 100644 --- a/src/tpm2/crypto/CryptHash_fp.h +++ b/src/tpm2/crypto/CryptHash_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Implementation of cryptographic functions for hashing. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -89,9 +31,10 @@ CryptGetHashDef(TPM_ALG_ID hashAlg); // Return Type: BOOL // TRUE(1) hashAlg is a valid, implemented hash on this TPM // FALSE(0) hashAlg is not valid for this TPM -BOOL CryptHashIsValidAlg(TPM_ALG_ID hashAlg, // IN: the algorithm to check - BOOL isAlgNullValid // IN: TRUE if TPM_ALG_NULL is to be treated - // as a valid hash +BOOL CryptHashIsValidAlg( + TPM_ALG_ID hashAlg, // IN: the algorithm to check + BOOL isAlgNullValid // IN: TRUE if TPM_ALG_NULL is to be treated + // as a valid hash ); //*** CryptHashGetAlgByIndex() diff --git a/src/tpm2/crypto/CryptRand.h b/src/tpm2/crypto/CryptRand.h index c906eda4d..302cd0275 100644 --- a/src/tpm2/crypto/CryptRand.h +++ b/src/tpm2/crypto/CryptRand.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* DRBG with a behavior according to SP800-90A */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains constant definition shared by CryptUtil and the parts @@ -83,14 +25,15 @@ #define DRBG_ALGORITHM TPM_ALG_AES #define DRBG_ENCRYPT_SETUP(key, keySizeInBits, schedule) \ - TpmCryptSetEncryptKeyAES(key, keySizeInBits, schedule) + TpmCryptSetEncryptKeyAES(key, keySizeInBits, schedule) #define DRBG_ENCRYPT(keySchedule, in, out) \ - TpmCryptEncryptAES(SWIZZLE(keySchedule, in, out)) + TpmCryptEncryptAES(SWIZZLE(keySchedule, in, out)) -#if((DRBG_KEY_SIZE_BITS % RADIX_BITS) != 0) || ((DRBG_IV_SIZE_BITS % RADIX_BITS) != 0) +#if ((DRBG_KEY_SIZE_BITS % RADIX_BITS) != 0) \ + || ((DRBG_IV_SIZE_BITS % RADIX_BITS) != 0) # error "Key size and IV for DRBG must be even multiples of the radix" #endif -#if(DRBG_KEY_SIZE_BITS % DRBG_IV_SIZE_BITS) != 0 +#if (DRBG_KEY_SIZE_BITS % DRBG_IV_SIZE_BITS) != 0 # error "Key size for DRBG must be even multiple of the cypher block size" #endif diff --git a/src/tpm2/crypto/CryptRsa.h b/src/tpm2/crypto/CryptRsa.h index a8ee5f8a8..df9e77aeb 100644 --- a/src/tpm2/crypto/CryptRsa.h +++ b/src/tpm2/crypto/CryptRsa.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* RSA-related structures and defines */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This file contains the RSA-related structures and defines. @@ -69,14 +11,14 @@ CRYPT_INT_TYPE(rsa, MAX_RSA_KEY_BITS); #define CRYPT_RSA_VAR(name) CRYPT_INT_VAR(name, MAX_RSA_KEY_BITS) #define CRYPT_RSA_INITIALIZED(name, initializer) \ - CRYPT_INT_INITIALIZED(name, MAX_RSA_KEY_BITS, initializer) + CRYPT_INT_INITIALIZED(name, MAX_RSA_KEY_BITS, initializer) #define CRYPT_PRIME_VAR(name) CRYPT_INT_VAR(name, (MAX_RSA_KEY_BITS / 2)) // define ci_prime_t as buffer containing a CRYPT_INT object with space for // (MAX_RSA_KEY_BITS/2) of actual data. CRYPT_INT_TYPE(prime, (MAX_RSA_KEY_BITS / 2)); #define CRYPT_PRIME_INITIALIZED(name, initializer) \ - CRYPT_INT_INITIALIZED(name, MAX_RSA_KEY_BITS / 2, initializer) + CRYPT_INT_INITIALIZED(name, MAX_RSA_KEY_BITS / 2, initializer) #if !CRT_FORMAT_RSA # error This verson only works with CRT formatted data @@ -93,8 +35,8 @@ typedef struct privateExponent } privateExponent; #define NEW_PRIVATE_EXPONENT(X) \ - privateExponent _##X; \ - privateExponent* X = RsaInitializeExponent(&(_##X)) + privateExponent _##X; \ + privateExponent* X = RsaInitializeExponent(&(_##X)) // libtpms added begin: keep old privateExponent /* The privateExponentOld is part of the OBJECT and we keep it there even though diff --git a/src/tpm2/crypto/openssl/CryptEccKeyExchange.c b/src/tpm2/crypto/openssl/CryptEccKeyExchange.c index 3dbeba8b1..090e825e9 100644 --- a/src/tpm2/crypto/openssl/CryptEccKeyExchange.c +++ b/src/tpm2/crypto/openssl/CryptEccKeyExchange.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Functions that are used for the two-phase, ECC, key-exchange protocols */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the functions that are used for the two-phase, ECC, @@ -90,7 +32,7 @@ static BOOL avf1(Crypt_Int* bnX, // IN/OUT: the reduced value int f = (ExtMath_SizeInBits(bnN) + 1) / 2; // x' = 2^f + (x mod 2^f) ExtMath_MaskBits(bnX, f); // This is mod 2*2^f but it doesn't matter because - // the next operation will SET the extra bit anyway + // the next operation will SET the extra bit anyway if(!ExtMath_SetBit(bnX, f)) { FAIL(FATAL_ERROR_CRYPTO); diff --git a/src/tpm2/crypto/openssl/CryptHash.c b/src/tpm2/crypto/openssl/CryptHash.c index 5c746053e..20f259cfc 100644 --- a/src/tpm2/crypto/openssl/CryptHash.c +++ b/src/tpm2/crypto/openssl/CryptHash.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Implementation of cryptographic functions for hashing. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // @@ -119,9 +61,9 @@ BOOL CryptHashStartup(void) PHASH_DEF CryptGetHashDef(TPM_ALG_ID hashAlg) { -#define GET_DEF(HASH, Hash) \ - case ALG_##HASH##_VALUE: \ - return &Hash##_Def; +#define GET_DEF(HASH, Hash) \ + case ALG_##HASH##_VALUE: \ + return &Hash##_Def; switch(hashAlg) { FOR_EACH_HASH(GET_DEF) @@ -137,9 +79,10 @@ CryptGetHashDef(TPM_ALG_ID hashAlg) // Return Type: BOOL // TRUE(1) hashAlg is a valid, implemented hash on this TPM // FALSE(0) hashAlg is not valid for this TPM -BOOL CryptHashIsValidAlg(TPM_ALG_ID hashAlg, // IN: the algorithm to check - BOOL isAlgNullValid // IN: TRUE if TPM_ALG_NULL is to be treated - // as a valid hash +BOOL CryptHashIsValidAlg( + TPM_ALG_ID hashAlg, // IN: the algorithm to check + BOOL isAlgNullValid // IN: TRUE if TPM_ALG_NULL is to be treated + // as a valid hash ) { if(hashAlg == TPM_ALG_NULL) @@ -258,10 +201,10 @@ void CryptHashExportState( MUST_BE(sizeof(HASH_STATE) <= sizeof(EXPORT_HASH_STATE)); // the following #define is used to move data from an aligned internal data // structure to a byte buffer (external format data. -#define CopyToOffset(value) \ - memcpy(&outBuf[offsetof(HASH_STATE, value)], \ - &internalFmt->value, \ - sizeof(internalFmt->value)) +#define CopyToOffset(value) \ + memcpy(&outBuf[offsetof(HASH_STATE, value)], \ + &internalFmt->value, \ + sizeof(internalFmt->value)) // Copy the hashAlg CopyToOffset(hashAlg); CopyToOffset(type); @@ -295,10 +238,10 @@ void CryptHashImportState( { BYTE* inBuf = (BYTE*)externalFmt; // -#define CopyFromOffset(value) \ - memcpy(&internalFmt->value, \ - &inBuf[offsetof(HASH_STATE, value)], \ - sizeof(internalFmt->value)) +#define CopyFromOffset(value) \ + memcpy(&internalFmt->value, \ + &inBuf[offsetof(HASH_STATE, value)], \ + sizeof(internalFmt->value)) // Copy the hashAlg of the byte-aligned input structure to the structure-aligned // internal structure. diff --git a/src/tpm2/crypto/openssl/CryptRand.c b/src/tpm2/crypto/openssl/CryptRand.c index d2fc789d1..73a722d3d 100644 --- a/src/tpm2/crypto/openssl/CryptRand.c +++ b/src/tpm2/crypto/openssl/CryptRand.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* DRBG with a behavior according to SP800-90A */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file implements a DRBG with a behavior according to SP800-90A using @@ -167,43 +109,42 @@ static void DfStart(PDF_STATE dfState, uint32_t inputLength) { BYTE init[8]; int i; - UINT32 drbgSeedSize = sizeof(DRBG_SEED); - - const BYTE dfKey[DRBG_KEY_SIZE_BYTES] = - { 0x00, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f + UINT32 drbgSeedSize = sizeof(DRBG_SEED); + + const BYTE dfKey[DRBG_KEY_SIZE_BYTES] = {0x00, + 0x01, + 0x02, + 0x03, + 0x04, + 0x05, + 0x06, + 0x07, + 0x08, + 0x09, + 0x0a, + 0x0b, + 0x0c, + 0x0d, + 0x0e, + 0x0f #if DRBG_KEY_SIZE_BYTES > 16 - , - 0x10, - 0x11, - 0x12, - 0x13, - 0x14, - 0x15, - 0x16, - 0x17, - 0x18, - 0x19, - 0x1a, - 0x1b, - 0x1c, - 0x1d, - 0x1e, - 0x1f + , + 0x10, + 0x11, + 0x12, + 0x13, + 0x14, + 0x15, + 0x16, + 0x17, + 0x18, + 0x19, + 0x1a, + 0x1b, + 0x1c, + 0x1d, + 0x1e, + 0x1f #endif }; memset(dfState, 0, sizeof(DF_STATE)); From cd5e791ecd3ae53bd16f17240727e3a45e28d20b Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 6 Aug 2025 14:31:35 -0400 Subject: [PATCH 12/52] Sync: Use clang-format 19.1.4 to reformat sources Signed-off-by: Stefan Berger --- src/tpm2/ACT.h | 95 +++----------- src/tpm2/BnConvert.c | 66 +--------- src/tpm2/BnEccConstants.c | 72 ++--------- src/tpm2/DebugHelpers.c | 65 +--------- src/tpm2/GpMacros.h | 4 +- src/tpm2/Hierarchy.c | 2 +- src/tpm2/MathLibraryInterfaceTypes.h | 118 +++++------------ src/tpm2/NV_spt.c | 26 ++-- src/tpm2/PCR.c | 62 +-------- src/tpm2/PlatformACT.h | 95 +++----------- src/tpm2/PlatformData.h | 66 +--------- src/tpm2/PolicyTransportSPDM.c | 2 +- src/tpm2/ReadOnlyControl.c | 2 +- src/tpm2/SecChannel.c | 78 +++++++----- src/tpm2/SessionProcess.c | 97 ++++---------- src/tpm2/TPMB.h | 80 ++---------- src/tpm2/TpmAlgorithmDefines.h | 82 +++--------- src/tpm2/TpmEcc_Signature_Util.c | 62 +-------- src/tpm2/TpmTypes.h | 26 ++-- src/tpm2/crypto/openssl/BnValues.h | 160 ++++++++---------------- src/tpm2/crypto/openssl/TpmToOsslHash.h | 105 ++++------------ src/tpm2/endian_swap.h | 114 +++++------------ 22 files changed, 312 insertions(+), 1167 deletions(-) diff --git a/src/tpm2/ACT.h b/src/tpm2/ACT.h index cd5b7d1b3..2e75f28cb 100644 --- a/src/tpm2/ACT.h +++ b/src/tpm2/ACT.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Authenticated Countdown Timer */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id$ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _ACT_H_ #define _ACT_H_ @@ -236,23 +177,23 @@ # define TPM_RH_ACT_F (TPM_RH_ACT_0 + 0xF) #endif -#define FOR_EACH_ACT(op) \ - IF_ACT_0_IMPLEMENTED(op) \ - IF_ACT_1_IMPLEMENTED(op) \ - IF_ACT_2_IMPLEMENTED(op) \ - IF_ACT_3_IMPLEMENTED(op) \ - IF_ACT_4_IMPLEMENTED(op) \ - IF_ACT_5_IMPLEMENTED(op) \ - IF_ACT_6_IMPLEMENTED(op) \ - IF_ACT_7_IMPLEMENTED(op) \ - IF_ACT_8_IMPLEMENTED(op) \ - IF_ACT_9_IMPLEMENTED(op) \ - IF_ACT_A_IMPLEMENTED(op) \ - IF_ACT_B_IMPLEMENTED(op) \ - IF_ACT_C_IMPLEMENTED(op) \ - IF_ACT_D_IMPLEMENTED(op) \ - IF_ACT_E_IMPLEMENTED(op) \ - IF_ACT_F_IMPLEMENTED(op) +#define FOR_EACH_ACT(op) \ + IF_ACT_0_IMPLEMENTED(op) \ + IF_ACT_1_IMPLEMENTED(op) \ + IF_ACT_2_IMPLEMENTED(op) \ + IF_ACT_3_IMPLEMENTED(op) \ + IF_ACT_4_IMPLEMENTED(op) \ + IF_ACT_5_IMPLEMENTED(op) \ + IF_ACT_6_IMPLEMENTED(op) \ + IF_ACT_7_IMPLEMENTED(op) \ + IF_ACT_8_IMPLEMENTED(op) \ + IF_ACT_9_IMPLEMENTED(op) \ + IF_ACT_A_IMPLEMENTED(op) \ + IF_ACT_B_IMPLEMENTED(op) \ + IF_ACT_C_IMPLEMENTED(op) \ + IF_ACT_D_IMPLEMENTED(op) \ + IF_ACT_E_IMPLEMENTED(op) \ + IF_ACT_F_IMPLEMENTED(op) // This is the mask for ACT that are implemented //#define ACT_MASK(N) | (1 << 0x##N) diff --git a/src/tpm2/BnConvert.c b/src/tpm2/BnConvert.c index e2bfd3056..7d2d5eefd 100644 --- a/src/tpm2/BnConvert.c +++ b/src/tpm2/BnConvert.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* conversion functions that will convert TPM2B to/from internal format */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the basic conversion functions that will convert TPM2B @@ -99,9 +41,9 @@ LIB_EXPORT bigNum BnFromBytes(bigNum bn, const BYTE* bytes, NUMBYTES nBytes) pTo = (BYTE*)bn->d; for(; nBytes != 0; nBytes--) *pTo++ = *pFrom--; - // For a little-endian machine, the conversion is a straight byte - // reversal. For a big-endian machine, we have to put the words in - // big-endian byte order + // For a little-endian machine, the conversion is a straight byte + // reversal. For a big-endian machine, we have to put the words in + // big-endian byte order #if BIG_ENDIAN_TPM { crypt_word_t t; diff --git a/src/tpm2/BnEccConstants.c b/src/tpm2/BnEccConstants.c index b473d4da9..346632cc0 100644 --- a/src/tpm2/BnEccConstants.c +++ b/src/tpm2/BnEccConstants.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmStructures; Version 4.4 Mar 26, 2019 @@ -94,12 +36,12 @@ # define TO_ECC_640(a, b, c, d, e, f, g, h, i, j) j, i, h, g, f, e, d, c, b, a # define BN_MIN_ALLOC(bytes) \ - (BYTES_TO_CRYPT_WORDS(bytes) == 0) ? 1 : BYTES_TO_CRYPT_WORDS(bytes) -# define ECC_CONST(NAME, bytes, initializer) \ - const struct \ - { \ - crypt_uword_t allocate, size, d[BN_MIN_ALLOC(bytes)]; \ - } NAME = {BN_MIN_ALLOC(bytes), BYTES_TO_CRYPT_WORDS(bytes), {initializer}} + (BYTES_TO_CRYPT_WORDS(bytes) == 0) ? 1 : BYTES_TO_CRYPT_WORDS(bytes) +# define ECC_CONST(NAME, bytes, initializer) \ + const struct \ + { \ + crypt_uword_t allocate, size, d[BN_MIN_ALLOC(bytes)]; \ + } NAME = {BN_MIN_ALLOC(bytes), BYTES_TO_CRYPT_WORDS(bytes), {initializer}} // This file contains the raw data for ECC curve constants. The data is wrapped // in macros so this file can be included in other files that format the data in diff --git a/src/tpm2/DebugHelpers.c b/src/tpm2/DebugHelpers.c index b17f3cba1..2b94bb538 100644 --- a/src/tpm2/DebugHelpers.c +++ b/src/tpm2/DebugHelpers.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Debug Helper */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: DebugHelpers.c 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2021 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // @@ -79,7 +20,7 @@ const char* debugFileName = "DebugFile.txt"; // This exists to allow use of the 'safe' version of fopen() with a MS runtime. static FILE* fileOpen(const char* fn, const char* mode) { - FILE* f; + FILE* f; # if defined _MSC_VER if(fopen_s(&f, fn, mode) != 0) f = NULL; @@ -102,7 +43,7 @@ int DebugFileInit(void) // // Get current date and time. # if defined _MSC_VER - char timeString[100]; + char timeString[100]; ctime_s(timeString, (size_t)sizeof(timeString), &t); # else char* timeString; diff --git a/src/tpm2/GpMacros.h b/src/tpm2/GpMacros.h index 6b86b1f51..7bb981f22 100644 --- a/src/tpm2/GpMacros.h +++ b/src/tpm2/GpMacros.h @@ -263,7 +263,7 @@ } \ } while(0) -#if(defined EMPTY_ASSERT) && (EMPTY_ASSERT != NO) +#if (defined EMPTY_ASSERT) && (EMPTY_ASSERT != NO) # define pAssert(a) ((void)0) #else # define pAssert(a) \ @@ -349,7 +349,7 @@ #include "MinMax.h" #ifndef IsOdd -# define IsOdd(a) (((a)&1) != 0) +# define IsOdd(a) (((a) & 1) != 0) #endif #ifndef BITS_TO_BYTES diff --git a/src/tpm2/Hierarchy.c b/src/tpm2/Hierarchy.c index 3c786381c..de31c7713 100644 --- a/src/tpm2/Hierarchy.c +++ b/src/tpm2/Hierarchy.c @@ -43,7 +43,7 @@ void HierarchyPreInstall_Init(void) gp.EPSeed.t.size = sizeof(gp.EPSeed.t.buffer); gp.SPSeed.t.size = sizeof(gp.SPSeed.t.buffer); gp.PPSeed.t.size = sizeof(gp.PPSeed.t.buffer); -#if(defined USE_PLATFORM_EPS) && (USE_PLATFORM_EPS != NO) +#if (defined USE_PLATFORM_EPS) && (USE_PLATFORM_EPS != NO) _plat__GetEPS(gp.EPSeed.t.size, gp.EPSeed.t.buffer); #else CryptRandomGenerate(gp.EPSeed.t.size, gp.EPSeed.t.buffer); diff --git a/src/tpm2/MathLibraryInterfaceTypes.h b/src/tpm2/MathLibraryInterfaceTypes.h index ba4c00bbe..f9e3cf2eb 100644 --- a/src/tpm2/MathLibraryInterfaceTypes.h +++ b/src/tpm2/MathLibraryInterfaceTypes.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the declaration and initialization macros for @@ -87,58 +29,58 @@ typedef CRYPT_CURVE_BUF(curvebuft, MAX_ECC_KEY_BITS) Crypt_EccCurve; // produces bare typedef ci__t #define CRYPT_INT_TYPE(typename, bits) \ - typedef CRYPT_INT_BUF(ci_##typename##_buf_t, bits) ci_##typename##_t + typedef CRYPT_INT_BUF(ci_##typename##_buf_t, bits) ci_##typename##_t // produces allocated `Crypt_Int* varname` backed by a // stack buffer named `_buf`. Initialization at the discretion of the // ExtMath library. -#define CRYPT_INT_VAR(varname, bits) \ - CRYPT_INT_BUF(ci_##varname##_buf_t, bits) varname##_buf; \ - Crypt_Int* varname = ExtMath_Initialize_Int((Crypt_Int*)&(varname##_buf), bits); +#define CRYPT_INT_VAR(varname, bits) \ + CRYPT_INT_BUF(ci_##varname##_buf_t, bits) varname##_buf; \ + Crypt_Int* varname = ExtMath_Initialize_Int((Crypt_Int*)&(varname##_buf), bits); // produces initialized `Crypt_Int* varname = (TPM2B) initializer` backed by a // stack buffer named `_buf` -#define CRYPT_INT_INITIALIZED(varname, bits, initializer) \ - CRYPT_INT_BUF(cibuf##varname, bits) varname##_buf; \ - Crypt_Int* varname = \ - TpmMath_IntFrom2B(ExtMath_Initialize_Int((Crypt_Int*)&(varname##_buf), bits), \ - (TPM2B*)initializer); +#define CRYPT_INT_INITIALIZED(varname, bits, initializer) \ + CRYPT_INT_BUF(cibuf##varname, bits) varname##_buf; \ + Crypt_Int* varname = TpmMath_IntFrom2B( \ + ExtMath_Initialize_Int((Crypt_Int*)&(varname##_buf), bits), \ + (TPM2B*)initializer); // convenience variants of above: // largest supported integer #define CRYPT_INT_MAX(varname) CRYPT_INT_VAR(varname, LARGEST_NUMBER_BITS) #define CRYPT_INT_MAX_INITIALIZED(name, initializer) \ - CRYPT_INT_INITIALIZED(name, LARGEST_NUMBER_BITS, initializer) + CRYPT_INT_INITIALIZED(name, LARGEST_NUMBER_BITS, initializer) // A single RADIX_BITS value. #define CRYPT_INT_WORD(name) CRYPT_INT_VAR(name, RADIX_BITS) -#define CRYPT_INT_WORD_INITIALIZED(varname, initializer) \ - CRYPT_INT_BUF(cibuf##varname, RADIX_BITS) varname##_buf; \ - Crypt_Int* varname = ExtMath_SetWord( \ - ExtMath_Initialize_Int((Crypt_Int*)&(varname##_buf), RADIX_BITS), \ - initializer); +#define CRYPT_INT_WORD_INITIALIZED(varname, initializer) \ + CRYPT_INT_BUF(cibuf##varname, RADIX_BITS) varname##_buf; \ + Crypt_Int* varname = ExtMath_SetWord( \ + ExtMath_Initialize_Int((Crypt_Int*)&(varname##_buf), RADIX_BITS), \ + initializer); // Crypt_EccCurve underlying types -#define CRYPT_CURVE_INITIALIZED(varname, initializer) \ - CRYPT_CURVE_BUF(cv##varname, MAX_ECC_KEY_BITS) varname##_buf; \ - const Crypt_EccCurve* varname = \ - ExtEcc_CurveInitialize(&(varname##_buf), initializer) +#define CRYPT_CURVE_INITIALIZED(varname, initializer) \ + CRYPT_CURVE_BUF(cv##varname, MAX_ECC_KEY_BITS) varname##_buf; \ + const Crypt_EccCurve* varname = \ + ExtEcc_CurveInitialize(&(varname##_buf), initializer) /* no guarantee free will be called in the presence of longjmp */ #define CRYPT_CURVE_FREE(varname) ExtEcc_CurveFree(varname) // Crypt_Point underlying types -#define CRYPT_POINT_VAR(varname) \ - CRYPT_POINT_BUF(cp_##varname##_buf_t, MAX_ECC_KEY_BITS) varname##_buf; \ - Crypt_Point* varname = \ - ExtEcc_Initialize_Point((Crypt_Point*)&(varname##_buf), MAX_ECC_KEY_BITS); - -#define CRYPT_POINT_INITIALIZED(varname, initValue) \ - CRYPT_POINT_BUF(cp_##varname##_buf_t, MAX_ECC_KEY_BITS) varname##_buf; \ - Crypt_Point* varname = TpmEcc_PointFrom2B( \ - ExtEcc_Initialize_Point((Crypt_Point*)&(varname##_buf), MAX_ECC_KEY_BITS), \ - initValue); +#define CRYPT_POINT_VAR(varname) \ + CRYPT_POINT_BUF(cp_##varname##_buf_t, MAX_ECC_KEY_BITS) varname##_buf; \ + Crypt_Point* varname = \ + ExtEcc_Initialize_Point((Crypt_Point*)&(varname##_buf), MAX_ECC_KEY_BITS); + +#define CRYPT_POINT_INITIALIZED(varname, initValue) \ + CRYPT_POINT_BUF(cp_##varname##_buf_t, MAX_ECC_KEY_BITS) varname##_buf; \ + Crypt_Point* varname = TpmEcc_PointFrom2B( \ + ExtEcc_Initialize_Point((Crypt_Point*)&(varname##_buf), MAX_ECC_KEY_BITS), \ + initValue); #endif //MATH_LIBRARY_INTERFACE_TYPES_H diff --git a/src/tpm2/NV_spt.c b/src/tpm2/NV_spt.c index 8d34b1772..636296016 100644 --- a/src/tpm2/NV_spt.c +++ b/src/tpm2/NV_spt.c @@ -107,19 +107,18 @@ NvWriteAccessChecks( // not allowed // TPM_RC -NvReadOnlyModeChecks( - TPMA_NV attributes // IN: the attributes of the index to check +NvReadOnlyModeChecks(TPMA_NV attributes // IN: the attributes of the index to check ) { -# if CC_ReadOnlyControl +#if CC_ReadOnlyControl // When in Read-Only mode only allow the commands listed above on an // index with the ORDERLY and CLEAR_STCLEAR attributes set - if(gc.readOnly && - !(IS_ATTRIBUTE(attributes, TPMA_NV, ORDERLY) && - IS_ATTRIBUTE(attributes, TPMA_NV, CLEAR_STCLEAR))) + if(gc.readOnly + && !(IS_ATTRIBUTE(attributes, TPMA_NV, ORDERLY) + && IS_ATTRIBUTE(attributes, TPMA_NV, CLEAR_STCLEAR))) return TPM_RC_READ_ONLY; -# endif // CC_ReadOnlyControl +#endif // CC_ReadOnlyControl return TPM_RC_SUCCESS; } @@ -142,9 +141,8 @@ NvClearOrderly(void) // Return Type: BOOL // TRUE(1) 'index' is found // FALSE(0) 'index' is not found or not an NV index handle -static BOOL GetIndexAttributesByHandle( - TPM_HANDLE index, // IN: index handle - TPMA_NV* attributes // OUT: index attributes +static BOOL GetIndexAttributesByHandle(TPM_HANDLE index, // IN: index handle + TPMA_NV* attributes // OUT: index attributes ) { if(HandleGetType(index) == TPM_HT_NV_INDEX) @@ -168,8 +166,8 @@ BOOL NvIsPinPassIndex(TPM_HANDLE index // IN: Handle to check ) { TPMA_NV attributes; - return GetIndexAttributesByHandle(index, &attributes) && - IsNvPinPassIndex(attributes); + return GetIndexAttributesByHandle(index, &attributes) + && IsNvPinPassIndex(attributes); } //*** NvIsPinCountedIndex() @@ -182,8 +180,8 @@ BOOL NvIsPinCountedIndex(TPM_HANDLE index // IN: Handle to check ) { TPMA_NV attributes; - return GetIndexAttributesByHandle(index, &attributes) && - (IsNvPinPassIndex(attributes) || IsNvPinFailIndex(attributes)); + return GetIndexAttributesByHandle(index, &attributes) + && (IsNvPinPassIndex(attributes) || IsNvPinFailIndex(attributes)); } //*** NvGetIndexName() diff --git a/src/tpm2/PCR.c b/src/tpm2/PCR.c index 4b2dd9805..313b83d01 100644 --- a/src/tpm2/PCR.c +++ b/src/tpm2/PCR.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* PCR access and manipulation */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // @@ -993,7 +935,7 @@ PCRAllocate(TPML_PCR_SELECTION* allocate, // IN: required allocation newAllocate.pcrSelections[i].sizeofSelect); #else // if DRTM PCR is not required, indicate that the allocation is OK - pcrDrtm = TRUE; + pcrDrtm = TRUE; #endif #if defined(HCRTM_PCR) diff --git a/src/tpm2/PlatformACT.h b/src/tpm2/PlatformACT.h index 8ffd0ba91..86f1fc3e2 100644 --- a/src/tpm2/PlatformACT.h +++ b/src/tpm2/PlatformACT.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Platform Authenticated Countdown Timer */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PlatformACT.h 1531 2019-11-21 23:54:38Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This file contains the definitions for the ACT macros and data types used in the // ACT implementation. @@ -187,22 +128,22 @@ typedef struct ACT_DATA # define IF_ACT_F_IMPLEMENTED(op) op(F) #endif -#define FOR_EACH_ACT(op) \ - IF_ACT_0_IMPLEMENTED(op) \ - IF_ACT_1_IMPLEMENTED(op) \ - IF_ACT_2_IMPLEMENTED(op) \ - IF_ACT_3_IMPLEMENTED(op) \ - IF_ACT_4_IMPLEMENTED(op) \ - IF_ACT_5_IMPLEMENTED(op) \ - IF_ACT_6_IMPLEMENTED(op) \ - IF_ACT_7_IMPLEMENTED(op) \ - IF_ACT_8_IMPLEMENTED(op) \ - IF_ACT_9_IMPLEMENTED(op) \ - IF_ACT_A_IMPLEMENTED(op) \ - IF_ACT_B_IMPLEMENTED(op) \ - IF_ACT_C_IMPLEMENTED(op) \ - IF_ACT_D_IMPLEMENTED(op) \ - IF_ACT_E_IMPLEMENTED(op) \ - IF_ACT_F_IMPLEMENTED(op) +#define FOR_EACH_ACT(op) \ + IF_ACT_0_IMPLEMENTED(op) \ + IF_ACT_1_IMPLEMENTED(op) \ + IF_ACT_2_IMPLEMENTED(op) \ + IF_ACT_3_IMPLEMENTED(op) \ + IF_ACT_4_IMPLEMENTED(op) \ + IF_ACT_5_IMPLEMENTED(op) \ + IF_ACT_6_IMPLEMENTED(op) \ + IF_ACT_7_IMPLEMENTED(op) \ + IF_ACT_8_IMPLEMENTED(op) \ + IF_ACT_9_IMPLEMENTED(op) \ + IF_ACT_A_IMPLEMENTED(op) \ + IF_ACT_B_IMPLEMENTED(op) \ + IF_ACT_C_IMPLEMENTED(op) \ + IF_ACT_D_IMPLEMENTED(op) \ + IF_ACT_E_IMPLEMENTED(op) \ + IF_ACT_F_IMPLEMENTED(op) #endif // _PLATFORM_ACT_H_ diff --git a/src/tpm2/PlatformData.h b/src/tpm2/PlatformData.h index a53d79012..fa796929e 100644 --- a/src/tpm2/PlatformData.h +++ b/src/tpm2/PlatformData.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Instance data for the Platform module. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PlatformData.h 1529 2019-11-21 23:29:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This file contains the instance data for the Platform module. It is collected // in this file so that the state of the module is easier to manage. @@ -119,16 +60,17 @@ EXTERN unsigned char s_locality; // If this macro is defined, then a file is used as NV. If it is not defined, // then RAM is used to back NV memory. Comment out to use RAM. -#if(!defined VTPM) || ((VTPM != NO) && (VTPM != YES)) +#if (!defined VTPM) || ((VTPM != NO) && (VTPM != YES)) # undef VTPM # define VTPM NO // Default: Either YES or NO libtpms: NO #endif // For a simulation, use a file to back up the NV -#if(!defined FILE_BACKED_NV) || ((FILE_BACKED_NV != NO) && (FILE_BACKED_NV != YES)) +#if (!defined FILE_BACKED_NV) || ((FILE_BACKED_NV != NO) && (FILE_BACKED_NV != YES)) # undef FILE_BACKED_NV # define FILE_BACKED_NV (VTPM && YES) // Default: Either YES or NO #endif + #if !SIMULATION # undef FILE_BACKED_NV # define FILE_BACKED_NV YES // libtpms: write NvChip file if no callbacks are set diff --git a/src/tpm2/PolicyTransportSPDM.c b/src/tpm2/PolicyTransportSPDM.c index 421d55d2f..e51aa48d0 100644 --- a/src/tpm2/PolicyTransportSPDM.c +++ b/src/tpm2/PolicyTransportSPDM.c @@ -123,7 +123,7 @@ TPM2_PolicyTransportSPDM(PolicyTransportSPDM_In* in // IN: input parameter list CryptHashEnd2B(&hashState, &session->u2.policyDigest.b); // Update session context - session->attributes.checkSecureChannel = SET; + session->attributes.checkSecureChannel = SET; if(in->reqKeyName.t.size != 0) { session->attributes.checkReqKey = SET; diff --git a/src/tpm2/ReadOnlyControl.c b/src/tpm2/ReadOnlyControl.c index 9daa9f0e6..4fef83a8b 100644 --- a/src/tpm2/ReadOnlyControl.c +++ b/src/tpm2/ReadOnlyControl.c @@ -20,7 +20,7 @@ TPM2_ReadOnlyControl(ReadOnlyControl_In* in // IN: input parameter list // modify the read-only state gc.readOnly = in->state; - + // orderly state should be cleared because of the update to state clear data // This gets processed in ExecuteCommand() on the way out. g_clearOrderly = TRUE; diff --git a/src/tpm2/SecChannel.c b/src/tpm2/SecChannel.c index c2db9ad47..2f122862b 100644 --- a/src/tpm2/SecChannel.c +++ b/src/tpm2/SecChannel.c @@ -2,9 +2,13 @@ #include "Tpm.h" -# if SEC_CHANNEL_SUPPORT -// Dummy requester key name -const TPM2B_NAME dummy_reqKeyName = +#if SEC_CHANNEL_SUPPORT + +// clang format turns this into one byte per line?! don't format this array. +// clang-format off + +// Dummy requester key name +const TPM2B_NAME dummy_reqKeyName = {{ 0x0032, // size // name @@ -13,28 +17,31 @@ const TPM2B_NAME dummy_reqKeyName = // digest 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 } }}; +// clang-format on + //*** GetTpmSpdmPubKey() // This function is used to get the dummy TPM SPDM public key void GetTpmSpdmPubKey(TPMT_PUBLIC* tpmPubKey) { - tpmPubKey->type = TPM_ALG_ECC; + tpmPubKey->type = TPM_ALG_ECC; tpmPubKey->nameAlg = TPM_ALG_SHA384; - tpmPubKey->objectAttributes = 0x00050032; // fixedTPM | fixedParent | sensitiveDataOrigin | restricted | sign; - tpmPubKey->authPolicy.t.size = 0; - tpmPubKey->parameters.eccDetail.symmetric.algorithm = TPM_ALG_NULL; - tpmPubKey->parameters.eccDetail.scheme.scheme = TPM_ALG_ECDSA; - tpmPubKey->parameters.eccDetail.scheme.details.ecdsa.hashAlg = TPM_ALG_SHA384; - tpmPubKey->parameters.eccDetail.curveID = TPM_ECC_NIST_P384; - tpmPubKey->parameters.eccDetail.kdf.scheme = TPM_ALG_NULL; - tpmPubKey->unique.ecc.x.t.size = 0x0030; - tpmPubKey->unique.ecc.y.t.size = 0x0030; + tpmPubKey->objectAttributes = + 0x00050032; // fixedTPM | fixedParent | sensitiveDataOrigin | restricted | sign; + tpmPubKey->authPolicy.t.size = 0; + tpmPubKey->parameters.eccDetail.symmetric.algorithm = TPM_ALG_NULL; + tpmPubKey->parameters.eccDetail.scheme.scheme = TPM_ALG_ECDSA; + tpmPubKey->parameters.eccDetail.scheme.details.ecdsa.hashAlg = TPM_ALG_SHA384; + tpmPubKey->parameters.eccDetail.curveID = TPM_ECC_NIST_P384; + tpmPubKey->parameters.eccDetail.kdf.scheme = TPM_ALG_NULL; + tpmPubKey->unique.ecc.x.t.size = 0x0030; + tpmPubKey->unique.ecc.y.t.size = 0x0030; // For the dummy key, use x and y buffer all zeros memset(tpmPubKey->unique.ecc.x.t.buffer, 0, tpmPubKey->unique.ecc.x.t.size); - memset(tpmPubKey->unique.ecc.y.t.buffer, 0, tpmPubKey->unique.ecc.y.t.size); + memset(tpmPubKey->unique.ecc.y.t.buffer, 0, tpmPubKey->unique.ecc.y.t.size); } //*** SpdmCapGetTpmPubKeys() @@ -43,66 +50,69 @@ void GetTpmSpdmPubKey(TPMT_PUBLIC* tpmPubKey) // NO no more properties to be reported TPMI_YES_NO SpdmCapGetTpmPubKeys(TPM_PUB_KEY spdmPubKey, // IN: the starting TPM property - UINT32 count, // IN: maximum number of returned properties - TPML_PUB_KEY* pubKeyList // OUT: property list + UINT32 count, // IN: maximum number of returned properties + TPML_PUB_KEY* pubKeyList // OUT: property list ) { TPMI_YES_NO more = NO; // This reference implementation does not implement SPDM functionality and returns a single dummy TPM SPDM public key pubKeyList->count = 1; - GetTpmSpdmPubKey(&pubKeyList->pubKeys[0].publicArea); + GetTpmSpdmPubKey(&pubKeyList->pubKeys[0].publicArea); pubKeyList->pubKeys[0].size = sizeof(TPMT_PUBLIC); return more; } //*** SpdmCapGetSessionInfo() -// This function is used to get the SPDM session information for GetCapability. +// This function is used to get the SPDM session information for GetCapability. // This list has only one element. // Return Type: TPMI_YES_NO // NO no more properties to be reported TPMI_YES_NO -SpdmCapGetSessionInfo(TPML_SPDM_SESSION_INFO* spdmSessionInfoList // OUT: property list +SpdmCapGetSessionInfo( + TPML_SPDM_SESSION_INFO* spdmSessionInfoList // OUT: property list ) { TPMI_YES_NO more = NO; // This reference implementation does not implement SPDM messages // This function returns dummy SPDM session info - TPMS_SPDM_SESSION_INFO* spdmSessionInfo = &spdmSessionInfoList->spdmSessionInfo[0]; - - if(IsSpdmSessionActive(&spdmSessionInfo->reqKeyName, &spdmSessionInfo->tpmKeyName)) + TPMS_SPDM_SESSION_INFO* spdmSessionInfo = + &spdmSessionInfoList->spdmSessionInfo[0]; + + if(IsSpdmSessionActive(&spdmSessionInfo->reqKeyName, + &spdmSessionInfo->tpmKeyName)) spdmSessionInfoList->count = 1; else - // If GetCapability is not sent within an SPDM session, an Empty List is returned + // If GetCapability is not sent within an SPDM session, an Empty List is returned spdmSessionInfoList->count = 0; return more; } //*** IsSpdmSessionActive() -// This function indicates whether an SPDM session is active and if so, -// returns the requester and TPM key names associated with the SPDM session. +// This function indicates whether an SPDM session is active and if so, +// returns the requester and TPM key names associated with the SPDM session. // Return Type: BOOL // TRUE(1) SPDM session is active (TPM command is protected by an SPDM session) -BOOL -IsSpdmSessionActive(TPM2B_NAME* reqKeyName, // OUT: the requester key's name associated with the SPDM session - TPM2B_NAME* tpmKeyName // OUT: the TPM key's name associated with the SPDM session +BOOL IsSpdmSessionActive( + TPM2B_NAME* + reqKeyName, // OUT: the requester key's name associated with the SPDM session + TPM2B_NAME* + tpmKeyName // OUT: the TPM key's name associated with the SPDM session ) { TPMT_PUBLIC tpmPubKey; // This reference implementation does not implement SPDM messages // This function returns always TRUE and returns dummy requester and TPM key names - MemoryCopy2B(&reqKeyName->b, - &dummy_reqKeyName.b, - sizeof(dummy_reqKeyName)); + MemoryCopy2B(&reqKeyName->b, &dummy_reqKeyName.b, sizeof(dummy_reqKeyName)); // Get TPM SPDM pub key and compute its name - GetTpmSpdmPubKey(&tpmPubKey); + GetTpmSpdmPubKey(&tpmPubKey); PublicMarshalAndComputeName(&tpmPubKey, tpmKeyName); return TRUE; } -# endif // SEC_CHANNEL_SUPPORT +#endif // SEC_CHANNEL_SUPPORT diff --git a/src/tpm2/SessionProcess.c b/src/tpm2/SessionProcess.c index aac951e68..ab53946ff 100644 --- a/src/tpm2/SessionProcess.c +++ b/src/tpm2/SessionProcess.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Process the Authorization Sessions */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the subsystem that process the authorization sessions @@ -71,9 +13,9 @@ #include "Tpm.h" #include "ACT.h" #include "Marshal.h" -# if SEC_CHANNEL_SUPPORT -#include "SecChannel_fp.h" -# endif // SEC_CHANNEL_SUPPORT +#if SEC_CHANNEL_SUPPORT +# include "SecChannel_fp.h" +#endif // SEC_CHANNEL_SUPPORT // //** Authorization Support Functions @@ -751,19 +693,20 @@ BOOL CompareParametersHash(COMMAND* command, // IN: main parsing structure return MemoryEqual2B(&session->u1.pHash.b, &pHash.b); } -# if SEC_CHANNEL_SUPPORT +#if SEC_CHANNEL_SUPPORT //*** CompareScKeyNameHash() -// This function computes the secure channel key name hash (from the requester and/or TPM key -// used to establish the secure channel session) and compares it to the scKeyNameHash in the +// This function computes the secure channel key name hash (from the requester and/or TPM key +// used to establish the secure channel session) and compares it to the scKeyNameHash in the // session data, returning true if they are equal. -BOOL CompareScKeyNameHash(SESSION* session, // IN: session structure - TPM2B_NAME* reqKeyName, // IN: requester secure channel key name - TPM2B_NAME* tpmKeyName // IN: TPM secure channel key name +BOOL CompareScKeyNameHash( + SESSION* session, // IN: session structure + TPM2B_NAME* reqKeyName, // IN: requester secure channel key name + TPM2B_NAME* tpmKeyName // IN: TPM secure channel key name ) { HASH_STATE hashState; TPM2B_DIGEST scKeyNameHash; - UINT16 zeroSize = 0x0000; + UINT16 zeroSize = 0x0000; // Compute secure channel key name hash // scKeyNameHash = hash(reqKeyName.size || reqKeyName.name || tpmKeyName.size || tpmKeyName.name) @@ -804,10 +747,11 @@ BOOL CompareScKeyNameHash(SESSION* session, // IN: session structure CryptHashEnd2B(&hashState, &scKeyNameHash.b); // and compare - return MemoryEqual( - session->scKeyNameHash.t.buffer, scKeyNameHash.t.buffer, scKeyNameHash.t.size); + return MemoryEqual(session->scKeyNameHash.t.buffer, + scKeyNameHash.t.buffer, + scKeyNameHash.t.size); } -# endif // SEC_CHANNEL_SUPPORT +#endif // SEC_CHANNEL_SUPPORT //*** CheckPWAuthSession() // This function validates the authorization provided in a PWAP session. It @@ -1179,25 +1123,26 @@ static TPM_RC CheckPolicyAuthSession( != (session->attributes.nvWrittenState == SET)) return TPM_RC_POLICY_FAIL; } -# if SEC_CHANNEL_SUPPORT +#if SEC_CHANNEL_SUPPORT if(session->attributes.checkSecureChannel) { TPM2B_NAME reqKeyName; TPM2B_NAME tpmKeyName; - // Check that the authorized TPM command is protected by an SPDM session and + // Check that the authorized TPM command is protected by an SPDM session and // if so, get the names of the associated requester and TPM key if(!IsSpdmSessionActive(&reqKeyName, &tpmKeyName)) return TPM_RC_CHANNEL; // If required, check the requester or TPM secure channel key name by comparing scKeyNameHash - if(session->attributes.checkReqKey == SET || session->attributes.checkTpmKey == SET) + if(session->attributes.checkReqKey == SET + || session->attributes.checkTpmKey == SET) { if(!CompareScKeyNameHash(session, &reqKeyName, &tpmKeyName)) return TPM_RC_CHANNEL_KEY; } } -# endif // SEC_CHANNEL_SUPPORT +#endif // SEC_CHANNEL_SUPPORT return TPM_RC_SUCCESS; } diff --git a/src/tpm2/TPMB.h b/src/tpm2/TPMB.h index 28ac3f812..95c95104d 100644 --- a/src/tpm2/TPMB.h +++ b/src/tpm2/TPMB.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* This file contains extra TPM2B structures */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // // This file contains extra TPM2B structures @@ -81,16 +23,16 @@ typedef const TPM2B* PC2B; // This macro helps avoid having to type in the structure in order to create // a new TPM2B type that is used in a function. -#define TPM2B_TYPE(name, bytes) \ - typedef union \ - { \ - struct \ - { \ - NUMBYTES size; \ - BYTE buffer[(bytes)]; \ - } t; \ - TPM2B b; \ - } TPM2B_##name +#define TPM2B_TYPE(name, bytes) \ + typedef union \ + { \ + struct \ + { \ + NUMBYTES size; \ + BYTE buffer[(bytes)]; \ + } t; \ + TPM2B b; \ + } TPM2B_##name // This macro defines a TPM2B with a constant character value. This macro // sets the size of the string to the size minus the terminating zero byte. diff --git a/src/tpm2/TpmAlgorithmDefines.h b/src/tpm2/TpmAlgorithmDefines.h index e03030a9d..f1d31163c 100644 --- a/src/tpm2/TpmAlgorithmDefines.h +++ b/src/tpm2/TpmAlgorithmDefines.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Algorithm Values from the TCG Algorithm Registry */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT @@ -122,14 +64,20 @@ # define CURVE_448_KEY_SIZE 448 // Derived ECC Value -# define ECC_CURVES \ - { \ - TPM_ECC_NIST_P192, TPM_ECC_NIST_P224, TPM_ECC_NIST_P256, \ - TPM_ECC_NIST_P384, TPM_ECC_NIST_P521, TPM_ECC_BN_P256, \ - TPM_ECC_BN_P638, TPM_ECC_SM2_P256, TPM_ECC_BP_P256_R1, \ - TPM_ECC_BP_P384_R1, TPM_ECC_BP_P512_R1, TPM_ECC_CURVE_25519, \ - TPM_ECC_CURVE_448 \ - } +# define ECC_CURVES \ + {TPM_ECC_NIST_P192, \ + TPM_ECC_NIST_P224, \ + TPM_ECC_NIST_P256, \ + TPM_ECC_NIST_P384, \ + TPM_ECC_NIST_P521, \ + TPM_ECC_BN_P256, \ + TPM_ECC_BN_P638, \ + TPM_ECC_SM2_P256, \ + TPM_ECC_BP_P256_R1, \ + TPM_ECC_BP_P384_R1, \ + TPM_ECC_BP_P512_R1, \ + TPM_ECC_CURVE_25519, \ + TPM_ECC_CURVE_448} # define ECC_CURVE_COUNT \ (ECC_NIST_P192 + ECC_NIST_P224 + ECC_NIST_P256 + ECC_NIST_P384 + ECC_NIST_P521 \ diff --git a/src/tpm2/TpmEcc_Signature_Util.c b/src/tpm2/TpmEcc_Signature_Util.c index b599d4062..10ed6c369 100644 --- a/src/tpm2/TpmEcc_Signature_Util.c +++ b/src/tpm2/TpmEcc_Signature_Util.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // functions shared by multiple signature algorithms #include "Tpm.h" @@ -64,7 +6,7 @@ #include "TpmMath_Debug_fp.h" #include "TpmMath_Util_fp.h" -#if(ALG_ECC && (ALG_ECSCHNORR || ALG_ECDAA)) +#if (ALG_ECC && (ALG_ECSCHNORR || ALG_ECDAA)) //*** TpmEcc_SchnorrCalculateS() // This contains the Schnorr signature (S) computation. It is used by both ECDAA and diff --git a/src/tpm2/TpmTypes.h b/src/tpm2/TpmTypes.h index 522b01591..da47d5f7d 100644 --- a/src/tpm2/TpmTypes.h +++ b/src/tpm2/TpmTypes.h @@ -1547,13 +1547,13 @@ typedef struct TPMA_ACT attributes; } TPMS_ACT_DATA; -# if SEC_CHANNEL_SUPPORT +#if SEC_CHANNEL_SUPPORT typedef struct { // (Part 2: Structures) TPM2B_NAME reqKeyName; TPM2B_NAME tpmKeyName; } TPMS_SPDM_SESSION_INFO; -# endif // SEC_CHANNEL_SUPPORT +#endif // SEC_CHANNEL_SUPPORT typedef struct { // (Part 2: Structures) @@ -1633,13 +1633,13 @@ typedef struct TPMS_ACT_DATA actData[MAX_ACT_DATA]; } TPML_ACT_DATA; -# if SEC_CHANNEL_SUPPORT +#if SEC_CHANNEL_SUPPORT typedef struct { // (Part 2: Structures) UINT32 count; TPMS_SPDM_SESSION_INFO spdmSessionInfo[MAX_SPDM_SESS_INFO]; } TPML_SPDM_SESSION_INFO; -# endif // SEC_CHANNEL_SUPPORT +#endif // SEC_CHANNEL_SUPPORT typedef struct { // (Part 2: Structures) @@ -2374,13 +2374,13 @@ typedef struct TPMT_PUBLIC publicArea; } TPM2B_PUBLIC; -# if SEC_CHANNEL_SUPPORT +#if SEC_CHANNEL_SUPPORT typedef struct { // (Part 2: Structures) UINT32 count; TPM2B_PUBLIC pubKeys[MAX_PUB_KEYS]; } TPML_PUB_KEY; -# endif // SEC_CHANNEL_SUPPORT +#endif // SEC_CHANNEL_SUPPORT typedef union { // (Part 2: Structures) @@ -2393,14 +2393,14 @@ typedef union TPML_TAGGED_TPM_PROPERTY tpmProperties; TPML_TAGGED_PCR_PROPERTY pcrProperties; #if ALG_ECC - TPML_ECC_CURVE eccCurves; + TPML_ECC_CURVE eccCurves; #endif // ALG_ECC - TPML_TAGGED_POLICY authPolicies; - TPML_ACT_DATA actData; -# if SEC_CHANNEL_SUPPORT - TPML_PUB_KEY pubKeys; - TPML_SPDM_SESSION_INFO spdmSessionInfo; -# endif // SEC_CHANNEL_SUPPORT + TPML_TAGGED_POLICY authPolicies; + TPML_ACT_DATA actData; +#if SEC_CHANNEL_SUPPORT + TPML_PUB_KEY pubKeys; + TPML_SPDM_SESSION_INFO spdmSessionInfo; +#endif // SEC_CHANNEL_SUPPORT } TPMU_CAPABILITIES; typedef struct diff --git a/src/tpm2/crypto/openssl/BnValues.h b/src/tpm2/crypto/openssl/BnValues.h index afbae7e3d..0f05db68a 100644 --- a/src/tpm2/crypto/openssl/BnValues.h +++ b/src/tpm2/crypto/openssl/BnValues.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* For defining the internal BIGNUM structure */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction @@ -93,12 +35,12 @@ // specific format without too much difficulty. For the math performed using // these numbers, the value is always positive. #define BN_STRUCT_DEF(struct_type, count) \ - struct st_##struct_type##_t \ - { \ - crypt_uword_t allocated; \ - crypt_uword_t size; \ - crypt_uword_t d[count + BN_PAD + BN_PAD + BN_PAD]; /* libtpms changed */ \ - } + struct st_##struct_type##_t \ + { \ + crypt_uword_t allocated; \ + crypt_uword_t size; \ + crypt_uword_t d[count + BN_PAD + BN_PAD + BN_PAD]; /* libtpms changed */ \ + } typedef BN_STRUCT_DEF(bnroot, 1) bignum_t; @@ -129,7 +71,7 @@ extern const bignum_t BnConstZero; // Test to see if a bignum_t is equal to a word type #define BnEqualWord(bn, word) \ - ((BnGetSize(bn) == 1) && (BnGetWord(bn, 0) == (crypt_uword_t)word)) + ((BnGetSize(bn) == 1) && (BnGetWord(bn, 0) == (crypt_uword_t)word)) // Determine if a bigNum is even. A zero is even. Although the // indication that a number is zero is that its size is zero, @@ -143,24 +85,24 @@ extern const bignum_t BnConstZero; // This will call the initialization function for a defined bignum_t. // This sets the allocated and used fields and clears the words of 'n'. #define BN_INIT(name) \ - (bigNum) BnInit((bigNum) & (name), BYTES_TO_CRYPT_WORDS(sizeof(name.d))) + (bigNum) BnInit((bigNum) & (name), BYTES_TO_CRYPT_WORDS(sizeof(name.d))) #define CRYPT_WORDS(bytes) BYTES_TO_CRYPT_WORDS(bytes) #define MIN_ALLOC(bytes) (CRYPT_WORDS(bytes) < 1 ? 1 : CRYPT_WORDS(bytes)) #define BN_CONST(name, bytes, initializer) \ - typedef const struct name##_type \ - { \ - crypt_uword_t allocated; \ - crypt_uword_t size; \ - crypt_uword_t d[MIN_ALLOC(bytes)]; \ - } name##_type; \ - name##_type name = {MIN_ALLOC(bytes), CRYPT_WORDS(bytes), {initializer}}; + typedef const struct name##_type \ + { \ + crypt_uword_t allocated; \ + crypt_uword_t size; \ + crypt_uword_t d[MIN_ALLOC(bytes)]; \ + } name##_type; \ + name##_type name = {MIN_ALLOC(bytes), CRYPT_WORDS(bytes), {initializer}}; #define BN_STRUCT_ALLOCATION(bits) (BITS_TO_CRYPT_WORDS(bits) + 1) // Create a structure of the correct size. #define BN_STRUCT(struct_type, bits) \ - BN_STRUCT_DEF(struct_type, BN_STRUCT_ALLOCATION(bits)) + BN_STRUCT_DEF(struct_type, BN_STRUCT_ALLOCATION(bits)) // Define a bigNum type with a specific allocation #define BN_TYPE(name, bits) typedef BN_STRUCT(name, bits) bn_##name##_t @@ -168,19 +110,19 @@ extern const bignum_t BnConstZero; // This creates a local bigNum variable of a specific size and // initializes it from a TPM2B input parameter. #define BN_INITIALIZED(name, bits, initializer) \ - BN_STRUCT(name, bits) name##_; \ - bigNum name = TpmMath_IntFrom2B(BN_INIT(name##_), (const TPM2B*)initializer) + BN_STRUCT(name, bits) name##_; \ + bigNum name = TpmMath_IntFrom2B(BN_INIT(name##_), (const TPM2B*)initializer) // Create a local variable that can hold a number with 'bits' -#define BN_VAR(name, bits) \ - BN_STRUCT(name, bits) _##name; \ - bigNum name = BN_INIT(_##name) +#define BN_VAR(name, bits) \ + BN_STRUCT(name, bits) _##name; \ + bigNum name = BN_INIT(_##name) // Create a type that can hold the largest number defined by the // implementation. #define BN_MAX(name) BN_VAR(name, LARGEST_NUMBER_BITS) #define BN_MAX_INITIALIZED(name, initializer) \ - BN_INITIALIZED(name, LARGEST_NUMBER_BITS, initializer) + BN_INITIALIZED(name, LARGEST_NUMBER_BITS, initializer) // A word size value is useful #define BN_WORD(name) BN_VAR(name, RADIX_BITS) @@ -188,9 +130,9 @@ extern const bignum_t BnConstZero; // This is used to create a word-size bigNum and initialize it with // an input parameter to a function. #define BN_WORD_INITIALIZED(name, initial) \ - BN_STRUCT(RADIX_BITS) name##_; \ - bigNum name = \ - BnInitializeWord((bigNum)&name##_, BN_STRUCT_ALLOCATION(RADIX_BITS), initial) + BN_STRUCT(RADIX_BITS) name##_; \ + bigNum name = BnInitializeWord( \ + (bigNum) & name##_, BN_STRUCT_ALLOCATION(RADIX_BITS), initial) // ECC-Specific Values @@ -223,14 +165,14 @@ typedef struct constant_point_t // therefore a pointer to bn_point_t (a coords). // so bigPoint->coords->x->size is the size of x, and // all 3 components are the same size. -#define BN_POINT_BUF(typename, bits) \ - struct bnpt_st_##typename##_t \ - { \ - bn_point_t coords; \ - BN_STRUCT(typename##_x, MAX_ECC_KEY_BITS) x; \ - BN_STRUCT(typename##_y, MAX_ECC_KEY_BITS) y; \ - BN_STRUCT(typename##_z, MAX_ECC_KEY_BITS) z; \ - } +#define BN_POINT_BUF(typename, bits) \ + struct bnpt_st_##typename##_t \ + { \ + bn_point_t coords; \ + BN_STRUCT(typename##_x, MAX_ECC_KEY_BITS) x; \ + BN_STRUCT(typename##_y, MAX_ECC_KEY_BITS) y; \ + BN_STRUCT(typename##_z, MAX_ECC_KEY_BITS) z; \ + } typedef BN_POINT_BUF(fullpoint, MAX_ECC_KEY_BITS) bn_fullpoint_t; @@ -324,12 +266,12 @@ TPM_INLINE TPM_ECC_CURVE BnCurveGetCurveId(const TPMBN_ECC_CURVE_CONSTANTS* C) // Convert bytes in initializers // This is used for CryptEccData.c. #define BIG_ENDIAN_BYTES_TO_UINT32(a, b, c, d) \ - (((UINT32)(a) << 24) + ((UINT32)(b) << 16) + ((UINT32)(c) << 8) + ((UINT32)(d))) + (((UINT32)(a) << 24) + ((UINT32)(b) << 16) + ((UINT32)(c) << 8) + ((UINT32)(d))) -#define BIG_ENDIAN_BYTES_TO_UINT64(a, b, c, d, e, f, g, h) \ - (((UINT64)(a) << 56) + ((UINT64)(b) << 48) + ((UINT64)(c) << 40) \ - + ((UINT64)(d) << 32) + ((UINT64)(e) << 24) + ((UINT64)(f) << 16) \ - + ((UINT64)(g) << 8) + ((UINT64)(h))) +#define BIG_ENDIAN_BYTES_TO_UINT64(a, b, c, d, e, f, g, h) \ + (((UINT64)(a) << 56) + ((UINT64)(b) << 48) + ((UINT64)(c) << 40) \ + + ((UINT64)(d) << 32) + ((UINT64)(e) << 24) + ((UINT64)(f) << 16) \ + + ((UINT64)(g) << 8) + ((UINT64)(h))) // These macros are used for data initialization of big number ECC constants // These two macros combine a macro for data definition with a macro for @@ -344,17 +286,17 @@ TPM_INLINE TPM_ECC_CURVE BnCurveGetCurveId(const TPMBN_ECC_CURVE_CONSTANTS* C) #define MJOIN(a, b) a b #if RADIX_BYTES == 64 -# define B8_TO_BN(a, b, c, d, e, f, g, h) \ - ((((((((((((((((UINT64)a) << 8) | (UINT64)b) << 8) | (UINT64)c) << 8) \ - | (UINT64)d) \ - << 8) \ - | (UINT64)e) \ - << 8) \ - | (UINT64)f) \ - << 8) \ - | (UINT64)g) \ - << 8) \ - | (UINT64)h) +# define B8_TO_BN(a, b, c, d, e, f, g, h) \ + ((((((((((((((((UINT64)a) << 8) | (UINT64)b) << 8) | (UINT64)c) << 8) \ + | (UINT64)d) \ + << 8) \ + | (UINT64)e) \ + << 8) \ + | (UINT64)f) \ + << 8) \ + | (UINT64)g) \ + << 8) \ + | (UINT64)h) # define B1_TO_BN(a) B8_TO_BN(0, 0, 0, 0, 0, 0, 0, a) # define B2_TO_BN(a, b) B8_TO_BN(0, 0, 0, 0, 0, 0, a, b) # define B3_TO_BN(a, b, c) B8_TO_BN(0, 0, 0, 0, 0, a, b, c) @@ -367,7 +309,7 @@ TPM_INLINE TPM_ECC_CURVE BnCurveGetCurveId(const TPMBN_ECC_CURVE_CONSTANTS* C) # define B2_TO_BN(a, b) B4_TO_BN(0, 0, a, b) # define B3_TO_BN(a, b, c) B4_TO_BN(0, a, b, c) # define B4_TO_BN(a, b, c, d) \ - (((((((UINT32)a << 8) | (UINT32)b) << 8) | (UINT32)c) << 8) | (UINT32)d) + (((((((UINT32)a << 8) | (UINT32)b) << 8) | (UINT32)c) << 8) | (UINT32)d) # define B5_TO_BN(a, b, c, d, e) B4_TO_BN(b, c, d, e), B1_TO_BN(a) # define B6_TO_BN(a, b, c, d, e, f) B4_TO_BN(c, d, e, f), B2_TO_BN(a, b) # define B7_TO_BN(a, b, c, d, e, f, g) B4_TO_BN(d, e, f, g), B3_TO_BN(a, b, c) diff --git a/src/tpm2/crypto/openssl/TpmToOsslHash.h b/src/tpm2/crypto/openssl/TpmToOsslHash.h index 5fc0aaf78..c38b06e16 100644 --- a/src/tpm2/crypto/openssl/TpmToOsslHash.h +++ b/src/tpm2/crypto/openssl/TpmToOsslHash.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // @@ -139,46 +81,47 @@ typedef const BYTE* PCBYTE; // Add data to the hash # define HASH_DATA_METHOD_DEF \ - void(HASH_DATA_METHOD)(PANY_HASH_STATE state, PCBYTE buffer, size_t size) + void(HASH_DATA_METHOD)(PANY_HASH_STATE state, PCBYTE buffer, size_t size) # define HASH_DATA(hashState, dInSize, dIn) \ - ((hashState)->def->method.data)(&(hashState)->state, dIn, dInSize) + ((hashState)->def->method.data)(&(hashState)->state, dIn, dInSize) // Finalize the hash and get the digest # define HASH_END_METHOD_DEF \ - void(HASH_END_METHOD)(BYTE * buffer, PANY_HASH_STATE state) + void(HASH_END_METHOD)(BYTE * buffer, PANY_HASH_STATE state) # define HASH_END(hashState, buffer) \ - ((hashState)->def->method.end)(buffer, &(hashState)->state) + ((hashState)->def->method.end)(buffer, &(hashState)->state) // Copy the hash context // Note: For import, export, and copy, memcpy() is used since there is no // reformatting necessary between the internal and external forms. # define HASH_STATE_COPY_METHOD_DEF \ - void(HASH_STATE_COPY_METHOD)( \ - PANY_HASH_STATE to, PCANY_HASH_STATE from, size_t size) -# define HASH_STATE_COPY(hashStateOut, hashStateIn) \ - ((hashStateIn)->def->method.copy)(&(hashStateOut)->state, \ - &(hashStateIn)->state, \ - (hashStateIn)->def->contextSize) + void(HASH_STATE_COPY_METHOD)( \ + PANY_HASH_STATE to, PCANY_HASH_STATE from, size_t size) +# define HASH_STATE_COPY(hashStateOut, hashStateIn) \ + ((hashStateIn)->def->method.copy)(&(hashStateOut)->state, \ + &(hashStateIn)->state, \ + (hashStateIn)->def->contextSize) // Copy (with reformatting when necessary) an internal hash structure to an // external blob # define HASH_STATE_EXPORT_METHOD_DEF \ - void(HASH_STATE_EXPORT_METHOD)(BYTE * to, PCANY_HASH_STATE from, size_t size) -# define HASH_STATE_EXPORT(to, hashStateFrom) \ - ((hashStateFrom)->def->method.copyOut)( \ - &(((BYTE*)(to))[offsetof(HASH_STATE, state)]), \ - &(hashStateFrom)->state, \ - (hashStateFrom)->def->contextSize) + void(HASH_STATE_EXPORT_METHOD)(BYTE * to, PCANY_HASH_STATE from, size_t size) +# define HASH_STATE_EXPORT(to, hashStateFrom) \ + ((hashStateFrom)->def->method.copyOut)( \ + &(((BYTE*)(to))[offsetof(HASH_STATE, state)]), \ + &(hashStateFrom)->state, \ + (hashStateFrom)->def->contextSize) // Copy from an external blob to an internal formate (with reformatting when // necessary # define HASH_STATE_IMPORT_METHOD_DEF \ - void(HASH_STATE_IMPORT_METHOD)(PANY_HASH_STATE to, const BYTE* from, size_t size) -# define HASH_STATE_IMPORT(hashStateTo, from) \ - ((hashStateTo)->def->method.copyIn)( \ - &(hashStateTo)->state, \ - &(((const BYTE*)(from))[offsetof(HASH_STATE, state)]), \ - (hashStateTo)->def->contextSize) + void(HASH_STATE_IMPORT_METHOD)( \ + PANY_HASH_STATE to, const BYTE* from, size_t size) +# define HASH_STATE_IMPORT(hashStateTo, from) \ + ((hashStateTo)->def->method.copyIn)( \ + &(hashStateTo)->state, \ + &(((const BYTE*)(from))[offsetof(HASH_STATE, state)]), \ + (hashStateTo)->def->contextSize) // Function aliases. The code in CryptHash.c uses the internal designation for the // functions. These need to be translated to the function names of the library. diff --git a/src/tpm2/endian_swap.h b/src/tpm2/endian_swap.h index b19fd318a..fa3cb6745 100644 --- a/src/tpm2/endian_swap.h +++ b/src/tpm2/endian_swap.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Swap */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _SWAP_H #define _SWAP_H @@ -106,21 +48,21 @@ // Disaggregate a UINT into a byte array # define UINT8_TO_BYTE_ARRAY(i, b) \ - { \ - *((uint8_t*)(b)) = (i); \ - } + { \ + *((uint8_t*)(b)) = (i); \ + } # define UINT16_TO_BYTE_ARRAY(i, b) \ - { \ - *((uint16_t*)(b)) = (i); \ - } + { \ + *((uint16_t*)(b)) = (i); \ + } # define UINT32_TO_BYTE_ARRAY(i, b) \ - { \ - *((uint32_t*)(b)) = (i); \ - } + { \ + *((uint32_t*)(b)) = (i); \ + } # define UINT64_TO_BYTE_ARRAY(i, b) \ - { \ - *((uint64_t*)(b)) = (i); \ - } + { \ + *((uint64_t*)(b)) = (i); \ + } # else // the little endian macros for machines that allow unaligned memory access // the big-endian macros for machines that allow unaligned memory access @@ -133,21 +75,21 @@ // Disaggregate a UINT into a byte array # define UINT8_TO_BYTE_ARRAY(i, b) \ - { \ - *((uint8_t*)(b)) = (i); \ - } -# define UINT16_TO_BYTE_ARRAY(i, b) \ - { \ - *((uint16_t*)(b)) = REVERSE_ENDIAN_16(i); \ - } -# define UINT32_TO_BYTE_ARRAY(i, b) \ - { \ - *((uint32_t*)(b)) = REVERSE_ENDIAN_32(i); \ - } -# define UINT64_TO_BYTE_ARRAY(i, b) \ - { \ - *((uint64_t*)(b)) = REVERSE_ENDIAN_64(i); \ - } + { \ + *((uint8_t*)(b)) = (i); \ + } +# define UINT16_TO_BYTE_ARRAY(i, b) \ + { \ + *((uint16_t*)(b)) = REVERSE_ENDIAN_16(i); \ + } +# define UINT32_TO_BYTE_ARRAY(i, b) \ + { \ + *((uint32_t*)(b)) = REVERSE_ENDIAN_32(i); \ + } +# define UINT64_TO_BYTE_ARRAY(i, b) \ + { \ + *((uint64_t*)(b)) = REVERSE_ENDIAN_64(i); \ + } # endif // BIG_ENDIAN_TPM #endif // AUTO_ALIGN == NO From 3a06cb69720f93800c8ca18a171f824949bbcdd8 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 23 Jul 2025 13:33:17 -0400 Subject: [PATCH 13/52] Sync: Fix some build issues, reformat code and add more comments Signed-off-by: Stefan Berger --- src/tpm2/Clock.c | 67 +++-------------------------- src/tpm2/DuplicationCommands.c | 2 +- src/tpm2/NVMem.c | 69 +++--------------------------- src/tpm2/PlatformData.h | 14 +++--- src/tpm2/PlatformPcr.c | 62 +-------------------------- src/tpm2/SecChannel.c | 2 + src/tpm2/Session.c | 64 ++------------------------- src/tpm2/crypto/openssl/CryptRsa.c | 62 +-------------------------- 8 files changed, 29 insertions(+), 313 deletions(-) diff --git a/src/tpm2/Clock.c b/src/tpm2/Clock.c index 734922873..ec7c2b075 100644 --- a/src/tpm2/Clock.c +++ b/src/tpm2/Clock.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Used by the simulator to mimic a hardware clock */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // @@ -340,9 +282,12 @@ LIB_EXPORT void _plat__ClockRateAdjust(_plat__ClockAdjustStep adjust) } if(s_adjustRate > (CLOCK_NOMINAL + CLOCK_ADJUST_LIMIT)) + { s_adjustRate = CLOCK_NOMINAL + CLOCK_ADJUST_LIMIT; + } + if(s_adjustRate < (CLOCK_NOMINAL - CLOCK_ADJUST_LIMIT)) + { s_adjustRate = CLOCK_NOMINAL - CLOCK_ADJUST_LIMIT; - - return; + } } diff --git a/src/tpm2/DuplicationCommands.c b/src/tpm2/DuplicationCommands.c index 9e88d3418..47fe7cfad 100644 --- a/src/tpm2/DuplicationCommands.c +++ b/src/tpm2/DuplicationCommands.c @@ -221,7 +221,7 @@ TPM2_Rewrap( // Note: this is mostly only an issue if there was no outer wrapper on // 'inDuplicate'. It could be as large as a TPM2B_PRIVATE buffer. If we add // a digest for an outer wrapper, it won't fit anymore. - if((privateBlob.t.size + hashSize) > sizeof(out->outDuplicate.t.buffer)) + if((size_t)(privateBlob.t.size + hashSize) > sizeof(out->outDuplicate.t.buffer)) return TPM_RCS_VALUE + RC_Rewrap_inDuplicate; // Command output out->outDuplicate.t.size = privateBlob.t.size; diff --git a/src/tpm2/NVMem.c b/src/tpm2/NVMem.c index 20362f5f1..94e909ca3 100644 --- a/src/tpm2/NVMem.c +++ b/src/tpm2/NVMem.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* NV read and write access methods */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // @@ -151,7 +93,7 @@ static long NvFileSize(int leaveAt) { case SEEK_SET: filePos = 0; - /* fall through */ + /* fall through */ case SEEK_CUR: assert(fseek(s_NvFile, filePos, SEEK_SET) == 0); // libtpms: added assert break; @@ -276,7 +218,7 @@ _plat__NVEnable_NVChipFile( } //***_plat__NVDisable() -// Disable NV memory +// Disable NV memory, and potentially delete it. LIB_EXPORT void _plat__NVDisable( void* platParameter, // platform specific parameter size_t paramSize // size of parameter. If size == 0, then @@ -285,9 +227,8 @@ LIB_EXPORT void _plat__NVDisable( ) { NOT_REFERENCED(paramSize); // to keep compiler quiet - int delete = ((intptr_t)platParameter != 0) - ? TRUE - : FALSE; // IN: If TRUE (!=0), delete the NV contents. + // IN: If TRUE (!=0), delete the NV contents. + int delete = ((intptr_t)platParameter != 0) ? TRUE : FALSE; #ifdef TPM_LIBTPMS_CALLBACKS int ret = libtpms_plat__NVDisable(); diff --git a/src/tpm2/PlatformData.h b/src/tpm2/PlatformData.h index fa796929e..7990f420b 100644 --- a/src/tpm2/PlatformData.h +++ b/src/tpm2/PlatformData.h @@ -6,13 +6,15 @@ #ifndef _PLATFORM_DATA_H_ #define _PLATFORM_DATA_H_ -#ifndef EXTERN -# ifdef _PLATFORM_DATA_C_ -# define EXTERN -# else +#ifdef _PLATFORM_DATA_C_ +// instantiate the data below. +# undef EXTERN +# define EXTERN +#else +# ifndef EXTERN # define EXTERN extern -# endif // _PLATFORM_DATA_C_ -#endif // EXTERN +# endif // EXTERN +#endif // _PLATFORM_DATA_C_ // From Cancel.c // Cancel flag. It is initialized as FALSE, which indicate the command is not diff --git a/src/tpm2/PlatformPcr.c b/src/tpm2/PlatformPcr.c index 9c52b4b7b..b347e92f9 100644 --- a/src/tpm2/PlatformPcr.c +++ b/src/tpm2/PlatformPcr.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // PCR platform interface functions @@ -169,7 +111,7 @@ PCR_Attributes _platPcr__GetPcrInitializationAttributes(UINT32 pcrNumber) BOOL _platPcr_IsPcrBankDefaultActive(TPM_ALG_ID pcrAlg) { // brute force search is fast enough for a small array. - for(size_t i = 0; i < ARRAYSIZE(DefaultActivePcrBanks); i++) // libtpms changed + for(size_t i = 0; i < ARRAYSIZE(DefaultActivePcrBanks); i++) { if(DefaultActivePcrBanks[i] == pcrAlg) { diff --git a/src/tpm2/SecChannel.c b/src/tpm2/SecChannel.c index 2f122862b..19b9a3ea5 100644 --- a/src/tpm2/SecChannel.c +++ b/src/tpm2/SecChannel.c @@ -54,6 +54,8 @@ SpdmCapGetTpmPubKeys(TPM_PUB_KEY spdmPubKey, // IN: the starting TPM property TPML_PUB_KEY* pubKeyList // OUT: property list ) { + NOT_REFERENCED(spdmPubKey); + NOT_REFERENCED(count); TPMI_YES_NO more = NO; // This reference implementation does not implement SPDM functionality and returns a single dummy TPM SPDM public key diff --git a/src/tpm2/Session.c b/src/tpm2/Session.c index 72ba096f3..1571980e3 100644 --- a/src/tpm2/Session.c +++ b/src/tpm2/Session.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Manage the session context counter */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //**Introduction /* @@ -554,7 +496,7 @@ SessionCreate(TPM_SE sessionType, // IN: the session type // Get authValue of associated entity EntityGetAuthValue(bind, (TPM2B_AUTH*)&key); - pAssert(key.t.size + seed->t.size <= sizeof(key.t.buffer)); + pAssert((size_t)key.t.size + seed->t.size <= sizeof(key.t.buffer)); // Concatenate authValue and seed MemoryConcat2B(&key.b, &seed->b, sizeof(key.t.buffer)); @@ -1098,5 +1040,5 @@ SessionCapGetActiveAvail(void) BOOL IsCpHashUnionOccupied(SESSION_ATTRIBUTES attrs) { return attrs.isBound || attrs.isCpHashDefined || attrs.isNameHashDefined - || attrs.isParametersHashDefined || attrs.isTemplateHashDefined; + || attrs.isParametersHashDefined || attrs.isTemplateHashDefined; } diff --git a/src/tpm2/crypto/openssl/CryptRsa.c b/src/tpm2/crypto/openssl/CryptRsa.c index e52ff432d..630d6029f 100644 --- a/src/tpm2/crypto/openssl/CryptRsa.c +++ b/src/tpm2/crypto/openssl/CryptRsa.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Implementation of cryptographic primitives for RSA */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // @@ -147,7 +89,7 @@ static BOOL PackExponent(TPM2B_PRIVATE_KEY_RSA* packed, privateExponent* Z) UINT16 primeSize = (UINT16)BITS_TO_BYTES(ExtMath_MostSigBitNum(Z->P)); UINT16 pS = primeSize; // - pAssert((primeSize * 5) <= sizeof(packed->t.buffer)); + pAssert((size_t)(primeSize * 5) <= sizeof(packed->t.buffer)); packed->t.size = (primeSize * 5) + RSA_prime_flag; for(i = 0; i < 5; i++) if(!ExtMath_IntToBytes( From 84e1aaa64af58e4b3a660c7adff5988320a98ece Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 23 Jul 2025 09:50:42 -0400 Subject: [PATCH 14/52] tpm2: Include stdint.h/def.h in BaseTypes.h and some other changes Signed-off-by: Stefan Berger --- src/tpm2/BaseTypes.h | 64 ++-------------------- src/tpm2/CompilerDependencies.h | 65 ++-------------------- src/tpm2/CompilerDependencies_gcc.h | 80 ++++++---------------------- src/tpm2/CompilerDependencies_msvc.h | 65 ++-------------------- src/tpm2/VerifyConfiguration.h | 7 ++- src/tpm2/crypto/openssl/tpm_radix.h | 67 +++-------------------- 6 files changed, 42 insertions(+), 306 deletions(-) diff --git a/src/tpm2/BaseTypes.h b/src/tpm2/BaseTypes.h index 43615ab5a..861c06bac 100644 --- a/src/tpm2/BaseTypes.h +++ b/src/tpm2/BaseTypes.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Basic Typedefs */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: BaseTypes.h 1531 2019-11-21 23:54:38Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT @@ -70,6 +11,9 @@ # define NULL (0) #endif // NULL +#include +#include + typedef uint8_t UINT8; typedef uint8_t BYTE; typedef int8_t INT8; diff --git a/src/tpm2/CompilerDependencies.h b/src/tpm2/CompilerDependencies.h index 1171f4a07..f05885454 100644 --- a/src/tpm2/CompilerDependencies.h +++ b/src/tpm2/CompilerDependencies.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This file contains the build switches. This contains switches for multiple // versions of the crypto-library so some may not apply to your environment. @@ -74,8 +16,9 @@ #endif #include +#include -// Things that are not defined should be defined as NULL +// Things that are not defined should be defined as #ifndef NORETURN # define NORETURN @@ -93,7 +36,7 @@ # define _NORMAL_WARNING_LEVEL_ #endif #ifndef NOT_REFERENCED -# define NOT_REFERENCED(x) (x = x) +# define NOT_REFERENCED(x) ((void)(x)) #endif #ifdef _POSIX_ diff --git a/src/tpm2/CompilerDependencies_gcc.h b/src/tpm2/CompilerDependencies_gcc.h index e08ae1316..d630f34c4 100644 --- a/src/tpm2/CompilerDependencies_gcc.h +++ b/src/tpm2/CompilerDependencies_gcc.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This file contains compiler specific switches. // These definitions are for the GCC compiler @@ -69,11 +11,17 @@ # error CompilerDependencies_gcc.h included for wrong compiler #endif +// silence specific GCC errors +#pragma GCC diagnostic push // don't warn on unused local typedefs, they are used as a // cross-compiler static_assert -#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedefs" -#pragma GCC diagnostic pop + +// This is needed when compiling against OpenSSL 3.0, as the Ossl bindings use: +// - EC_POINT_set_affine_coordinates_GFp / EC_POINTs_mul +// - AES_set_encrypt_key / AES_encrypt +// - Camellia_set_key / Camellia_encrypt +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #undef _MSC_VER #undef WIN32 @@ -118,6 +66,12 @@ #define NORETURN __attribute__((noreturn)) -#define TPM_INLINE inline __attribute__((always_inline)) -#define TPM_STATIC_ASSERT(e) _Static_assert(e, "static assert") +#define TPM_INLINE inline __attribute__((always_inline)) + +#ifdef __cplusplus +// c++ needed for google test +# define TPM_STATIC_ASSERT(e) static_assert(e, "static assert") +#else +# define TPM_STATIC_ASSERT(e) _Static_assert(e, "static assert") +#endif #endif // _COMPILER_DEPENDENCIES_H_ diff --git a/src/tpm2/CompilerDependencies_msvc.h b/src/tpm2/CompilerDependencies_msvc.h index 04f637c2c..ce654bb9f 100644 --- a/src/tpm2/CompilerDependencies_msvc.h +++ b/src/tpm2/CompilerDependencies_msvc.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This file contains compiler specific switches. // These definitions are for the Microsoft compiler @@ -92,7 +34,7 @@ #define TPM_INLINE inline // This is defined to indicate a function that does not return. Microsoft compilers -// do not support the _Noretrun function parameter. +// do not support the _Noreturn function parameter. #define NORETURN __declspec(noreturn) #if _MSC_VER >= 1400 // SAL processing when needed # include @@ -104,7 +46,7 @@ // # define _INTPTR 1 // # endif -#define NOT_REFERENCED(x) (x) +#define NOT_REFERENCED(x) ((void)(x)) // Lower the compiler error warning for system include // files. They tend not to be that clean and there is no @@ -113,7 +55,6 @@ #define _REDUCE_WARNING_LEVEL_(n) __pragma(warning(push, n)) // Restore the compiler warning level #define _NORMAL_WARNING_LEVEL_ __pragma(warning(pop)) -#include #ifdef TPM_STATIC_ASSERT # error TPM_STATIC_ASSERT already defined diff --git a/src/tpm2/VerifyConfiguration.h b/src/tpm2/VerifyConfiguration.h index 83129bd5e..ba2e09080 100644 --- a/src/tpm2/VerifyConfiguration.h +++ b/src/tpm2/VerifyConfiguration.h @@ -7,8 +7,13 @@ #ifndef _VERIFY_CONFIGURATION_H #define _VERIFY_CONFIGURATION_H +MUST_BE(YES == 1); +MUST_BE(NO == 0); + // verify these defines are either YES or NO. -#define MUST_BE_0_OR_1(x) MUST_BE(((x) == 0) || ((x) == 1)) +#define MUST_BE_0_OR_1(x) MUST_BE(((x) == NO) || ((x) == YES)) +#define MUST_BE_0(x) MUST_BE((x) == NO) +#define MUST_BE_1(x) MUST_BE((x) == YES) // Debug Options MUST_BE_0_OR_1(DEBUG); diff --git a/src/tpm2/crypto/openssl/tpm_radix.h b/src/tpm2/crypto/openssl/tpm_radix.h index c8b69754d..7e0a4350e 100644 --- a/src/tpm2/crypto/openssl/tpm_radix.h +++ b/src/tpm2/crypto/openssl/tpm_radix.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // Common defines for supporting large numbers and cryptographic buffer sizing. @@ -157,6 +99,13 @@ typedef int32_t crypt_word_t; #define MAX_ECC_PARAMETER_BYTES (MAX_ECC_KEY_BYTES * ALG_ECC) +// round up to a multiple of stride; by 0 if already a multiple +#define ALIGN_UP(size, stride) ((((size) + (stride) - 1) / (stride)) * (stride)) +// rounds down to multiple of stride +#define ALIGN_DOWN(size, stride) ((size) - ((size) % (stride))) +#define IS_ALIGNED(ptr, stride) ((((size_t)ptr) % (stride)) == 0) +#define IS_ALIGNED4(ptr) IS_ALIGNED(ptr, 4) + // These macros use the selected libraries to get the proper include files. // clang-format off #define LIB_QUOTE(_STRING_) #_STRING_ From cad61cda6b13d965a9b0d1b30e23d2b6322560df Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 23 Jul 2025 10:37:55 -0400 Subject: [PATCH 15/52] Sync: Move vendor commands support into own directory Signed-off-by: Stefan Berger --- src/Makefile.am | 9 +- src/tpm2/CommandAttributeData.h | 18 ++-- src/tpm2/CommandCodeAttributes.c | 13 +-- src/tpm2/CommandDispatchData.h | 44 ++------- src/tpm2/PropertyCap.c | 2 +- src/tpm2/TpmProfile_CommandList.h | 7 +- src/tpm2/TpmTypes.h | 1 - .../CommandAttributeData_s_ccAttr.inl | 18 ++++ ...mmandAttributeData_s_commandAttributes.inl | 18 ++++ .../CommandDispatchData_CommandStructures.inl | 43 +++++++++ ...CommandDispatchData_s_CommandDataArray.inl | 17 ++++ src/tpm2/VendorCommands/VendorCommandList.h | 18 ++++ src/tpm2/VendorCommands/Vendor_TCG_Test.c | 19 ++++ src/tpm2/VendorCommands/Vendor_TCG_Test_fp.h | 29 ++++++ src/tpm2/Vendor_TCG_Test.c | 76 ---------------- src/tpm2/Vendor_TCG_Test_fp.h | 90 ------------------- 16 files changed, 198 insertions(+), 224 deletions(-) create mode 100644 src/tpm2/VendorCommands/CommandAttributeData_s_ccAttr.inl create mode 100644 src/tpm2/VendorCommands/CommandAttributeData_s_commandAttributes.inl create mode 100644 src/tpm2/VendorCommands/CommandDispatchData_CommandStructures.inl create mode 100644 src/tpm2/VendorCommands/CommandDispatchData_s_CommandDataArray.inl create mode 100644 src/tpm2/VendorCommands/VendorCommandList.h create mode 100644 src/tpm2/VendorCommands/Vendor_TCG_Test.c create mode 100644 src/tpm2/VendorCommands/Vendor_TCG_Test_fp.h delete mode 100644 src/tpm2/Vendor_TCG_Test.c delete mode 100644 src/tpm2/Vendor_TCG_Test_fp.h diff --git a/src/Makefile.am b/src/Makefile.am index 4a7099d37..756173a57 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -287,10 +287,10 @@ libtpms_tpm2_la_SOURCES = \ tpm2/Unique.c \ tpm2/Unmarshal.c \ tpm2/VendorInfo.c \ - tpm2/Vendor_TCG_Test.c \ tpm2/X509_ECC.c \ tpm2/X509_RSA.c \ tpm2/X509_spt.c \ + tpm2/VendorCommands/Vendor_TCG_Test.c \ tpm_tpm2_interface.c \ tpm_tpm2_tis.c \ \ @@ -567,7 +567,6 @@ noinst_HEADERS += \ tpm2/Unmarshal_fp.h \ tpm2/Unseal_fp.h \ tpm2/VendorInfo.h \ - tpm2/Vendor_TCG_Test_fp.h \ tpm2/VerifyConfiguration.h \ tpm2/VerifySignature_fp.h \ tpm2/X509.h \ @@ -575,6 +574,12 @@ noinst_HEADERS += \ tpm2/X509_RSA_fp.h \ tpm2/X509_spt_fp.h \ tpm2/ZGen_2Phase_fp.h \ + tpm2/VendorCommands/CommandAttributeData_s_ccAttr.inl \ + tpm2/VendorCommands/CommandAttributeData_s_commandAttributes.inl \ + tpm2/VendorCommands/CommandDispatchData_CommandStructures.inl \ + tpm2/VendorCommands/CommandDispatchData_s_CommandDataArray.inl \ + tpm2/VendorCommands/Vendor_TCG_Test_fp.h \ + tpm2/VendorCommands/VendorCommandList.h \ \ tpm2/BackwardsCompatibility.h \ tpm2/BackwardsCompatibilityBitArray.h \ diff --git a/src/tpm2/CommandAttributeData.h b/src/tpm2/CommandAttributeData.h index e4dd122f4..fe147fd3f 100644 --- a/src/tpm2/CommandAttributeData.h +++ b/src/tpm2/CommandAttributeData.h @@ -412,13 +412,14 @@ const TPMA_CC s_ccAttr [] = { #if (PAD_LIST || CC_PolicyTransportSPDM) TPMA_CC_INITIALIZER(0x01A1, 0, 0, 0, 0, 1, 0, 0, 0), #endif -#if (PAD_LIST || CC_Vendor_TCG_Test) - TPMA_CC_INITIALIZER(0x0000, 0, 0, 0, 0, 0, 0, 1, 0), -#endif + +// Include attributes for vendor commands +#include "VendorCommands/CommandAttributeData_s_ccAttr.inl" + +// list terminator TPMA_ZERO_INITIALIZER() }; - // This is the command code attribute structure. const COMMAND_ATTRIBUTES s_commandAttributes [] = { #if (PAD_LIST || CC_NV_UndefineSpaceSpecial) @@ -940,10 +941,11 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { (COMMAND_ATTRIBUTES)(CC_PolicyTransportSPDM * // 0x01A1 (DECRYPT_2+ALLOW_TRIAL)), #endif -#if (PAD_LIST || CC_Vendor_TCG_Test) - (COMMAND_ATTRIBUTES)(CC_Vendor_TCG_Test * // 0x0000 - (DECRYPT_2+ENCRYPT_2)), -#endif + +// Include attributes for vendor commands +#include "VendorCommands/CommandAttributeData_s_commandAttributes.inl" + +// list terminator 0 }; diff --git a/src/tpm2/CommandCodeAttributes.c b/src/tpm2/CommandCodeAttributes.c index 6dfc0a023..dd9b21e7d 100644 --- a/src/tpm2/CommandCodeAttributes.c +++ b/src/tpm2/CommandCodeAttributes.c @@ -78,7 +78,7 @@ GetClosestCommandIndex(TPM_CC commandCode // IN: the command code to start at // vendor-command, then it is out of range. if(vendor) { -#if VENDOR_COMMAND_ARRAY_SIZE > 0 +#if VENDOR_COMMAND_ARRAY_COUNT > 0 COMMAND_INDEX commandIndex; COMMAND_INDEX min; COMMAND_INDEX max; @@ -144,7 +144,7 @@ GetClosestCommandIndex(TPM_CC commandCode // IN: the command code to start at < searchIndex) { // requested index is out of the range to the top -#if VENDOR_COMMAND_ARRAY_SIZE > 0 +#if VENDOR_COMMAND_ARRAY_COUNT > 0 // If there are vendor commands, then the first vendor command // is the next value greater than the commandCode. // NOTE: we got here if the starting index did not have the V bit but we @@ -177,9 +177,11 @@ GetClosestCommandIndex(TPM_CC commandCode // IN: the command code to start at // The s_ccAttr array contains an extra entry at the end (a zero value). // Don't count this as an array entry. This means that max should start // out pointing to the last valid entry in the array which is - 2 - pAssert( - max - == (sizeof(s_ccAttr) / sizeof(TPMA_CC) - VENDOR_COMMAND_ARRAY_SIZE - 2)); + VERIFY(max + == (sizeof(s_ccAttr) / sizeof(TPMA_CC) - VENDOR_COMMAND_ARRAY_COUNT + - 2), + FATAL_ERROR_ASSERT, + UNIMPLEMENTED_COMMAND_INDEX); while(min <= max) { commandIndex = (min + max + 1) / 2; @@ -379,7 +381,6 @@ BOOL IsHandleInResponse(COMMAND_INDEX commandIndex) return ((s_commandAttributes[commandIndex] & R_HANDLE) != 0); } - //*** IsDisallowedInReadOnlyMode() // This function determines if a command is disallowed when operating in Read-Only mode BOOL IsDisallowedInReadOnlyMode(COMMAND_INDEX commandIndex) diff --git a/src/tpm2/CommandDispatchData.h b/src/tpm2/CommandDispatchData.h index ac52c8e05..cd2adb854 100644 --- a/src/tpm2/CommandDispatchData.h +++ b/src/tpm2/CommandDispatchData.h @@ -5190,41 +5190,7 @@ ACT_SetTimeout_COMMAND_DESCRIPTOR_t _ACT_SetTimeoutData = { #define _ACT_SetTimeoutDataAddress 0 #endif // CC_ACT_SetTimeout -#if CC_Vendor_TCG_Test -#include "Vendor_TCG_Test_fp.h" - -typedef TPM_RC (Vendor_TCG_Test_Entry)( - Vendor_TCG_Test_In* in, - Vendor_TCG_Test_Out* out -); - - -typedef const struct -{ - Vendor_TCG_Test_Entry *entry; - UINT16 inSize; - UINT16 outSize; - UINT16 offsetOfTypes; - BYTE types[4]; -} Vendor_TCG_Test_COMMAND_DESCRIPTOR_t; - -Vendor_TCG_Test_COMMAND_DESCRIPTOR_t _Vendor_TCG_TestData = { - /* entry */ &TPM2_Vendor_TCG_Test, - /* inSize */ (UINT16)(sizeof(Vendor_TCG_Test_In)), - /* outSize */ (UINT16)(sizeof(Vendor_TCG_Test_Out)), - /* offsetOfTypes */ offsetof(Vendor_TCG_Test_COMMAND_DESCRIPTOR_t, types), - /* offsets */ // No parameter offsets - /* types */ {TPM2B_DATA_P_UNMARSHAL, - END_OF_LIST, - TPM2B_DATA_P_MARSHAL, - END_OF_LIST} -}; - -#define _Vendor_TCG_TestDataAddress (&_Vendor_TCG_TestData) -#else -#define _Vendor_TCG_TestDataAddress 0 -#endif // CC_Vendor_TCG_Test - +#include "VendorCommands/CommandDispatchData_CommandStructures.inl" // Lookup table to access the per-command tables above @@ -5634,14 +5600,14 @@ COMMAND_DESCRIPTOR_t* s_CommandDataArray[] = { #endif // CC_SetCapability #if (PAD_LIST || CC_ReadControl) (COMMAND_DESCRIPTOR_t*)_ReadOnlyControlDataAddress, -#endif // CC_ReadOnlyControl +#endif // CC_ReadOnlyControl #if (PAD_LIST || CC_PolicyTransportSPDM) (COMMAND_DESCRIPTOR_t*)_PolicyTransportSPDMDataAddress, #endif // CC_PolicyTransportSPDM -#if (PAD_LIST || CC_Vendor_TCG_Test) - (COMMAND_DESCRIPTOR_t*)_Vendor_TCG_TestDataAddress, -#endif // CC_Vendor_TCG_Test +#include "VendorCommands/CommandDispatchData_s_CommandDataArray.inl" + +// list terminator 0 }; diff --git a/src/tpm2/PropertyCap.c b/src/tpm2/PropertyCap.c index f9e401307..d16bdb6c5 100644 --- a/src/tpm2/PropertyCap.c +++ b/src/tpm2/PropertyCap.c @@ -318,7 +318,7 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property } case TPM_PT_VENDOR_COMMANDS: // number of vendor commands that are implemented - *value = VENDOR_COMMAND_ARRAY_SIZE; + *value = VENDOR_COMMAND_ARRAY_COUNT; break; case TPM_PT_NV_BUFFER_MAX: // Maximum data size in an NV write command diff --git a/src/tpm2/TpmProfile_CommandList.h b/src/tpm2/TpmProfile_CommandList.h index ed3ea823a..e7dc2d33f 100644 --- a/src/tpm2/TpmProfile_CommandList.h +++ b/src/tpm2/TpmProfile_CommandList.h @@ -14,6 +14,8 @@ # error CC_YES and CC_NO should be defined by the command line file, not before #endif +// Change these definitions to turn all commands ON or OFF. That is, to turn all +// commands on, set CC_NO to YES. This is intended as a debug feature. #define CC_YES YES #define CC_NO NO @@ -157,7 +159,6 @@ #define CC_StirRandom CC_YES #define CC_TestParms CC_YES #define CC_Unseal CC_YES -#define CC_Vendor_TCG_Test CC_NO /* libtpms: NO */ #define CC_VerifySignature CC_YES #define CC_ZGen_2Phase (CC_YES && ALG_ECC) #define CC_NV_DefineSpace2 CC_NO /* libtpms: NO */ @@ -166,4 +167,8 @@ #define CC_ReadOnlyControl CC_NO /* libtpms: NO */ #define CC_PolicyTransportSPDM CC_NO /* libtpms: NO */ +// clang-format on + +#include "VendorCommands/VendorCommandList.h" + #endif // _TPM_PROFILE_COMMAND_LIST_H_ diff --git a/src/tpm2/TpmTypes.h b/src/tpm2/TpmTypes.h index da47d5f7d..f1aceb410 100644 --- a/src/tpm2/TpmTypes.h +++ b/src/tpm2/TpmTypes.h @@ -307,7 +307,6 @@ typedef UINT32 TPM_CC; #define TPM_CC_PolicyTransportSPDM (TPM_CC)(0x000001A1) #define TPM_CC_LAST (TPM_CC)(0x000001A1) #define CC_VEND (TPM_CC)(0x20000000) -#define TPM_CC_Vendor_TCG_Test (TPM_CC)(0x20000000) // This large macro is needed to determine the maximum commandIndex. This value // is needed in order to size typdef'ed structures. As a consequence, the diff --git a/src/tpm2/VendorCommands/CommandAttributeData_s_ccAttr.inl b/src/tpm2/VendorCommands/CommandAttributeData_s_ccAttr.inl new file mode 100644 index 000000000..53ef01d17 --- /dev/null +++ b/src/tpm2/VendorCommands/CommandAttributeData_s_ccAttr.inl @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: BSD-2-Clause + +// This file contains an inlined portion of the s_ccAttr array definition +// for vendor commands. +// +// IMPORTANT: This file is included in the middle of an array initializer +// therefore it must not contain anything other than comments and exactly one TPMA_CC +// entry per vendor command. See the private Tpm header CommandAttributeData.h for +// more info. +// (This is why the file has the .INL extension, it's not a normal header. +// +#ifndef _COMMAND_CODE_ATTRIBUTES_ +# error This file should be included only within CommandAttributeData.h +#endif +#if (PAD_LIST || CC_Vendor_TCG_Test) +// TPM_CC_Vendor_TCG_Test +TPMA_CC_INITIALIZER(0x0000, 0, 0, 0, 0, 0, 0, 1, 0), +#endif diff --git a/src/tpm2/VendorCommands/CommandAttributeData_s_commandAttributes.inl b/src/tpm2/VendorCommands/CommandAttributeData_s_commandAttributes.inl new file mode 100644 index 000000000..a7d532f65 --- /dev/null +++ b/src/tpm2/VendorCommands/CommandAttributeData_s_commandAttributes.inl @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: BSD-2-Clause + +// This file contains an inlined portion of the s_commandAttributes array +// definition for vendor commands. +// +// IMPORTANT: This file is included in the middle of an array initializer +// therefore it must not contain anything other than comments and exactly one +// COMMAND_ATTRIBUTES entry per vendor command. See the private Tpm header +// CommandAttributeData.h for more info. (This is why the file has the .INL +// extension, it's not a normal header. +// +#ifndef _COMMAND_CODE_ATTRIBUTES_ +# error This file should be included only within CommandAttributeData.h +#endif +#if (PAD_LIST || CC_Vendor_TCG_Test) +(COMMAND_ATTRIBUTES)(CC_Vendor_TCG_Test* // 0x0000 + (DECRYPT_2 + ENCRYPT_2)), +#endif diff --git a/src/tpm2/VendorCommands/CommandDispatchData_CommandStructures.inl b/src/tpm2/VendorCommands/CommandDispatchData_CommandStructures.inl new file mode 100644 index 000000000..a0d094ca4 --- /dev/null +++ b/src/tpm2/VendorCommands/CommandDispatchData_CommandStructures.inl @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: BSD-2-Clause + +// This file contains an inlined portion of the s_ccAttr array definition +// for vendor commands. +// +// IMPORTANT: This file is included in the middle of an array initializer +// therefore it must not contain anything other than comments and exactly one TPMA_CC +// entry per vendor command. See the private Tpm header CommandAttributeData.h for +// more info. +// (This is why the file has the .INL extension, it's not a normal header. +// +#ifndef _COMMAND_TABLE_DISPATCH_ +#error This file should only be included inside CommandDispatchData.h when table dispatching is turned on. +#endif + +#if CC_Vendor_TCG_Test +# include "Vendor_TCG_Test_fp.h" // libtpms: changed + +typedef TPM_RC(Vendor_TCG_Test_Entry)(Vendor_TCG_Test_In* in, + Vendor_TCG_Test_Out* out); + +typedef const struct +{ + Vendor_TCG_Test_Entry* entry; + UINT16 inSize; + UINT16 outSize; + UINT16 offsetOfTypes; + BYTE types[4]; +} Vendor_TCG_Test_COMMAND_DESCRIPTOR_t; + +Vendor_TCG_Test_COMMAND_DESCRIPTOR_t _Vendor_TCG_TestData = { + /* entry */ &TPM2_Vendor_TCG_Test, + /* inSize */ (UINT16)(sizeof(Vendor_TCG_Test_In)), + /* outSize */ (UINT16)(sizeof(Vendor_TCG_Test_Out)), + /* offsetOfTypes */ offsetof(Vendor_TCG_Test_COMMAND_DESCRIPTOR_t, types), + /* offsets */ // No parameter offsets + /* types */ + {TPM2B_DATA_P_UNMARSHAL, END_OF_LIST, TPM2B_DATA_P_MARSHAL, END_OF_LIST}}; + +# define _Vendor_TCG_TestDataAddress (&_Vendor_TCG_TestData) +#else +# define _Vendor_TCG_TestDataAddress 0 +#endif // CC_Vendor_TCG_Test diff --git a/src/tpm2/VendorCommands/CommandDispatchData_s_CommandDataArray.inl b/src/tpm2/VendorCommands/CommandDispatchData_s_CommandDataArray.inl new file mode 100644 index 000000000..ca7650a7d --- /dev/null +++ b/src/tpm2/VendorCommands/CommandDispatchData_s_CommandDataArray.inl @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: BSD-2-Clause + +// This file contains an inlined portion of the s_ccAttr array definition +// for vendor commands. +// +// IMPORTANT: This file is included in the middle of an array initializer +// therefore it must not contain anything other than comments and exactly one TPMA_CC +// entry per vendor command. See the private Tpm header CommandAttributeData.h for +// more info. +// (This is why the file has the .INL extension, it's not a normal header. +// +#ifndef _COMMAND_TABLE_DISPATCH_ +#error This file should only be included inside CommandDispatchData.h when table dispatching is turned on. +#endif +#if (PAD_LIST || CC_Vendor_TCG_Test) +(COMMAND_DESCRIPTOR_t*)_Vendor_TCG_TestDataAddress, +#endif // CC_Vendor_TCG_Test diff --git a/src/tpm2/VendorCommands/VendorCommandList.h b/src/tpm2/VendorCommands/VendorCommandList.h new file mode 100644 index 000000000..b5ccc9a1e --- /dev/null +++ b/src/tpm2/VendorCommands/VendorCommandList.h @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: BSD-2-Clause + + +#ifndef _TPM_PROFILE_COMMAND_LIST_H_ +# error This file should be included only within TpmProfile_CommandList.h +#endif + +#define CC_Vendor_TCG_Test CC_NO /* libtpms: NO */ + +#define VENDOR_COMMAND_ARRAY_COUNT (CC_Vendor_TCG_Test) + +// actually define vendor command IDs here +#if CC_Vendor_TCG_Test == YES +# define TPM_CC_Vendor_TCG_Test (TPM_CC)(CC_VEND | 0x0000) +#else +// nothing +#endif +// and command attributes must be defined in TpmProfile_CommandList_AttributeData.inl diff --git a/src/tpm2/VendorCommands/Vendor_TCG_Test.c b/src/tpm2/VendorCommands/Vendor_TCG_Test.c new file mode 100644 index 000000000..2528d85ed --- /dev/null +++ b/src/tpm2/VendorCommands/Vendor_TCG_Test.c @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "tpm_public.h" + +#if CC_Vendor_TCG_Test // Conditional expansion of this file + +# include "TpmTypes.h" +# include "Vendor_TCG_Test_fp.h" + +TPM_RC +TPM2_Vendor_TCG_Test(Vendor_TCG_Test_In* in, // IN: input parameter list + Vendor_TCG_Test_Out* out // OUT: output parameter list +) +{ + out->outputData = in->inputData; + return TPM_RC_SUCCESS; +} + +#endif // CC_Vendor_TCG_Test diff --git a/src/tpm2/VendorCommands/Vendor_TCG_Test_fp.h b/src/tpm2/VendorCommands/Vendor_TCG_Test_fp.h new file mode 100644 index 000000000..a269a64fa --- /dev/null +++ b/src/tpm2/VendorCommands/Vendor_TCG_Test_fp.h @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: BSD-2-Clause + + +#if CC_Vendor_TCG_Test // Command must be enabled + +# ifndef _TPM_INCLUDE_PRIVATE_PROTOTYPES_VENDOR_TCG_TEST_FP_H_ +# define _TPM_INCLUDE_PRIVATE_PROTOTYPES_VENDOR_TCG_TEST_FP_H_ + +// Input structure definition +typedef struct +{ + TPM2B_DATA inputData; +} Vendor_TCG_Test_In; + +// Output structure definition +typedef struct +{ + TPM2B_DATA outputData; +} Vendor_TCG_Test_Out; + +// Response code modifiers +# define RC_Vendor_TCG_Test_inputData (TPM_RC_P + TPM_RC_1) + +// Function prototype +TPM_RC +TPM2_Vendor_TCG_Test(Vendor_TCG_Test_In* in, Vendor_TCG_Test_Out* out); + +# endif // _TPM_INCLUDE_PRIVATE_PROTOTYPES_VENDOR_TCG_TEST_FP_H_ +#endif // CC_Vendor_TCG_Test diff --git a/src/tpm2/Vendor_TCG_Test.c b/src/tpm2/Vendor_TCG_Test.c deleted file mode 100644 index b8f674647..000000000 --- a/src/tpm2/Vendor_TCG_Test.c +++ /dev/null @@ -1,76 +0,0 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Vendor_TCG_Test.c 1548 2019-12-13 23:15:40Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ - -#include "Tpm.h" - -#if CC_Vendor_TCG_Test // Conditional expansion of this file -# include "Vendor_TCG_Test_fp.h" - -TPM_RC -TPM2_Vendor_TCG_Test(Vendor_TCG_Test_In* in, // IN: input parameter list - Vendor_TCG_Test_Out* out // OUT: output parameter list -) -{ - out->outputData = in->inputData; - return TPM_RC_SUCCESS; -} - -#endif // CC_Vendor_TCG_Test diff --git a/src/tpm2/Vendor_TCG_Test_fp.h b/src/tpm2/Vendor_TCG_Test_fp.h deleted file mode 100644 index 7f3149559..000000000 --- a/src/tpm2/Vendor_TCG_Test_fp.h +++ /dev/null @@ -1,90 +0,0 @@ -/********************************************************************************/ -/* */ -/* Sample Vendor Specific Command */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Vendor_TCG_Test_fp.h 1635 2020-06-12 21:48:27Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2020 */ -/* */ -/********************************************************************************/ - - -// FILE GENERATED BY TpmExtractCode: DO NOT EDIT - -#if CC_Vendor_TCG_Test // Command must be enabled - -# ifndef _TPM_INCLUDE_PRIVATE_PROTOTYPES_VENDOR_TCG_TEST_FP_H_ -# define _TPM_INCLUDE_PRIVATE_PROTOTYPES_VENDOR_TCG_TEST_FP_H_ - -// Input structure definition -typedef struct -{ - TPM2B_DATA inputData; -} Vendor_TCG_Test_In; - -// Output structure definition -typedef struct -{ - TPM2B_DATA outputData; -} Vendor_TCG_Test_Out; - -// Response code modifiers -# define RC_Vendor_TCG_Test_inputData (TPM_RC_P + TPM_RC_1) - -// Function prototype -TPM_RC -TPM2_Vendor_TCG_Test(Vendor_TCG_Test_In* in, Vendor_TCG_Test_Out* out); - -# endif // _TPM_INCLUDE_PRIVATE_PROTOTYPES_VENDOR_TCG_TEST_FP_H_ -#endif // CC_Vendor_TCG_Test From 26a750593deb3e6dea41ce91953cc2aaf42fc2cf Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 6 Aug 2025 15:07:18 -0400 Subject: [PATCH 16/52] Sync: Add options for simulator (unused) Signed-off-by: Stefan Berger --- src/tpm2/TpmTcpProtocol.h | 81 ++++++++++----------------------------- 1 file changed, 20 insertions(+), 61 deletions(-) diff --git a/src/tpm2/TpmTcpProtocol.h b/src/tpm2/TpmTcpProtocol.h index 095268665..6aa499e93 100644 --- a/src/tpm2/TpmTcpProtocol.h +++ b/src/tpm2/TpmTcpProtocol.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM commands are communicated as BYTE streams on a TCP connection */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: TpmTcpProtocol.h 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2021 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction @@ -121,7 +62,25 @@ enum TpmEndPointInfo tpmPlatformAvailable = 0x01, tpmUsesTbs = 0x02, tpmInRawMode = 0x04, - tpmSupportsPP = 0x08 + tpmSupportsPP = 0x08, + + // Valid only with PlatformAvailable set. + // System and TPM power control signals (SignalPowerOn/Off) are not supported. + NoPowerCtl = 0x10, + + // Valid only with tpmPlatformAvailable set. + // TPM locality cannot be changed. + NoLocalityCtl = 0x20, + + // Valid only with tpmPlatformAvailable set. + // NV control signals (SignalNvOn/Off) are not supported. + NoNvCtl = 0x40, + + // indicates that no force failure mode is available in the protocol + NoForceFailure = 0x80, + + // indicates Locality 4 Hash indications are not supported + NoHashDataCtl = 0x100 }; #ifdef _MSC_VER From c45fbf451866ec7e8026601e1e1e1a71665f0fc7 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 23 Jul 2025 11:07:01 -0400 Subject: [PATCH 17/52] Sync: Improve platform initialization Signed-off-by: Stefan Berger --- src/Makefile.am | 3 ++ src/tpm2/ExecCommand.c | 12 +++++ src/tpm2/Global.c | 61 +--------------------- src/tpm2/Global.h | 3 ++ src/tpm2/Init.c | 17 +++++++ src/tpm2/Manufacture.c | 61 +--------------------- src/tpm2/StartupCommands.c | 69 ------------------------- src/tpm2/TpmProfile_ErrorCodes.h | 64 ++---------------------- src/tpm2/_TPM_Init.c | 75 ++++++++++++++++++++++++++++ src/tpm2/platform_init_fp.h | 20 ++++++++ src/tpm2/tpm_to_platform_interface.h | 65 ++---------------------- 11 files changed, 144 insertions(+), 306 deletions(-) create mode 100644 src/tpm2/Init.c create mode 100644 src/tpm2/_TPM_Init.c create mode 100644 src/tpm2/platform_init_fp.h diff --git a/src/Makefile.am b/src/Makefile.am index 756173a57..7a85c3059 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -227,6 +227,7 @@ libtpms_tpm2_la_SOURCES = \ tpm2/HashCommands.c \ tpm2/Hierarchy.c \ tpm2/HierarchyCommands.c \ + tpm2/Init.c \ tpm2/IntegrityCommands.c \ tpm2/IoBuffers.c \ tpm2/Locality.c \ @@ -291,6 +292,7 @@ libtpms_tpm2_la_SOURCES = \ tpm2/X509_RSA.c \ tpm2/X509_spt.c \ tpm2/VendorCommands/Vendor_TCG_Test.c \ + tpm2/_TPM_Init.c \ tpm_tpm2_interface.c \ tpm_tpm2_tis.c \ \ @@ -464,6 +466,7 @@ noinst_HEADERS += \ tpm2/PlatformACT_fp.h \ tpm2/PlatformClock.h \ tpm2/PlatformData.h \ + tpm2/platform_init_fp.h \ tpm2/platform_public_interface.h \ tpm2/platform_pcr_fp.h \ tpm2/platform_to_tpm_interface.h \ diff --git a/src/tpm2/ExecCommand.c b/src/tpm2/ExecCommand.c index 670384565..bf8c63ddf 100644 --- a/src/tpm2/ExecCommand.c +++ b/src/tpm2/ExecCommand.c @@ -81,12 +81,24 @@ LIB_EXPORT void ExecuteCommand( // the sizes do not include the tag, command.code, requestSize, or the authorization // fields. //CommandResponseSizes(); + // Set flags for NV access state. This should happen before any other // operation that may require a NV write. Note, that this needs to be done // even when in failure mode. Otherwise, g_updateNV would stay SET while in // Failure mode and the NV would be written on each call. g_updateNV = UT_NONE; g_clearOrderly = FALSE; + + if(!g_initCompleted) + { + // no return because failure will happen immediately below. this is + // treated as fatal because it is a system level failure for there to be + // no TPM_INIT indication. Since init is an out-of-band indication from + // Execute command, we don't return TPM_RC_INITIALIZE which refers to + // the TPM2_Startup command + FAIL_NORET(FATAL_ERROR_NO_INIT); + } + if(g_inFailureMode) { // Do failure mode processing diff --git a/src/tpm2/Global.c b/src/tpm2/Global.c index 1ba989d8b..efaa1b68c 100644 --- a/src/tpm2/Global.c +++ b/src/tpm2/Global.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM variables that are not stack allocated */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // This file will instance the TPM variables that are not stack allocated. @@ -143,3 +85,4 @@ const UINT16 g_rcIndex[15] = {TPM_RC_1, TPM_RC_F}; BOOL g_manufactured = FALSE; +BOOL g_initCompleted = FALSE; diff --git a/src/tpm2/Global.h b/src/tpm2/Global.h index eee5816cd..6eebd4820 100644 --- a/src/tpm2/Global.h +++ b/src/tpm2/Global.h @@ -1518,4 +1518,7 @@ EXTERN UINT16 s_ActUpdated; extern const TPMA_CC s_ccAttr[]; extern const COMMAND_ATTRIBUTES s_commandAttributes[]; +// TRUE if _TPM_Init() ran to completion. +// checked by execute command +EXTERN BOOL g_initCompleted; #endif // GLOBAL_H diff --git a/src/tpm2/Init.c b/src/tpm2/Init.c new file mode 100644 index 000000000..9fd6dd1bf --- /dev/null +++ b/src/tpm2/Init.c @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Platform.h" + +// Notification at very start of TPM_Init(); +LIB_EXPORT void _plat__StartTpmInit(void) +{ + // call platform reset functions, that have no TPM dependencies + // needs the failure change + // _plat_internal_resetFailureData(); +} + +LIB_EXPORT void _plat__EndOkTpmInit(void) +{ + // call platform reset functions that depend on previous TPM initialization + // (none in this implementation) +} diff --git a/src/tpm2/Manufacture.c b/src/tpm2/Manufacture.c index 1ff8bdf42..c5cab8f9d 100644 --- a/src/tpm2/Manufacture.c +++ b/src/tpm2/Manufacture.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Performs the manufacturing of the TPM */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // This file contains the function that performs the "manufacturing" of the TPM @@ -216,6 +158,7 @@ LIB_EXPORT int TPM_TearDown(void) { RuntimeProfileFree(&g_RuntimeProfile); // libtpms added g_manufactured = FALSE; + g_initCompleted = FALSE; return TEARDOWN_OK; } diff --git a/src/tpm2/StartupCommands.c b/src/tpm2/StartupCommands.c index ac06d0ba3..5babfad79 100644 --- a/src/tpm2/StartupCommands.c +++ b/src/tpm2/StartupCommands.c @@ -58,75 +58,6 @@ /* */ /********************************************************************************/ - -#include "Tpm.h" -// TODO_RENAME_INC_FOLDER:platform_interface refers to the TPM_CoreLib platform interface -#include "_TPM_Init_fp.h" -#include "StateMarshal.h" /* libtpms added */ - -// This function is used to process a _TPM_Init indication. -LIB_EXPORT void _TPM_Init(void) -{ - BOOL restored = FALSE; /* libtpms added */ - g_powerWasLost = g_powerWasLost | _plat__WasPowerLost(); - -#if SIMULATION && DEBUG - // If power was lost and this was a simulation, put canary in RAM used by NV - // so that uninitialized memory can be detected more easily - if(g_powerWasLost) - { - memset(&gc, 0xbb, sizeof(gc)); - memset(&gr, 0xbb, sizeof(gr)); - memset(&gp, 0xbb, sizeof(gp)); - memset(&go, 0xbb, sizeof(go)); - } -#endif - -#if ALLOW_FORCE_FAILURE_MODE - // Clear the flag that forces failure on self-test - g_forceFailureMode = FALSE; -#endif - - // Disable the tick processing -#if ACT_SUPPORT || 1 // libtpms: changed - _plat__ACT_EnableTicks(FALSE); -#endif - - // Set initialization state - TPMInit(); - - // Set g_DRTMHandle as unassigned - g_DRTMHandle = TPM_RH_UNASSIGNED; - - // No H-CRTM, yet. - g_DrtmPreStartup = FALSE; - - // Initialize the NvEnvironment. - g_nvOk = NvPowerOn(); - - // Initialize cryptographic functions - g_inFailureMode |= (g_nvOk == FALSE) || (CryptInit() == FALSE); // libtpms changed - if(!g_inFailureMode) - { - // Load the persistent data - NvReadPersistent(); - - // Load the orderly data (clock and DRBG state). - // If this is not done here, things break - NvRead(&go, NV_ORDERLY_DATA, sizeof(go)); - - // Start clock. Need to do this after NV has been restored. - TimePowerOn(); - - /* libtpms added begin */ - VolatileLoad(&restored); - if (restored) - NVShadowRestore(); - /* libtpms added end */ - } - return; -} - #include "Tpm.h" #include "Startup_fp.h" #if CC_Startup // Conditional expansion of this file diff --git a/src/tpm2/TpmProfile_ErrorCodes.h b/src/tpm2/TpmProfile_ErrorCodes.h index eed72126b..eedfa0ee2 100644 --- a/src/tpm2/TpmProfile_ErrorCodes.h +++ b/src/tpm2/TpmProfile_ErrorCodes.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file defines error codes used in failure macros in the TPM Core Library. @@ -102,6 +44,10 @@ // Additional error codes defined by TPM library: #define FATAL_ERROR_ASSERT (500) +#define FATAL_ERROR_NV_INIT (501) +#define FATAL_ERROR_CRYPTO_INIT (502) +#define FATAL_ERROR_NO_INIT (503) + // Platform library violated interface contract. #define FATAL_ERROR_PLATFORM (600) diff --git a/src/tpm2/_TPM_Init.c b/src/tpm2/_TPM_Init.c new file mode 100644 index 000000000..53a12da90 --- /dev/null +++ b/src/tpm2/_TPM_Init.c @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "_TPM_Init_fp.h" +#include "StateMarshal.h" // libtpms added + +// This function is used to process a _TPM_Init indication. +LIB_EXPORT void _TPM_Init(void) +{ + BOOL restored = FALSE; /* libtpms added */ + _plat__StartTpmInit(); + g_powerWasLost = g_powerWasLost | _plat__WasPowerLost(); + +#if SIMULATION && DEBUG + // If power was lost and this was a simulation, put canary in RAM used by NV + // so that uninitialized memory can be detected more easily + if(g_powerWasLost) + { + memset(&gc, 0xbb, sizeof(gc)); + memset(&gr, 0xbb, sizeof(gr)); + memset(&gp, 0xbb, sizeof(gp)); + memset(&go, 0xbb, sizeof(go)); + } +#endif + +#if ALLOW_FORCE_FAILURE_MODE + // Clear the flag that forces failure on self-test + g_forceFailureMode = FALSE; +#endif + + // Disable the tick processing +#if ACT_SUPPORT || 1 // libtpms: changed + _plat__ACT_EnableTicks(FALSE); +#endif + + // Set initialization state + TPMInit(); + + // Set g_DRTMHandle as unassigned + g_DRTMHandle = TPM_RH_UNASSIGNED; + + // No H-CRTM, yet. + g_DrtmPreStartup = FALSE; + + // Initialize the NvEnvironment. + g_nvOk = NvPowerOn(); + + // Initialize cryptographic functions + g_inFailureMode |= (g_nvOk == FALSE) || (CryptInit() == FALSE); // libtpms changed + if(!g_inFailureMode) + { + // Load the persistent data + NvReadPersistent(); + + // Load the orderly data (clock and DRBG state). + // If this is not done here, things break + NvRead(&go, NV_ORDERLY_DATA, sizeof(go)); + + // Start clock. Need to do this after NV has been restored. + TimePowerOn(); + /* libtpms added begin */ + VolatileLoad(&restored); + if (restored) + NVShadowRestore(); + /* libtpms added end */ + } + + g_initCompleted = TRUE; + if(!g_inFailureMode) + { + _plat__EndOkTpmInit(); + } + + return; +} diff --git a/src/tpm2/platform_init_fp.h b/src/tpm2/platform_init_fp.h new file mode 100644 index 000000000..b30a9014f --- /dev/null +++ b/src/tpm2/platform_init_fp.h @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: BSD-2-Clause + +// Platform Initialization Functions +// Notify the platform the TPM is processing TpmInit. +// These are opportunities for the Platform to initialize its own data. +// Usually these are only called once (and could therefore be omitted by +// static variable initialization, but are useful in unit testing. + +#ifndef _PLATFORM_INIT_FP_H_ +#define _PLATFORM_INIT_FP_H_ + +// Notification at very start of TPM_Init(); +LIB_EXPORT void _plat__StartTpmInit(void); + +// Notification at very end of a SUCCESSFUL TPM_Init(); +// if the TPM has failed TpmInit (and entered failure mode) +// this will not be called +LIB_EXPORT void _plat__EndOkTpmInit(void); + +#endif // _PLATFORM_INIT_FP_H_ diff --git a/src/tpm2/tpm_to_platform_interface.h b/src/tpm2/tpm_to_platform_interface.h index fdb366797..4cf13bd7c 100644 --- a/src/tpm2/tpm_to_platform_interface.h +++ b/src/tpm2/tpm_to_platform_interface.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* NV read and write access methods */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This file represents the functional interface that all platform libraries must @@ -315,7 +257,7 @@ LIB_EXPORT uint32_t _plat__ACT_GetRemaining(uint32_t act //IN: the ACT selector //*** _plat__ACT_GetSignaled() LIB_EXPORT int _plat__ACT_GetSignaled(uint32_t act //IN: number of ACT to check - ); +); //*** _plat__ACT_SetSignaled() LIB_EXPORT void _plat__ACT_SetSignaled(uint32_t act, int on); @@ -459,4 +401,7 @@ LIB_EXPORT uint32_t _plat__GetTpmType(void); // libtpms changed // platform PCR initialization functions #include "platform_pcr_fp.h" +// platform initialization functions +#include "platform_init_fp.h" + #endif // _TPM_TO_PLATFORM_INTERFACE_H_ From c709781847d29652ca94f7c64c82272e128b723b Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 6 Aug 2025 16:44:26 -0400 Subject: [PATCH 18/52] Sync: Implemented debugging macros and enable with build switch Signed-off-by: Stefan Berger --- src/Makefile.am | 1 + src/tpm2/DebugHelpers.c | 37 ++++++++++ src/tpm2/TpmBuildSwitches.h | 11 +++ src/tpm2/TpmFail.c | 68 ++--------------- src/tpm2/TpmMath_Debug.c | 62 +--------------- src/tpm2/TpmSizeChecks.c | 106 +++++++-------------------- src/tpm2/VerifyConfiguration.h | 3 +- src/tpm2/tpm_debug.h | 73 ++++++++++++++++++ src/tpm2/tpm_public.h | 61 +-------------- src/tpm2/tpm_to_platform_interface.h | 12 +++ 10 files changed, 176 insertions(+), 258 deletions(-) create mode 100644 src/tpm2/tpm_debug.h diff --git a/src/Makefile.am b/src/Makefile.am index 7a85c3059..f87ccb9b3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -556,6 +556,7 @@ noinst_HEADERS += \ tpm2/TpmProfile_Misc.h \ tpm2/Tpm.h \ tpm2/TpmBigNum.h \ + tpm2/tpm_debug.h \ tpm2/tpm_public.h \ tpm2/tpm_to_platform_interface.h \ tpm2/_TPM_Hash_Data_fp.h \ diff --git a/src/tpm2/DebugHelpers.c b/src/tpm2/DebugHelpers.c index 2b94bb538..1d2e2a08b 100644 --- a/src/tpm2/DebugHelpers.c +++ b/src/tpm2/DebugHelpers.c @@ -9,6 +9,7 @@ //** Includes and Local #include +#include #include #include "Platform.h" @@ -86,3 +87,39 @@ void DebugDumpBuffer(int size, unsigned char* buf, const char* identifier) } #endif // CERTIFYX509_DEBUG + +#if ENABLE_TPM_DEBUG_PRINT + +LIB_EXPORT void _plat_debug_print(const char* str) +{ + printf("%s\n", str); +} + +LIB_EXPORT void _plat_debug_print_buffer(const void* buf, const size_t size) +{ + NOT_REFERENCED(buf); + NOT_REFERENCED(size); + // not implemented +} + +LIB_EXPORT void _plat_debug_print_int32(const char* name, uint32_t value) +{ + printf("%s=0x%04x\n", name, value); +} + +LIB_EXPORT void _plat_debug_print_int64(const char* name, uint64_t value) +{ + printf("%s=0x%04x:%04x\n", + name, + (uint32_t)(value >> 32), + (uint32_t)(value & 0xFFFFFFFF)); +} + +LIB_EXPORT void _plat_debug_printf(const char* fmt, ...) +{ + va_list params; + va_start(params, fmt); + vprintf(fmt, params); +} + +#endif // ENABLE_TPM_DEBUG_PRINT diff --git a/src/tpm2/TpmBuildSwitches.h b/src/tpm2/TpmBuildSwitches.h index 664596e19..3680d50fc 100644 --- a/src/tpm2/TpmBuildSwitches.h +++ b/src/tpm2/TpmBuildSwitches.h @@ -53,6 +53,17 @@ // ones in the Simulator project. #define SIMULATION NO // libtpms: changed to NO +// ENABLE_TPM_DEBUG_PRINT enables arbitrary string printing. +// enables the TPM_DEBUG_PRINT macro to route debugging strings +// to the _plat_debug_out function +#define ENABLE_TPM_DEBUG_PRINT (YES * SIMULATION) + +// ENABLE_TPM_DEBUG_TRACE enables code tracing macros - depends on TPM_DEBUG_PRINT +#define ENABLE_TPM_DEBUG_TRACE (NO * ENABLE_TPM_DEBUG_PRINT) + +// ENABLE_CRYPTO_DEBUG enables printing of actual crypto values. This is entirely insecure. +#define ENABLE_CRYPTO_DEBUG (YES * ENABLE_TPM_DEBUG_PRINT) + // The CRYPTO_LIB_REPORTING switch allows the TPM to report its // crypto library implementation, e.g., at simulation startup. #define CRYPTO_LIB_REPORTING NO // libtpms: NO diff --git a/src/tpm2/TpmFail.c b/src/tpm2/TpmFail.c index 7c69dccac..6cac35eae 100644 --- a/src/tpm2/TpmFail.c +++ b/src/tpm2/TpmFail.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Failure Mode Handling */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes, Defines, and Types #define TPM_FAIL_C @@ -334,7 +276,8 @@ void TpmFailureMode(uint32_t inRequestSize, // IN: command buffer size unsigned char** outResponse // OUT: response buffer ) { - UINT32 marshalSize; + TPM_DEBUG_TRACE(); + UINT32 marshalSize; // final size of the response. UINT32 capability; HEADER header; // unmarshaled command header UINT32 pt; // unmarshaled property type @@ -342,6 +285,8 @@ void TpmFailureMode(uint32_t inRequestSize, // IN: command buffer size UINT8* buffer = inRequest; INT32 size = inRequestSize; + //TPM_DEBUG_PRINT("In TpmFailureMode)"); + // If there is no command buffer, then just return TPM_RC_FAILURE if(inRequestSize == 0 || inRequest == NULL) goto FailureModeReturn; @@ -452,6 +397,7 @@ void TpmFailureMode(uint32_t inRequestSize, // IN: command buffer size marshalSize += MarshalUint32(pt, &buffer); break; default: // default for switch (cc) + //TPM_DEBUG_PRINT(" goto FailureModeReturn from default"); goto FailureModeReturn; } // Now do the header @@ -468,7 +414,9 @@ void TpmFailureMode(uint32_t inRequestSize, // IN: command buffer size FailureModeReturn: buffer = response; marshalSize = MarshalUint16(TPM_ST_NO_SESSIONS, &buffer); + //TPM_DEBUG_PRINT("FailureModeReturn:2"); marshalSize += MarshalUint32(10, &buffer); + //TPM_DEBUG_PRINT("FailureModeReturn:3"); marshalSize += MarshalUint32(TPM_RC_FAILURE, &buffer); *outResponseSize = marshalSize; *outResponse = (unsigned char*)response; diff --git a/src/tpm2/TpmMath_Debug.c b/src/tpm2/TpmMath_Debug.c index 84784a1e0..22ebe9583 100644 --- a/src/tpm2/TpmMath_Debug.c +++ b/src/tpm2/TpmMath_Debug.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains debug utility functions to help testing Ecc. @@ -99,6 +41,8 @@ static LIB_EXPORT BYTE FromHex(unsigned char c) return c - '0'; else if(c >= 'A' && c <= 'F') return c - 'A'; + else if(c >= 'a' && c <= 'f') + return c - 'a'; return 255; } diff --git a/src/tpm2/TpmSizeChecks.c b/src/tpm2/TpmSizeChecks.c index 6be1e0a92..484d7ca6b 100644 --- a/src/tpm2/TpmSizeChecks.c +++ b/src/tpm2/TpmSizeChecks.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM Size Checks */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: TpmSizeChecks.c 1628 2020-05-27 19:35:29Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2020 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes, Defines, and Types #include "Tpm.h" @@ -135,17 +76,20 @@ BOOL TpmSizeChecks(void) } # endif // ALG_RSA # if TABLE_DRIVEN_MARSHAL - printf("sizeof(MarshalData) = %zu\n", sizeof(MarshalData_st)); + TPM_DEBUG_PRINTF("sizeof(MarshalData) = %zu\n", sizeof(MarshalData_st)); # endif - printf("Size of OBJECT = %zu\n", sizeof(OBJECT)); - printf("Size of components in TPMT_SENSITIVE = %zu\n", - sizeof(TPMT_SENSITIVE)); - printf(" TPMI_ALG_PUBLIC %zu\n", sizeof(TPMI_ALG_PUBLIC)); - printf(" TPM2B_AUTH %zu\n", sizeof(TPM2B_AUTH)); - printf(" TPM2B_DIGEST %zu\n", sizeof(TPM2B_DIGEST)); - printf(" TPMU_SENSITIVE_COMPOSITE %zu\n", - sizeof(TPMU_SENSITIVE_COMPOSITE)); + TPM_DEBUG_PRINTF("Size of OBJECT = %zu\n", sizeof(OBJECT)); + TPM_DEBUG_PRINTF("Size of components in TPMT_SENSITIVE = %zu\n", + sizeof(TPMT_SENSITIVE)); + TPM_DEBUG_PRINTF(" TPMI_ALG_PUBLIC %zu\n", + sizeof(TPMI_ALG_PUBLIC)); + TPM_DEBUG_PRINTF(" TPM2B_AUTH %zu\n", + sizeof(TPM2B_AUTH)); + TPM_DEBUG_PRINTF(" TPM2B_DIGEST %zu\n", + sizeof(TPM2B_DIGEST)); + TPM_DEBUG_PRINTF(" TPMU_SENSITIVE_COMPOSITE %zu\n", + sizeof(TPMU_SENSITIVE_COMPOSITE)); } // Make sure that the size of the context blob is large enough for the largest // context @@ -175,16 +119,17 @@ BOOL TpmSizeChecks(void) if(MAX_CONTEXT_SIZE < biggestContext) { - printf("MAX_CONTEXT_SIZE needs to be increased to at least %d (%d)\n", - biggestContext, - MAX_CONTEXT_SIZE); + TPM_DEBUG_PRINTF("MAX_CONTEXT_SIZE needs to be increased to at least %d " + "(%d)\n", + biggestContext, + MAX_CONTEXT_SIZE); PASS = FALSE; } else if(MAX_CONTEXT_SIZE > biggestContext) { - printf("MAX_CONTEXT_SIZE can be reduced to %d (%d)\n", - biggestContext, - MAX_CONTEXT_SIZE); + TPM_DEBUG_PRINTF("MAX_CONTEXT_SIZE can be reduced to %d (%d)\n", + biggestContext, + MAX_CONTEXT_SIZE); } } { @@ -201,12 +146,13 @@ BOOL TpmSizeChecks(void) SET_ATTRIBUTE(u.attributes, TPMA_OBJECT, fixedTPM); if(u.uint32Value != 2) { - printf("The bit allocation in a TPMA_OBJECT is not as expected"); + TPM_DEBUG_PRINT("The bit allocation in a TPMA_OBJECT is not as " + "expected"); PASS = FALSE; } if(aSize != uSize) // comparison of two sizeof() values annoys compiler { - printf("A TPMA_OBJECT is not the expected size."); + TPM_DEBUG_PRINT("A TPMA_OBJECT is not the expected size."); PASS = FALSE; } } @@ -222,7 +168,8 @@ BOOL TpmSizeChecks(void) FOR_EACH_ACT(CASE_ACT_NUMBER) if(!_plat__ACT_GetImplemented(act)) { - printf("TPM_RH_ACT_%1X is not implemented by platform\n", act); + TPM_DEBUG_PRINTF( + "TPM_RH_ACT_%1X is not implemented by platform\n", act); PASS = FALSE; } default: @@ -237,7 +184,8 @@ BOOL TpmSizeChecks(void) int t = MAX_DIGEST_SIZE; if(t < 20) { - printf("Check the MAX_DIGEST_SIZE computation (%d)", MAX_DIGEST_SIZE); + TPM_DEBUG_PRINTF("Check the MAX_DIGEST_SIZE computation (%d)", + MAX_DIGEST_SIZE); PASS = FALSE; } } diff --git a/src/tpm2/VerifyConfiguration.h b/src/tpm2/VerifyConfiguration.h index ba2e09080..9803d4d8b 100644 --- a/src/tpm2/VerifyConfiguration.h +++ b/src/tpm2/VerifyConfiguration.h @@ -18,6 +18,7 @@ MUST_BE(NO == 0); // Debug Options MUST_BE_0_OR_1(DEBUG); MUST_BE_0_OR_1(SIMULATION); +MUST_BE_0_OR_1(ENABLE_TPM_DEBUG_PRINT); MUST_BE_0_OR_1(DRBG_DEBUG_PRINT); MUST_BE_0_OR_1(CERTIFYX509_DEBUG); MUST_BE_0_OR_1(USE_DEBUG_RNG); @@ -76,7 +77,7 @@ MUST_BE_0_OR_1(VENDOR_PERMANENT_AUTH_ENABLED); #if !DEBUG # if USE_KEY_CACHE_FILE || USE_RSA_KEY_CACHE || DRBG_DEBUG_PRINT \ - || CERTIFYX509_DEBUG || USE_DEBUG_RNG + || CERTIFYX509_DEBUG || USE_DEBUG_RNG || ENABLE_TPM_DEBUG_PRINT # error using insecure options not in DEBUG mode. # endif #endif diff --git a/src/tpm2/tpm_debug.h b/src/tpm2/tpm_debug.h new file mode 100644 index 000000000..0f175ff42 --- /dev/null +++ b/src/tpm2/tpm_debug.h @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#ifndef _TPM_DEBUG_H_ +#define _TPM_DEBUG_H_ + +#include "tpm_to_platform_interface.h" + +// Basic Debug Printing +#if ENABLE_TPM_DEBUG_PRINT + +# define TPM_DEBUG_PRINT(s) _plat_debug_print(s) +# define TPM_DEBUG_PRINT_BUFFER(buf, size) _plat_debug_print_buffer(buf, size) +# define TPM_DEBUG_PRINT_INT32(name, value) _plat_debug_print_int32(name, value) +# define TPM_DEBUG_PRINT_INT64(name, value) _plat_debug_print_int64(name, value) +// use the TPM_DEBUG_PRINTF versions only if there are extra arguments. +// GCC doesn't support an empty variable list, use TPM_DEBUG_PRINT instead. +# define TPM_DEBUG_PRINTF(s, ...) _plat_debug_printf(s, __VA_ARGS__) +# define TPM_DEBUG_SNPRINTF(buf, bufsize, s, ...) \ + _plat_debug_snprintf(buf, bufsize, s, __VA_ARGS__) + +#else + +# define TPM_DEBUG_PRINT(s) +# define TPM_DEBUG_PRINT_BUFFER(buf, size) +# define TPM_DEBUG_PRINT_INT32(name, value) +# define TPM_DEBUG_PRINT_INT64(name, value) +# define TPM_DEBUG_PRINTF(s, ...) +# define TPM_DEBUG_SNPRINTF(buf, bufsize, s, ...) + +#endif // ENABLE_TPM_DEBUG_PRINT + +// Verbose Code Path tracing +#if ENABLE_TPM_DEBUG_TRACE && ENABLE_TPM_DEBUG_PRINT + +# define TPM_DEBUG_TRACEX(extra) \ + TPM_DEBUG_PRINT(__func__); \ + TPM_DEBUG_PRINT(extra) + +# define TPM_DEBUG_TRACE() TPM_DEBUG_PRINT(__func__) + +#else + +# define TPM_DEBUG_TRACEX(s) +# define TPM_DEBUG_TRACE() + +#endif // ENABLE_TPM_DEBUG_TRACE && ENABLE_TPM_DEBUG_PRINT + +// Low Level Crypto Debugging +#if ENABLE_TPM_DEBUG_PRINT && ENABLE_CRYPTO_DEBUG + +// these functions are not declared here, but expect to be declared where these macros are consumed. +# define TPM_DEBUG_PRINT_BIGNUM(name, value) _bnDebug_printBigNum(name, value); +# define TPM_DEBUG_PRINT_BIGNUM_FULL(name, value) \ + _bnDebug_printBigNumFull(name, value); +# define TPM_DEBUG_PRINT_BIGPOINT(name, value) _bnDebug_printBigPoint(name, value); +# define TPM_DEBUG_PRINT_TPMS_ECC_POINT(name, value) \ + _bnDebug_printTPMS_ECC_POINT(name, value); +# define TPM_DEBUG_PRINT_TPM2B(name, value, reverse) \ + _bnDebug_printTpm2B(name, value, reverse); + +//#error SHOULD BE OFF + +#else + +# define TPM_DEBUG_PRINT_BIGNUM(name, value) +# define TPM_DEBUG_PRINT_BIGNUM_FULL(name, value) +# define TPM_DEBUG_PRINT_BIGPOINT(name, value) +# define TPM_DEBUG_PRINT_TPMS_ECC_POINT(name, value) +# define TPM_DEBUG_PRINT_TPM2B(name, value, reverse) + +#endif + +#endif //_TPM_DEBUG_H_ diff --git a/src/tpm2/tpm_public.h b/src/tpm2/tpm_public.h index c7343ee95..589552f2a 100644 --- a/src/tpm2/tpm_public.h +++ b/src/tpm2/tpm_public.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #include "TpmBuildSwitches.h" #include "TpmProfile.h" @@ -67,3 +9,4 @@ #include "MinMax.h" #include "tpm_radix.h" #include "TpmTypes.h" +#include "tpm_debug.h" diff --git a/src/tpm2/tpm_to_platform_interface.h b/src/tpm2/tpm_to_platform_interface.h index 4cf13bd7c..13481abe9 100644 --- a/src/tpm2/tpm_to_platform_interface.h +++ b/src/tpm2/tpm_to_platform_interface.h @@ -398,6 +398,18 @@ LIB_EXPORT int _plat__GetTpmFirmwareSecret( // return the TPM Type returned by TPM_PT_VENDOR_TPM_TYPE LIB_EXPORT uint32_t _plat__GetTpmType(void); // libtpms changed +#if ENABLE_TPM_DEBUG_PRINT + +LIB_EXPORT void _plat_debug_print(const char* str); +LIB_EXPORT void _plat_debug_print_buffer(const void* buf, const size_t size); +LIB_EXPORT void _plat_debug_print_int32(const char* name, uint32_t value); +LIB_EXPORT void _plat_debug_print_int64(const char* name, uint64_t value); +LIB_EXPORT void _plat_debug_printf(const char* fmt, ...); +LIB_EXPORT size_t _plat_debug_snprintf( + char* buf, size_t bufSize, const char* fmt, ...); + +#endif // ENABLE_TPM_DEBUG_PRINT + // platform PCR initialization functions #include "platform_pcr_fp.h" From 64f155d7f0af82f8bcad9c3af4ef3116fffaf418 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 23 Jul 2025 11:38:50 -0400 Subject: [PATCH 19/52] Sync: Have _TPM_Hash_Start/Data/End and FlushObject return error codes Signed-off-by: Stefan Berger --- src/tpm2/ContextCommands.c | 3 +- src/tpm2/IntegrityCommands.c | 59 ++++++++++++++++-------------- src/tpm2/Object.c | 64 ++------------------------------- src/tpm2/Object_fp.h | 62 ++------------------------------ src/tpm2/_TPM_Hash_Data_fp.h | 64 ++------------------------------- src/tpm2/_TPM_Hash_End_fp.h | 67 +++-------------------------------- src/tpm2/_TPM_Hash_Start_fp.h | 66 +++------------------------------- 7 files changed, 51 insertions(+), 334 deletions(-) diff --git a/src/tpm2/ContextCommands.c b/src/tpm2/ContextCommands.c index 70f9e9d95..eadaec5f8 100644 --- a/src/tpm2/ContextCommands.c +++ b/src/tpm2/ContextCommands.c @@ -459,7 +459,8 @@ TPM2_FlushContext( if(!IsObjectPresent(in->flushHandle)) return TPM_RCS_HANDLE + RC_FlushContext_flushHandle; // Flush object - FlushObject(in->flushHandle); + if(!FlushObject(in->flushHandle)) + return TPM_RC_FAILURE; break; case TPM_HT_HMAC_SESSION: case TPM_HT_POLICY_SESSION: diff --git a/src/tpm2/IntegrityCommands.c b/src/tpm2/IntegrityCommands.c index f3b6d13b1..88dab7b56 100644 --- a/src/tpm2/IntegrityCommands.c +++ b/src/tpm2/IntegrityCommands.c @@ -272,19 +272,19 @@ TPM2_PCR_Reset( #include "Tpm.h" /* This function is called to process a _TPM_Hash_Start() indication. */ -LIB_EXPORT void -_TPM_Hash_Start( - void - ) +LIB_EXPORT BOOL _TPM_Hash_Start(void) { TPM_RC result; TPMI_DH_OBJECT handle; // If a DRTM sequence object exists, free it up if(g_DRTMHandle != TPM_RH_UNASSIGNED) - { - FlushObject(g_DRTMHandle); - g_DRTMHandle = TPM_RH_UNASSIGNED; - } + { + // ensure g_DRTMHandle is cleared + // and Flush sequence object + TPMI_DH_OBJECT oldHandle = g_DRTMHandle; + g_DRTMHandle = TPM_RH_UNASSIGNED; + VERIFY(FlushObject(oldHandle), FATAL_ERROR_INTERNAL, FALSE); + } // Create an event sequence object and store the handle in global // g_DRTMHandle. A TPM_RC_OBJECT_MEMORY error may be returned at this point // The NULL value for the first parameter will cause the sequence structure to @@ -312,23 +312,21 @@ _TPM_Hash_Start( // then there's a big problem pAssert(handle < TRANSIENT_LAST); // Free the slot - FlushObject(handle); + VERIFY(FlushObject(handle), FATAL_ERROR_INTERNAL, FALSE); // Try to create an event sequence object again. This time, we must // succeed. result = ObjectCreateEventSequence(NULL, &g_DRTMHandle); if(result != TPM_RC_SUCCESS) FAIL(FATAL_ERROR_INTERNAL); } - return; + return TRUE; } #include "Tpm.h" /* This function is called to process a _TPM_Hash_Data() indication. */ -LIB_EXPORT void -_TPM_Hash_Data( - uint32_t dataSize, // IN: size of data to be extend - unsigned char *data // IN: data buffer - ) +LIB_EXPORT BOOL _TPM_Hash_Data(uint32_t dataSize, // IN: size of data to be extend + unsigned char* data // IN: data buffer +) { UINT32 i; HASH_OBJECT *hashObject; @@ -338,7 +336,12 @@ _TPM_Hash_Data( // was not called so this function returns without doing // anything. if(g_DRTMHandle == TPM_RH_UNASSIGNED) - return; + { + // do not enter failure mode because this is an ordering issue that + // can be triggered by a BIOS issue, not an internal failure. + return FALSE; + } + hashObject = (HASH_OBJECT *)HandleToObject(g_DRTMHandle); pAssert(hashObject->attributes.eventSeq); // For each of the implemented hash algorithms, update the digest with the @@ -351,15 +354,12 @@ _TPM_Hash_Data( // Update sequence object CryptDigestUpdate(&hashObject->state.hashState[i], dataSize, data); } - return; + return TRUE; } #include "Tpm.h" /* This function is called to process a _TPM_Hash_End() indication. */ -LIB_EXPORT void -_TPM_Hash_End( - void - ) +LIB_EXPORT BOOL _TPM_Hash_End(void) { UINT32 i; TPM2B_DIGEST digest; @@ -369,7 +369,12 @@ _TPM_Hash_End( // been called, _TPM_Hash_End was previously called, or some other command // was executed and the sequence was aborted. if(g_DRTMHandle == TPM_RH_UNASSIGNED) - return; + { + // do not enter failure mode because this is an ordering issue that + // can be triggered by a BIOS issue, not an internal failure. + return FALSE; + } + // Get DRTM sequence object hashObject = (HASH_OBJECT *)HandleToObject(g_DRTMHandle); // Is this _TPM_Hash_End after Startup or before @@ -404,8 +409,10 @@ _TPM_Hash_End( PcrDrtm(pcrHandle, hash, &digest); } } - // Flush sequence object. - FlushObject(g_DRTMHandle); - g_DRTMHandle = TPM_RH_UNASSIGNED; - return; + + // ensure g_DRTMHandle is cleared + // and Flush sequence object + TPMI_DH_OBJECT oldHandle = g_DRTMHandle; + g_DRTMHandle = TPM_RH_UNASSIGNED; + return FlushObject(oldHandle); } diff --git a/src/tpm2/Object.c b/src/tpm2/Object.c index f80264f66..0960db44e 100644 --- a/src/tpm2/Object.c +++ b/src/tpm2/Object.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Manage the object store of the TPM. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the functions that manage the object store of the TPM. @@ -698,7 +640,7 @@ ObjectContextLoadLibtpms(BYTE *buffer, // This function frees an object slot. // // This function requires that the object is loaded. -void FlushObject(TPMI_DH_OBJECT handle // IN: handle to be freed +BOOL FlushObject(TPMI_DH_OBJECT handle // IN: handle to be freed ) { UINT32 index = handle - TRANSIENT_FIRST; @@ -706,7 +648,7 @@ void FlushObject(TPMI_DH_OBJECT handle // IN: handle to be freed pAssert(index < MAX_LOADED_OBJECTS); // Clear all the object attributes MemorySet((BYTE*)&(s_objects[index].attributes), 0, sizeof(OBJECT_ATTRIBUTES)); - return; + return TRUE; } //*** ObjectFlushHierarchy() diff --git a/src/tpm2/Object_fp.h b/src/tpm2/Object_fp.h index 52990cf5c..e29375183 100644 --- a/src/tpm2/Object_fp.h +++ b/src/tpm2/Object_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Functions That Manage the Object Store of the TPM */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -247,7 +189,7 @@ ObjectContextLoadLibtpms(BYTE *buffer, // IN: buffer holding the // This function frees an object slot. // // This function requires that the object is loaded. -void FlushObject(TPMI_DH_OBJECT handle // IN: handle to be freed +BOOL FlushObject(TPMI_DH_OBJECT handle // IN: handle to be freed ); //*** ObjectFlushHierarchy() diff --git a/src/tpm2/_TPM_Hash_Data_fp.h b/src/tpm2/_TPM_Hash_Data_fp.h index ee17c383b..8062223ca 100644 --- a/src/tpm2/_TPM_Hash_Data_fp.h +++ b/src/tpm2/_TPM_Hash_Data_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: _TPM_Hash_Data_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -67,8 +8,7 @@ #ifndef __TPM_HASH_DATA_FP_H_ #define __TPM_HASH_DATA_FP_H_ -// This function is called to process a _TPM_Hash_Data indication. -LIB_EXPORT void _TPM_Hash_Data(uint32_t dataSize, // IN: size of data to be extend +LIB_EXPORT BOOL _TPM_Hash_Data(uint32_t dataSize, // IN: size of data to be extend unsigned char* data // IN: data buffer ); diff --git a/src/tpm2/_TPM_Hash_End_fp.h b/src/tpm2/_TPM_Hash_End_fp.h index e1ab079ca..03cc7480a 100644 --- a/src/tpm2/_TPM_Hash_End_fp.h +++ b/src/tpm2/_TPM_Hash_End_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: _TPM_Hash_End_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -67,7 +8,9 @@ #ifndef __TPM_HASH_END_FP_H_ #define __TPM_HASH_END_FP_H_ -// This function is called to process a _TPM_Hash_End indication. -LIB_EXPORT void _TPM_Hash_End(void); +// This function is called to process a _TPM_Hash_End indication. Returns FALSE +// on failure. If FALSE is returned caller should check for failure mode, (not +// all failures are fatal) +LIB_EXPORT BOOL _TPM_Hash_End(void); #endif // __TPM_HASH_END_FP_H_ diff --git a/src/tpm2/_TPM_Hash_Start_fp.h b/src/tpm2/_TPM_Hash_Start_fp.h index e187105d7..6c868e981 100644 --- a/src/tpm2/_TPM_Hash_Start_fp.h +++ b/src/tpm2/_TPM_Hash_Start_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: _TPM_Hash_Start_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -67,7 +8,8 @@ #ifndef __TPM_HASH_START_FP_H_ #define __TPM_HASH_START_FP_H_ -// This function is called to process a _TPM_Hash_Start indication. -LIB_EXPORT void _TPM_Hash_Start(void); +// It returns FALSE if the indication cannot be handled, and the TPM +// will be in FailureMode. +LIB_EXPORT BOOL _TPM_Hash_Start(void); #endif // __TPM_HASH_START_FP_H_ From 1038e5b00618f2055d43c0147b813a23395b3a5c Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 23 Jul 2025 11:58:00 -0400 Subject: [PATCH 20/52] Sync: Have several crypto functions return TPM_RC now Signed-off-by: Stefan Berger --- src/tpm2/CryptUtil.c | 192 +++++++++++++++++---------------- src/tpm2/crypto/CryptUtil_fp.h | 106 +++++------------- 2 files changed, 126 insertions(+), 172 deletions(-) diff --git a/src/tpm2/CryptUtil.c b/src/tpm2/CryptUtil.c index 40a807f34..f5f30df9d 100644 --- a/src/tpm2/CryptUtil.c +++ b/src/tpm2/CryptUtil.c @@ -260,14 +260,14 @@ BOOL CryptIsSchemeAnonymous(TPM_ALG_ID scheme // IN: the scheme algorithm to te // bits the number of bits required for the symmetric key // plus an IV */ -void ParmDecryptSym(TPM_ALG_ID symAlg, // IN: the symmetric algorithm - TPM_ALG_ID hash, // IN: hash algorithm for KDFa - UINT16 keySizeInBits, // IN: the key size in bits - TPM2B* key, // IN: KDF HMAC key - TPM2B* nonceCaller, // IN: nonce caller - TPM2B* nonceTpm, // IN: nonce TPM - UINT32 dataSize, // IN: size of parameter buffer - BYTE* data // OUT: buffer to be decrypted +TPM_RC ParmDecryptSym(TPM_ALG_ID symAlg, // IN: the symmetric algorithm + TPM_ALG_ID hash, // IN: hash algorithm for KDFa + UINT16 keySizeInBits, // IN: the key size in bits + TPM2B* key, // IN: KDF HMAC key + TPM2B* nonceCaller, // IN: nonce caller + TPM2B* nonceTpm, // IN: nonce TPM + UINT32 dataSize, // IN: size of parameter buffer + BYTE* data // OUT: buffer to be decrypted ) { // KDF output buffer @@ -294,16 +294,16 @@ void ParmDecryptSym(TPM_ALG_ID symAlg, // IN: the symmetric algorithm FALSE); MemoryCopy(iv.t.buffer, &symParmString[keySize], iv.t.size); - CryptSymmetricDecrypt(data, - symAlg, - keySizeInBits, - symParmString, - &iv, - TPM_ALG_CFB, - dataSize, - data); + return CryptSymmetricDecrypt(data, + symAlg, + keySizeInBits, + symParmString, + &iv, + TPM_ALG_CFB, + dataSize, + data); } - return; + return TPM_RC_SUCCESS; } //*** ParmEncryptSym() @@ -320,14 +320,14 @@ void ParmDecryptSym(TPM_ALG_ID symAlg, // IN: the symmetric algorithm // bits the number of bits required for the symmetric key // plus an IV */ -void ParmEncryptSym(TPM_ALG_ID symAlg, // IN: symmetric algorithm - TPM_ALG_ID hash, // IN: hash algorithm for KDFa - UINT16 keySizeInBits, // IN: symmetric key size in bits - TPM2B* key, // IN: KDF HMAC key - TPM2B* nonceCaller, // IN: nonce caller - TPM2B* nonceTpm, // IN: nonce TPM - UINT32 dataSize, // IN: size of parameter buffer - BYTE* data // OUT: buffer to be encrypted +TPM_RC ParmEncryptSym(TPM_ALG_ID symAlg, // IN: symmetric algorithm + TPM_ALG_ID hash, // IN: hash algorithm for KDFa + UINT16 keySizeInBits, // IN: symmetric key size in bits + TPM2B* key, // IN: KDF HMAC key + TPM2B* nonceCaller, // IN: nonce caller + TPM2B* nonceTpm, // IN: nonce TPM + UINT32 dataSize, // IN: size of parameter buffer + BYTE* data // OUT: buffer to be encrypted ) { // KDF output buffer @@ -355,16 +355,16 @@ void ParmEncryptSym(TPM_ALG_ID symAlg, // IN: symmetric algorithm FALSE); MemoryCopy(iv.t.buffer, &symParmString[keySize], iv.t.size); - CryptSymmetricEncrypt(data, - symAlg, - keySizeInBits, - symParmString, - &iv, - TPM_ALG_CFB, - dataSize, - data); + return CryptSymmetricEncrypt(data, + symAlg, + keySizeInBits, + symParmString, + &iv, + TPM_ALG_CFB, + dataSize, + data); } - return; + return TPM_RC_SUCCESS; } //*** CryptGenerateKeySymmetric() @@ -421,14 +421,13 @@ static TPM_RC CryptGenerateKeySymmetric( //*** CryptXORObfuscation() // This function implements XOR obfuscation. It should not be called if the -// hash algorithm is not implemented. The only return value from this function -// is TPM_RC_SUCCESS. -void CryptXORObfuscation(TPM_ALG_ID hash, // IN: hash algorithm for KDF - TPM2B* key, // IN: KDF key - TPM2B* contextU, // IN: contextU - TPM2B* contextV, // IN: contextV - UINT32 dataSize, // IN: size of data buffer - BYTE* data // IN/OUT: data to be XORed in place +// hash algorithm is not implemented. +TPM_RC CryptXORObfuscation(TPM_ALG_ID hash, // IN: hash algorithm for KDF + TPM2B* key, // IN: KDF key + TPM2B* contextU, // IN: contextU + TPM2B* contextV, // IN: contextV + UINT32 dataSize, // IN: size of data buffer + BYTE* data // IN/OUT: data to be XORed in place ) { BYTE mask[MAX_DIGEST_SIZE]; // Allocate a digest sized buffer @@ -439,7 +438,7 @@ void CryptXORObfuscation(TPM_ALG_ID hash, // IN: hash algorithm for KDF UINT32 requestSize = dataSize * 8; INT32 remainBytes = (INT32)dataSize; - pAssert((key != NULL) && (data != NULL) && (hLen != 0)); + pAssert_RC((key != NULL) && (data != NULL) && (hLen != 0)); // Call KDFa to generate XOR mask for(; remainBytes > 0; remainBytes -= hLen) @@ -460,7 +459,7 @@ void CryptXORObfuscation(TPM_ALG_ID hash, // IN: hash algorithm for KDF for(i = hLen < remainBytes ? hLen : remainBytes; i > 0; i--) *data++ ^= *pm++; } - return; + return TPM_RC_SUCCESS; } //**************************************************************************** @@ -873,12 +872,15 @@ CryptSecretDecrypt(OBJECT* decryptKey, // IN: decrypt key // nonceCaller the parameter from the TPM2_StartAuthHMAC command // nullNonce a zero-length nonce // XOR Obfuscation in place - CryptXORObfuscation(decryptKey->publicArea.nameAlg, - &decryptKey->sensitive.sensitive.bits.b, - &nonceCaller->b, - NULL, - secret->t.size, - secret->t.secret); + result = CryptXORObfuscation(decryptKey->publicArea.nameAlg, + &decryptKey->sensitive.sensitive.bits.b, + &nonceCaller->b, + NULL, + secret->t.size, + secret->t.secret); + if(result != TPM_RC_SUCCESS) + return result; + // Copy decrypted seed MemoryCopy2B(&data->b, &secret->b, sizeof(data->t.buffer)); } @@ -934,7 +936,7 @@ CryptSecretDecrypt(OBJECT* decryptKey, // IN: decrypt key //*** CryptParameterEncryption() // This function does in-place encryption of a response parameter. -void CryptParameterEncryption( +TPM_RC CryptParameterEncryption( TPM_HANDLE handle, // IN: encrypt session handle TPM2B* nonceCaller, // IN: nonce caller INT32 bufferSize, // IN: size of parameter buffer @@ -946,6 +948,8 @@ void CryptParameterEncryption( ) { SESSION* session = SessionGet(handle); // encrypt session + pAssert_RC(session); + TPM2B_TYPE(TEMP_KEY, (sizeof(extraKey->t.buffer) + sizeof(session->sessionKey.t.buffer))); TPM2B_TEMP_KEY key; // encryption key @@ -953,54 +957,54 @@ void CryptParameterEncryption( if(bufferSize < leadingSizeInByte) { - FAIL(FATAL_ERROR_INTERNAL); - return; + FAIL_RC(FATAL_ERROR_INTERNAL); } // Parameter encryption for a non-2B is not supported. if(leadingSizeInByte != 2) { - FAIL(FATAL_ERROR_INTERNAL); - return; + FAIL_RC(FATAL_ERROR_INTERNAL); } // Retrieve encrypted data size. if(UINT16_Unmarshal(&cipherSize, &buffer, &bufferSize) != TPM_RC_SUCCESS) { - FAIL(FATAL_ERROR_INTERNAL); - return; + FAIL_RC(FATAL_ERROR_INTERNAL); } if(cipherSize > bufferSize) { - FAIL(FATAL_ERROR_INTERNAL); - return; + FAIL_RC(FATAL_ERROR_INTERNAL); } // Compute encryption key by concatenating sessionKey with extra key MemoryCopy2B(&key.b, &session->sessionKey.b, sizeof(key.t.buffer)); MemoryConcat2B(&key.b, &extraKey->b, sizeof(key.t.buffer)); + TPM_RC result; if(session->symmetric.algorithm == TPM_ALG_XOR) - + { // XOR parameter encryption formulation: // XOR(parameter, hash, sessionAuth, nonceNewer, nonceOlder) - CryptXORObfuscation(session->authHashAlg, - &(key.b), - &(session->nonceTPM.b), - nonceCaller, - (UINT32)cipherSize, - buffer); + result = CryptXORObfuscation(session->authHashAlg, + &(key.b), + &(session->nonceTPM.b), + nonceCaller, + (UINT32)cipherSize, + buffer); + } else - ParmEncryptSym(session->symmetric.algorithm, - session->authHashAlg, - session->symmetric.keyBits.aes, - &(key.b), - nonceCaller, - &(session->nonceTPM.b), - (UINT32)cipherSize, - buffer); - return; + { + result = ParmEncryptSym(session->symmetric.algorithm, + session->authHashAlg, + session->symmetric.keyBits.aes, + &(key.b), + nonceCaller, + &(session->nonceTPM.b), + (UINT32)cipherSize, + buffer); + } + return result; } //*** CryptParameterDecryption() @@ -1020,6 +1024,8 @@ CryptParameterDecryption( ) { SESSION* session = SessionGet(handle); // encrypt session + pAssert_RC(session); + // The HMAC key is going to be the concatenation of the session key and any // additional key material (like the authValue). The size of both of these // is the size of the buffer which can contain a TPMT_HA. @@ -1037,6 +1043,7 @@ CryptParameterDecryption( if(leadingSizeInByte != 2) { FAIL_RC(FATAL_ERROR_INTERNAL); + return TPM_RC_SIZE; } // Retrieve encrypted data size. @@ -1054,28 +1061,33 @@ CryptParameterDecryption( MemoryCopy2B(&key.b, &session->sessionKey.b, sizeof(key.t.buffer)); MemoryConcat2B(&key.b, &extraKey->b, sizeof(key.t.buffer)); + TPM_RC result; if(session->symmetric.algorithm == TPM_ALG_XOR) + { // XOR parameter decryption formulation: // XOR(parameter, hash, sessionAuth, nonceNewer, nonceOlder) // Call XOR obfuscation function - CryptXORObfuscation(session->authHashAlg, - &key.b, - nonceCaller, - &(session->nonceTPM.b), - (UINT32)cipherSize, - buffer); + result = CryptXORObfuscation(session->authHashAlg, + &key.b, + nonceCaller, + &(session->nonceTPM.b), + (UINT32)cipherSize, + buffer); + } else + { // Assume that it is one of the symmetric block ciphers. - ParmDecryptSym(session->symmetric.algorithm, - session->authHashAlg, - session->symmetric.keyBits.sym, - &key.b, - nonceCaller, - &session->nonceTPM.b, - (UINT32)cipherSize, - buffer); + result = ParmDecryptSym(session->symmetric.algorithm, + session->authHashAlg, + session->symmetric.keyBits.sym, + &key.b, + nonceCaller, + &session->nonceTPM.b, + (UINT32)cipherSize, + buffer); + } - return TPM_RC_SUCCESS; + return result; } //*** CryptComputeSymmetricUnique() diff --git a/src/tpm2/crypto/CryptUtil_fp.h b/src/tpm2/crypto/CryptUtil_fp.h index 1c7d0edf9..cd7765ca0 100644 --- a/src/tpm2/crypto/CryptUtil_fp.h +++ b/src/tpm2/crypto/CryptUtil_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Interfaces to the CryptoEngine */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -75,38 +17,38 @@ BOOL CryptIsSchemeAnonymous(TPM_ALG_ID scheme // IN: the scheme algorithm to te //*** ParmDecryptSym() // This function performs parameter decryption using symmetric block cipher. -void ParmDecryptSym(TPM_ALG_ID symAlg, // IN: the symmetric algorithm - TPM_ALG_ID hash, // IN: hash algorithm for KDFa - UINT16 keySizeInBits, // IN: the key size in bits - TPM2B* key, // IN: KDF HMAC key - TPM2B* nonceCaller, // IN: nonce caller - TPM2B* nonceTpm, // IN: nonce TPM - UINT32 dataSize, // IN: size of parameter buffer - BYTE* data // OUT: buffer to be decrypted +TPM_RC ParmDecryptSym(TPM_ALG_ID symAlg, // IN: the symmetric algorithm + TPM_ALG_ID hash, // IN: hash algorithm for KDFa + UINT16 keySizeInBits, // IN: the key size in bits + TPM2B* key, // IN: KDF HMAC key + TPM2B* nonceCaller, // IN: nonce caller + TPM2B* nonceTpm, // IN: nonce TPM + UINT32 dataSize, // IN: size of parameter buffer + BYTE* data // OUT: buffer to be decrypted ); //*** ParmEncryptSym() // This function performs parameter encryption using symmetric block cipher. -void ParmEncryptSym(TPM_ALG_ID symAlg, // IN: symmetric algorithm - TPM_ALG_ID hash, // IN: hash algorithm for KDFa - UINT16 keySizeInBits, // IN: symmetric key size in bits - TPM2B* key, // IN: KDF HMAC key - TPM2B* nonceCaller, // IN: nonce caller - TPM2B* nonceTpm, // IN: nonce TPM - UINT32 dataSize, // IN: size of parameter buffer - BYTE* data // OUT: buffer to be encrypted +TPM_RC ParmEncryptSym(TPM_ALG_ID symAlg, // IN: symmetric algorithm + TPM_ALG_ID hash, // IN: hash algorithm for KDFa + UINT16 keySizeInBits, // IN: symmetric key size in bits + TPM2B* key, // IN: KDF HMAC key + TPM2B* nonceCaller, // IN: nonce caller + TPM2B* nonceTpm, // IN: nonce TPM + UINT32 dataSize, // IN: size of parameter buffer + BYTE* data // OUT: buffer to be encrypted ); //*** CryptXORObfuscation() // This function implements XOR obfuscation. It should not be called if the // hash algorithm is not implemented. The only return value from this function // is TPM_RC_SUCCESS. -void CryptXORObfuscation(TPM_ALG_ID hash, // IN: hash algorithm for KDF - TPM2B* key, // IN: KDF key - TPM2B* contextU, // IN: contextU - TPM2B* contextV, // IN: contextV - UINT32 dataSize, // IN: size of data buffer - BYTE* data // IN/OUT: data to be XORed in place +TPM_RC CryptXORObfuscation(TPM_ALG_ID hash, // IN: hash algorithm for KDF + TPM2B* key, // IN: KDF key + TPM2B* contextU, // IN: contextU + TPM2B* contextV, // IN: contextV + UINT32 dataSize, // IN: size of data buffer + BYTE* data // IN/OUT: data to be XORed in place ); //*** CryptInit() @@ -202,7 +144,7 @@ CryptSecretDecrypt(OBJECT* decryptKey, // IN: decrypt key //*** CryptParameterEncryption() // This function does in-place encryption of a response parameter. -void CryptParameterEncryption( +TPM_RC CryptParameterEncryption( TPM_HANDLE handle, // IN: encrypt session handle TPM2B* nonceCaller, // IN: nonce caller INT32 bufferSize, // IN: size of parameter buffer From efec01a6be6157c3ff72bb265b2afd601df4a829 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 23 Jul 2025 15:12:29 -0400 Subject: [PATCH 21/52] Sync: Put pAssert after every SessionGet Signed-off-by: Stefan Berger --- src/tpm2/AttestationCommands.c | 7 ++-- src/tpm2/ContextCommands.c | 16 ++++----- src/tpm2/EACommands.c | 22 ++++++++++++ src/tpm2/Entity.c | 62 ++-------------------------------- src/tpm2/PolicyTransportSPDM.c | 1 + src/tpm2/Session.c | 8 ++--- src/tpm2/SessionCommands.c | 6 +++- src/tpm2/SessionProcess.c | 18 ++++++++-- 8 files changed, 62 insertions(+), 78 deletions(-) diff --git a/src/tpm2/AttestationCommands.c b/src/tpm2/AttestationCommands.c index 78943448e..d65386bcc 100644 --- a/src/tpm2/AttestationCommands.c +++ b/src/tpm2/AttestationCommands.c @@ -203,9 +203,10 @@ TPM2_GetSessionAuditDigest( GetSessionAuditDigest_Out *out // OUT: output parameter list ) { - SESSION *session = SessionGet(in->sessionHandle); - TPMS_ATTEST auditInfo; - OBJECT *signObject = HandleToObject(in->signHandle); + SESSION* session = SessionGet(in->sessionHandle); + pAssert_RC(session); + TPMS_ATTEST auditInfo; + OBJECT* signObject = HandleToObject(in->signHandle); // Input Validation if(!IsSigningObject(signObject)) return TPM_RCS_KEY + RC_GetSessionAuditDigest_signHandle; diff --git a/src/tpm2/ContextCommands.c b/src/tpm2/ContextCommands.c index eadaec5f8..a913c1260 100644 --- a/src/tpm2/ContextCommands.c +++ b/src/tpm2/ContextCommands.c @@ -151,8 +151,8 @@ TPM2_ContextSave(ContextSave_In* in, // IN: input parameter list out->context.contextBlob.t.size = integritySize + fingerprintSize + objectSize; // Make sure things fit - pAssert(out->context.contextBlob.t.size - <= sizeof(out->context.contextBlob.t.buffer)); + pAssert_RC(out->context.contextBlob.t.size + <= sizeof(out->context.contextBlob.t.buffer)); // Copy the whole internal OBJECT structure to context blob MemoryCopy(outObject, objbuf, objectSize); // libtpms changed // Increment object context ID @@ -195,15 +195,15 @@ TPM2_ContextSave(ContextSave_In* in, // IN: input parameter list integritySize + fingerprintSize + sizeof(*session); // Make sure things fit - pAssert(out->context.contextBlob.t.size - < sizeof(out->context.contextBlob.t.buffer)); + pAssert_RC(out->context.contextBlob.t.size + < sizeof(out->context.contextBlob.t.buffer)); // Copy the whole internal SESSION structure to context blob. // Save space for fingerprint at the beginning of the buffer // This is done before anything else so that the actual context // can be reclaimed after this call - pAssert(sizeof(*session) <= sizeof(out->context.contextBlob.t.buffer) - - integritySize - fingerprintSize); + pAssert_RC(sizeof(*session) <= sizeof(out->context.contextBlob.t.buffer) + - integritySize - fingerprintSize); MemoryCopy( out->context.contextBlob.t.buffer + integritySize + fingerprintSize, session, @@ -233,8 +233,8 @@ TPM2_ContextSave(ContextSave_In* in, // IN: input parameter list // Save fingerprint at the beginning of encrypted area of context blob. // Reserve the integrity space - pAssert(sizeof(out->context.sequence) - <= sizeof(out->context.contextBlob.t.buffer) - integritySize); + pAssert_RC(sizeof(out->context.sequence) + <= sizeof(out->context.contextBlob.t.buffer) - integritySize); MemoryCopy(out->context.contextBlob.t.buffer + integritySize, &out->context.sequence, sizeof(out->context.sequence)); diff --git a/src/tpm2/EACommands.c b/src/tpm2/EACommands.c index b313d73bc..e274a5330 100644 --- a/src/tpm2/EACommands.c +++ b/src/tpm2/EACommands.c @@ -92,6 +92,7 @@ TPM2_PolicySigned(PolicySigned_In* in, // IN: input parameter list // Input Validation // Set up local pointers session = SessionGet(in->policySession); // the session structure + pAssert_RC(session); // Only do input validation if this is not a trial policy session if(session->attributes.isTrialPolicy == CLEAR) @@ -254,6 +255,7 @@ TPM2_PolicySecret(PolicySecret_In* in, // IN: input parameter list // Input Validation // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); //Only do input validation if this is not a trial policy session if(session->attributes.isTrialPolicy == CLEAR) @@ -360,6 +362,7 @@ TPM2_PolicyTicket(PolicyTicket_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // NOTE: A trial policy session is not allowed to use this command. // A ticket is used in place of a previously given authorization. Since @@ -458,6 +461,7 @@ TPM2_PolicyOR(PolicyOR_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // Compare and Update Internal Session policy if match for(i = 0; i < in->pHashList.count; i++) @@ -613,6 +617,7 @@ TPM2_PolicyPhysicalPresence(PolicyPhysicalPresence_In* in // IN: input paramete // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // Update policy hash // policyDigestnew = hash(policyDigestold || TPM_CC_PolicyPhysicalPresence) @@ -662,6 +667,7 @@ TPM2_PolicyLocality(PolicyLocality_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // Get new locality setting in canonical form marshalBuffer[0] = 0; // Code analysis says that this is not initialized @@ -776,6 +782,7 @@ TPM2_PolicyNV(PolicyNV_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); //If this is a trial policy, skip all validations and the operation if(session->attributes.isTrialPolicy == CLEAR) @@ -889,6 +896,7 @@ TPM2_PolicyCounterTimer(PolicyCounterTimer_In* in // IN: input parameter list return TPM_RCS_RANGE; // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); //If this is a trial policy, skip the check to see if the condition is met. if(session->attributes.isTrialPolicy == CLEAR) @@ -970,6 +978,7 @@ TPM2_PolicyCommandCode(PolicyCommandCode_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); if(session->commandCode != 0 && session->commandCode != in->code) return TPM_RCS_VALUE + RC_PolicyCommandCode_code; @@ -1028,6 +1037,7 @@ TPM2_PolicyCpHash(PolicyCpHash_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // A valid cpHash must have the same size as session hash digest // NOTE: the size of the digest can't be zero because TPM_ALG_NULL @@ -1094,6 +1104,7 @@ TPM2_PolicyNameHash(PolicyNameHash_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // A valid nameHash must have the same size as session hash digest // Since the authHashAlg for a session cannot be TPM_ALG_NULL, the digest size @@ -1159,6 +1170,7 @@ TPM2_PolicyDuplicationSelect( // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // nameHash in session context must be empty if(session->u1.nameHash.t.size != 0) @@ -1248,6 +1260,7 @@ TPM2_PolicyAuthorize(PolicyAuthorize_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); if(in->keySign.t.size < 2) { @@ -1337,6 +1350,7 @@ TPM2_PolicyAuthValue(PolicyAuthValue_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // Update policy hash // policyDigestnew = hash(policyDigestold || TPM_CC_PolicyAuthValue) @@ -1384,6 +1398,7 @@ TPM2_PolicyPassword(PolicyPassword_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // Update policy hash // policyDigestnew = hash(policyDigestold || TPM_CC_PolicyAuthValue) @@ -1422,6 +1437,8 @@ TPM2_PolicyGetDigest( // Command Output // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); + out->policyDigest = session->u2.policyDigest; return TPM_RC_SUCCESS; } @@ -1448,6 +1465,7 @@ TPM2_PolicyNvWritten(PolicyNvWritten_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // If already set is this a duplicate (the same setting)? If it // is a conflicting setting, it is an error @@ -1511,6 +1529,7 @@ TPM2_PolicyTemplate(PolicyTemplate_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // error if the templateHash in session context is not empty and is not the // same as the input or is not a template @@ -1586,6 +1605,7 @@ TPM2_PolicyAuthorizeNV(PolicyAuthorizeNV_In* in) // Input Validation // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // Skip checks if this is a trial policy if(!session->attributes.isTrialPolicy) @@ -1702,6 +1722,7 @@ TPM2_PolicyCapability(PolicyCapability_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); if(session->attributes.isTrialPolicy == CLEAR) { @@ -1939,6 +1960,7 @@ TPM2_PolicyParameters(PolicyParameters_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // A valid pHash must have the same size as session hash digest // Since the authHashAlg for a session cannot be TPM_ALG_NULL, the digest size diff --git a/src/tpm2/Entity.c b/src/tpm2/Entity.c index 7d38e67e4..fe9d8fe8e 100644 --- a/src/tpm2/Entity.c +++ b/src/tpm2/Entity.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Accessing properties for handles of various types */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // The functions in this file are used for accessing properties for handles of @@ -149,6 +91,7 @@ EntityGetLoadStatus(COMMAND* command // IN/OUT: command parsing structure { SESSION* session; session = SessionGet(handle); + pAssert_RC(session != NULL); // Check if the session is a HMAC session if(session->attributes.isPolicy == SET) result = TPM_RC_HANDLE; @@ -164,6 +107,7 @@ EntityGetLoadStatus(COMMAND* command // IN/OUT: command parsing structure { SESSION* session; session = SessionGet(handle); + pAssert_RC(session != NULL); // Check if the session is a policy session if(session->attributes.isPolicy == CLEAR) result = TPM_RC_HANDLE; diff --git a/src/tpm2/PolicyTransportSPDM.c b/src/tpm2/PolicyTransportSPDM.c index e51aa48d0..c0733b2f8 100644 --- a/src/tpm2/PolicyTransportSPDM.c +++ b/src/tpm2/PolicyTransportSPDM.c @@ -27,6 +27,7 @@ TPM2_PolicyTransportSPDM(PolicyTransportSPDM_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); + pAssert_RC(session); // Check that TPM2_PolicyTransportSPDM has not previously been executed if(session->attributes.checkSecureChannel == SET) diff --git a/src/tpm2/Session.c b/src/tpm2/Session.c index 1571980e3..b3e7d47c4 100644 --- a/src/tpm2/Session.c +++ b/src/tpm2/Session.c @@ -306,18 +306,18 @@ SESSION* SessionGet(TPM_HANDLE handle // IN: session handle size_t slotIndex; CONTEXT_SLOT sessionIndex; - pAssert(HandleGetType(handle) == TPM_HT_POLICY_SESSION - || HandleGetType(handle) == TPM_HT_HMAC_SESSION); + pAssert_NULL(HandleGetType(handle) == TPM_HT_POLICY_SESSION + || HandleGetType(handle) == TPM_HT_HMAC_SESSION); slotIndex = handle & HR_HANDLE_MASK; - pAssert(slotIndex < MAX_ACTIVE_SESSIONS); + pAssert_NULL(slotIndex < MAX_ACTIVE_SESSIONS); // get the contents of the session array. Because session is loaded, we // should always get a valid sessionIndex sessionIndex = gr.contextArray[slotIndex] - 1; - pAssert(sessionIndex < MAX_LOADED_SESSIONS); + pAssert_NULL(sessionIndex < MAX_LOADED_SESSIONS); return &s_sessions[sessionIndex].session; } diff --git a/src/tpm2/SessionCommands.c b/src/tpm2/SessionCommands.c index d2f3f96c7..3d9deb8fc 100644 --- a/src/tpm2/SessionCommands.c +++ b/src/tpm2/SessionCommands.c @@ -168,8 +168,12 @@ TPM2_PolicyRestart( PolicyRestart_In *in // IN: input parameter list ) { + SESSION* session = SessionGet(in->sessionHandle); + pAssert_RC(session != NULL); + // Initialize policy session data - SessionResetPolicyData(SessionGet(in->sessionHandle)); + SessionResetPolicyData(session); + return TPM_RC_SUCCESS; } #endif // CC_PolicyRestart diff --git a/src/tpm2/SessionProcess.c b/src/tpm2/SessionProcess.c index ab53946ff..9be9d1c76 100644 --- a/src/tpm2/SessionProcess.c +++ b/src/tpm2/SessionProcess.c @@ -93,6 +93,7 @@ static TPM_RC IncrementLockout(UINT32 sessionIndex) else { session = SessionGet(sessionHandle); + pAssert_RC(session); // If the session is bound to lockout, then use that as the relevant // handle. This means that an authorization failure with a bound session // bound to lockoutAuth will take precedence over any other @@ -107,7 +108,7 @@ static TPM_RC IncrementLockout(UINT32 sessionIndex) } if(handle == TPM_RH_LOCKOUT) { - pAssert(gp.lockOutAuthEnabled == TRUE); + pAssert_RC(gp.lockOutAuthEnabled == TRUE); // lockout is no longer enabled gp.lockOutAuthEnabled = FALSE; @@ -864,6 +865,7 @@ static TPM2B_DIGEST* ComputeCommandHMAC( // Will add the nonce for the decrypt session. SESSION* decryptSession = SessionGet(s_sessionHandles[s_decryptSessionIndex]); + pAssert_RC(decryptSession != NULL); nonceDecrypt = &decryptSession->nonceTPM; } // Now repeat for the encrypt session. @@ -880,6 +882,7 @@ static TPM2B_DIGEST* ComputeCommandHMAC( // Continue with the HMAC processing. session = SessionGet(s_sessionHandles[sessionIndex]); + pAssert_RC(session != NULL); // Generate HMAC key. MemoryCopy2B(&key.b, &session->sessionKey.b, sizeof(key.t.buffer)); @@ -1003,6 +1006,7 @@ static TPM_RC CheckPolicyAuthSession( // // Initialize pointer to the authorization session. session = SessionGet(s_sessionHandles[sessionIndex]); + pAssert_RC(session != NULL); // If the command is TPM2_PolicySecret(), make sure that // either password or authValue is required @@ -1233,6 +1237,7 @@ static TPM_RC RetrieveSessionData( return TPM_RC_REFERENCE_S0 + sessionIndex; sessionType = HandleGetType(s_sessionHandles[sessionIndex]); session = SessionGet(s_sessionHandles[sessionIndex]); + pAssert_RC(session != NULL); // Check if the session is an HMAC/policy session. if((session->attributes.isPolicy == SET && sessionType == TPM_HT_HMAC_SESSION) @@ -1416,6 +1421,7 @@ static TPM_RC CheckAuthSession( if(sessionHandle != TPM_RS_PW) { session = SessionGet(sessionHandle); + pAssert_RC(session != NULL); // Set includeAuth to indicate if DA checking will be required and if the // authValue will be included in any HMAC. @@ -1580,7 +1586,7 @@ ParseSessionBuffer(COMMAND* command // IN: the structure that contains return result; // There is no command in the TPM spec that has more handles than // MAX_SESSION_NUM. - pAssert(command->handleNum <= MAX_SESSION_NUM); + pAssert_RC(command->handleNum <= MAX_SESSION_NUM); // Associate the session with an authorization handle. for(i = 0; i < command->handleNum; i++) @@ -1620,6 +1626,7 @@ ParseSessionBuffer(COMMAND* command // IN: the structure that contains else { session = SessionGet(s_sessionHandles[sessionIndex]); + pAssert_RC(session != NULL); // A trial session can not appear in session area, because it cannot // be used for authorization, audit or encrypt/decrypt. @@ -1658,7 +1665,7 @@ ParseSessionBuffer(COMMAND* command // IN: the structure that contains return TPM_RCS_ATTRIBUTES + errorIndex; // no authValue included in any of the HMAC computations - pAssert(session != NULL); + pAssert_RC(session != NULL); session->attributes.includeAuth = CLEAR; // check HMAC for encrypt/decrypt/audit only sessions @@ -1895,6 +1902,7 @@ static void UpdateAuditSessionStatus( if(s_sessionHandles[i] == TPM_RS_PW) continue; session = SessionGet(s_sessionHandles[i]); + pAssert_VOID_OK(session != NULL); // If a session is used for audit if(IS_ATTRIBUTE(s_attributes[i], TPMA_SESSION, audit)) @@ -2066,6 +2074,8 @@ static TPM2B_NONCE* BuildSingleResponseAuth( { // Fill in policy/HMAC based session response. SESSION* session = SessionGet(s_sessionHandles[sessionIndex]); + pAssert_NULL(session != NULL); + // // If the session is a policy session with isPasswordNeeded SET, the // authorization field is empty. @@ -2094,6 +2104,7 @@ static void UpdateAllNonceTPM(COMMAND* command // IN: controlling structure if(s_sessionHandles[i] != TPM_RS_PW) { session = SessionGet(s_sessionHandles[i]); + pAssert_VOID_OK(session != NULL); // Update nonceTPM in both internal session and response. CryptRandomGenerate(session->nonceTPM.t.size, session->nonceTPM.t.buffer); } @@ -2203,6 +2214,7 @@ BuildResponseSession(COMMAND* command // IN: structure that has relevant comman // Compute the response HMAC and get a pointer to the nonce used. // This function will also update the values if needed. Note, the nonceTPM = BuildSingleResponseAuth(command, i, &responseAuth); + pAssert_RC(nonceTPM != NULL); } command->authSize += TPM2B_NONCE_Marshal(nonceTPM, &command->responseBuffer, NULL); From 09d2851108fd39f50dd0f9e618e9470f3d5b334b Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 23 Jul 2025 16:15:45 -0400 Subject: [PATCH 22/52] Sync: Add pAsserts after many HandleToObject calls Signed-off-by: Stefan Berger --- src/tpm2/AsymmetricCommands.c | 18 ++++++++-- src/tpm2/AttestationCommands.c | 5 +++ src/tpm2/ContextCommands.c | 1 + src/tpm2/DuplicationCommands.c | 14 ++++++-- src/tpm2/EncryptDecrypt_spt.c | 65 ++-------------------------------- src/tpm2/Entity.c | 21 ++++++++--- src/tpm2/EphemeralCommands.c | 1 + src/tpm2/HashCommands.c | 13 +++++++ src/tpm2/IntegrityCommands.c | 5 +++ src/tpm2/ObjectCommands.c | 15 ++++++-- src/tpm2/SessionCommands.c | 3 ++ src/tpm2/SessionProcess.c | 5 ++- src/tpm2/SymmetricCommands.c | 3 ++ 13 files changed, 96 insertions(+), 73 deletions(-) diff --git a/src/tpm2/AsymmetricCommands.c b/src/tpm2/AsymmetricCommands.c index 8eea24b0c..5e66e643b 100644 --- a/src/tpm2/AsymmetricCommands.c +++ b/src/tpm2/AsymmetricCommands.c @@ -72,6 +72,8 @@ TPM2_RSA_Encrypt( TPMT_RSA_DECRYPT *scheme; // Input Validation rsaKey = HandleToObject(in->keyHandle); + pAssert_RC(rsaKey != NULL); + // selected key must be an RSA key if(rsaKey->publicArea.type != TPM_ALG_RSA) return TPM_RCS_KEY + RC_RSA_Encrypt_keyHandle; @@ -108,6 +110,8 @@ TPM2_RSA_Decrypt( TPMT_RSA_DECRYPT *scheme; // Input Validation rsaKey = HandleToObject(in->keyHandle); + pAssert_RC(rsaKey != NULL); + // The selected key must be an RSA key if(rsaKey->publicArea.type != TPM_ALG_RSA) return TPM_RCS_KEY + RC_RSA_Decrypt_keyHandle; @@ -151,6 +155,8 @@ TPM2_ECDH_KeyGen( TPM_RC result; // Input Validation eccKey = HandleToObject(in->keyHandle); + pAssert_RC(eccKey != NULL); + // Referenced key must be an ECC key if(eccKey->publicArea.type != TPM_ALG_ECC) return TPM_RCS_KEY + RC_ECDH_KeyGen_keyHandle; @@ -195,6 +201,8 @@ TPM2_ECDH_ZGen( OBJECT *eccKey; // Input Validation eccKey = HandleToObject(in->keyHandle); + pAssert_RC(eccKey != NULL); + // Selected key must be a non-restricted, decrypt ECC key if(eccKey->publicArea.type != TPM_ALG_ECC) return TPM_RCS_KEY + RC_ECDH_ZGen_keyHandle; @@ -256,6 +264,8 @@ TPM2_ZGen_2Phase( // Input Validation eccKey = HandleToObject(in->keyA); + pAssert_RC(eccKey != NULL); + // keyA must be an ECC key if(eccKey->publicArea.type != TPM_ALG_ECC) return TPM_RCS_KEY + RC_ZGen_2Phase_keyA; @@ -312,7 +322,9 @@ TPM2_ECC_Encrypt( ECC_Encrypt_Out *out // OUT: output parameter list ) { - OBJECT *pubKey = HandleToObject(in->keyHandle); + OBJECT* pubKey = HandleToObject(in->keyHandle); + pAssert_RC(pubKey != NULL); + // Parameter validation if (pubKey->publicArea.type != TPM_ALG_ECC) return TPM_RC_KEY + RC_ECC_Encrypt_keyHandle; @@ -335,7 +347,9 @@ TPM2_ECC_Decrypt( ECC_Decrypt_Out *out // OUT: output parameter list ) { - OBJECT *key = HandleToObject(in->keyHandle); + OBJECT* key = HandleToObject(in->keyHandle); + pAssert_RC(key != NULL); + // Parameter validation // Must be the correct type of key with correct attributes if (key->publicArea.type != TPM_ALG_ECC) diff --git a/src/tpm2/AttestationCommands.c b/src/tpm2/AttestationCommands.c index d65386bcc..1aa468fdf 100644 --- a/src/tpm2/AttestationCommands.c +++ b/src/tpm2/AttestationCommands.c @@ -87,6 +87,7 @@ TPM2_Certify( certifyInfo.type = TPM_ST_ATTEST_CERTIFY; // NOTE: the certified object is not allowed to be TPM_ALG_NULL so // 'certifiedObject' will never be NULL + pAssert_RC(certifiedObject != NULL); // should have been filtered earlier. certifyInfo.attested.certify.name = certifiedObject->name; // When using an anonymous signing scheme, need to set the qualified Name to the @@ -123,6 +124,8 @@ TPM2_CertifyCreation( return TPM_RCS_KEY + RC_CertifyCreation_signHandle; if(!CryptSelectSignScheme(signObject, &in->inScheme)) return TPM_RCS_SCHEME + RC_CertifyCreation_inScheme; + + pAssert_RC(certified != NULL); // CertifyCreation specific input validation // Re-compute ticket TicketComputeCreation(in->creationTicket.hierarchy, &certified->name, @@ -339,6 +342,8 @@ TPM2_CertifyX509( INT16 length; // length for a tagged element ASN1UnmarshalContext ctx; ASN1MarshalContext ctxOut; + pAssert_RC(object != NULL); + // certTBS holds an array of pointers and lengths. Each entry references the // corresponding value in a TBSCertificate structure. For example, the 1th // element references the version number diff --git a/src/tpm2/ContextCommands.c b/src/tpm2/ContextCommands.c index a913c1260..613bc0435 100644 --- a/src/tpm2/ContextCommands.c +++ b/src/tpm2/ContextCommands.c @@ -516,6 +516,7 @@ TPM2_EvictControl(EvictControl_In* in // IN: input parameter list // Get internal object pointer evictObject = HandleToObject(in->objectHandle); + pAssert_RC(evictObject != NULL); // Objects in a firmware-limited or SVN-limited hierarchy cannot be made // persistent. diff --git a/src/tpm2/DuplicationCommands.c b/src/tpm2/DuplicationCommands.c index 47fe7cfad..8b8a65739 100644 --- a/src/tpm2/DuplicationCommands.c +++ b/src/tpm2/DuplicationCommands.c @@ -78,6 +78,8 @@ TPM2_Duplicate( // Input Validation // Get duplicate object pointer object = HandleToObject(in->objectHandle); + pAssert_RC(object != NULL); + // Get new parent newParent = HandleToObject(in->newParentHandle); // duplicate key must have fixParent bit CLEAR. @@ -172,6 +174,8 @@ TPM2_Rewrap( // old parent key must be a storage object if(!ObjectIsStorage(in->oldParent)) return TPM_RCS_TYPE + RC_Rewrap_oldParent; + + pAssert_RC(oldParent != NULL); // Decrypt input secret data via asymmetric decryption. A // TPM_RC_VALUE, TPM_RC_KEY or unmarshal errors may be returned at this // point @@ -190,7 +194,7 @@ TPM2_Rewrap( hashSize = sizeof(UINT16) + CryptHashGetDigestSize(oldParent->publicArea.nameAlg); privateBlob.t.size = in->inDuplicate.t.size - hashSize; - pAssert(privateBlob.t.size <= sizeof(privateBlob.t.buffer)); + pAssert_RC(privateBlob.t.size <= sizeof(privateBlob.t.buffer)); MemoryCopy(privateBlob.t.buffer, in->inDuplicate.t.buffer + hashSize, privateBlob.t.size); } @@ -203,9 +207,13 @@ TPM2_Rewrap( { OBJECT *newParent; newParent = HandleToObject(in->newParent); + // New parent must be a storage object if(!ObjectIsStorage(in->newParent)) return TPM_RCS_TYPE + RC_Rewrap_newParent; + + pAssert_RC(newParent != NULL); + // Make new encrypt key and its associated secret structure. A // TPM_RC_VALUE error may be returned at this point if RSA algorithm is // enabled in TPM @@ -273,6 +281,8 @@ TPM2_Import( return TPM_RCS_ATTRIBUTES + RC_Import_objectPublic; // Get parent pointer parentObject = HandleToObject(in->parentHandle); + pAssert_RC(parentObject != NULL); + if(!ObjectIsParent(parentObject)) return TPM_RCS_TYPE + RC_Import_parentHandle; if(in->symmetricAlg.algorithm != TPM_ALG_NULL) @@ -306,7 +316,7 @@ TPM2_Import( // TPM_RC_SIZE, TPM_RC_VALUE may be returned at this point result = CryptSecretDecrypt(parentObject, NULL, DUPLICATE_STRING, &in->inSymSeed, &data); - pAssert(result != TPM_RC_BINDING); + pAssert_RC(result != TPM_RC_BINDING); if(result != TPM_RC_SUCCESS) return RcSafeAddToResult(result, RC_Import_inSymSeed); } diff --git a/src/tpm2/EncryptDecrypt_spt.c b/src/tpm2/EncryptDecrypt_spt.c index 95d70b672..4bd287bad 100644 --- a/src/tpm2/EncryptDecrypt_spt.c +++ b/src/tpm2/EncryptDecrypt_spt.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Encrypt Decrypt Support */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: EncryptDecrypt_spt.c 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2021 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #include "Tpm.h" #include "EncryptDecrypt_fp.h" @@ -94,8 +35,8 @@ EncryptDecryptShared(TPMI_DH_OBJECT keyHandleIn, BOOL OK; // Input Validation symKey = HandleToObject(keyHandleIn); - mode = symKey->publicArea.parameters.symDetail.sym.mode.sym; - + pAssert_RC(symKey != NULL); + mode = symKey->publicArea.parameters.symDetail.sym.mode.sym; // The input key should be a symmetric key if(symKey->publicArea.type != TPM_ALG_SYMCIPHER) return TPM_RCS_KEY + RC_EncryptDecrypt_keyHandle; diff --git a/src/tpm2/Entity.c b/src/tpm2/Entity.c index fe9d8fe8e..89aa441b3 100644 --- a/src/tpm2/Entity.c +++ b/src/tpm2/Entity.c @@ -320,8 +320,9 @@ EntityGetAuthPolicy(TPMI_DH_ENTITY handle, // IN: handle of entity // authPolicy for an object { OBJECT* object = HandleToObject(handle); - *authPolicy = object->publicArea.authPolicy; - hashAlg = object->publicArea.nameAlg; + GOTO_ERROR_UNLESS(object != NULL); + *authPolicy = object->publicArea.authPolicy; + hashAlg = object->publicArea.nameAlg; } break; case TPM_HT_NV_INDEX: @@ -342,6 +343,7 @@ EntityGetAuthPolicy(TPMI_DH_ENTITY handle, // IN: handle of entity FAIL(FATAL_ERROR_INTERNAL); break; } +Error: return hashAlg; } @@ -357,8 +359,17 @@ TPM2B_NAME* EntityGetName(TPMI_DH_ENTITY handle, // IN: handle of entity { // Name for an object OBJECT* object = HandleToObject(handle); - // an object with no nameAlg has no name - if(object->publicArea.nameAlg == TPM_ALG_NULL) + + if(object == NULL) + { + // should not have gotten in this function in this case but we + // can safely enter failure mode and return an empty name + // through the if statement below. + FAIL_NORET(FATAL_ERROR_ASSERT); + } + + // an invalid object or an object with no nameAlg has no name + if(object == NULL || object->publicArea.nameAlg == TPM_ALG_NULL) name->b.size = 0; else *name = object->name; @@ -435,6 +446,8 @@ EntityGetHierarchy(TPMI_DH_ENTITY handle // IN :handle of entity { OBJECT* object; object = HandleToObject(handle); + VERIFY(object != NULL, FATAL_ERROR_ASSERT, TPM_RH_NULL); + if(object->attributes.ppsHierarchy) { hierarchy = TPM_RH_PLATFORM; diff --git a/src/tpm2/EphemeralCommands.c b/src/tpm2/EphemeralCommands.c index 84f98704c..9b0db4dea 100644 --- a/src/tpm2/EphemeralCommands.c +++ b/src/tpm2/EphemeralCommands.c @@ -100,6 +100,7 @@ TPM2_Commit(Commit_In* in, // IN: input parameter list return TPM_RC_TYPE; // libtpms added end eccKey = HandleToObject(in->signHandle); + pAssert_RC(eccKey != NULL); parms = &eccKey->publicArea.parameters.eccDetail; // Input key must be an ECC key diff --git a/src/tpm2/HashCommands.c b/src/tpm2/HashCommands.c index 44cb5bd2f..d2144b27b 100644 --- a/src/tpm2/HashCommands.c +++ b/src/tpm2/HashCommands.c @@ -74,7 +74,11 @@ TPM2_HMAC_Start( // Input Validation // Get HMAC key object and public area pointers keyObject = HandleToObject(in->handle); + pAssert_RC(keyObject != NULL); + publicArea = &keyObject->publicArea; + pAssert_RC(publicArea != NULL); + // Make sure that the key is an HMAC key if(publicArea->type != TPM_ALG_KEYEDHASH) return TPM_RCS_TYPE + RC_HMAC_Start_handle; @@ -130,7 +134,10 @@ TPM2_MAC_Start( // Input Validation // Get HMAC key object and public area pointers keyObject = HandleToObject(in->handle); + pAssert_RC(keyObject != NULL); publicArea = &keyObject->publicArea; + pAssert_RC(publicArea != NULL); + // Make sure that the key can do what is required result = CryptSelectMac(publicArea, &in->inScheme); // If the key is not able to do a MAC, indicate that the handle selects an @@ -192,6 +199,8 @@ TPM2_SequenceUpdate( // Check that referenced object is a sequence object. if(!ObjectIsSequence(object)) return TPM_RCS_MODE + RC_SequenceUpdate_sequenceHandle; + + pAssert_RC(object != NULL); // Internal Data Update if(object->attributes.eventSeq == SET) { @@ -247,6 +256,8 @@ TPM2_SequenceComplete( // Input validation // Get hash object pointer hashObject = (HASH_OBJECT *)HandleToObject(in->sequenceHandle); + pAssert_RC(hashObject != NULL); + // input handle must be a hash or HMAC sequence object. if(hashObject->attributes.hashSeq == CLEAR && hashObject->attributes.hmacSeq == CLEAR) @@ -332,6 +343,8 @@ TPM2_EventSequenceComplete( // Input validation // get the event sequence object pointer hashObject = (HASH_OBJECT *)HandleToObject(in->sequenceHandle); + pAssert_RC(hashObject != NULL); + // input handle must reference an event sequence object if(hashObject->attributes.eventSeq != SET) return TPM_RCS_MODE + RC_EventSequenceComplete_sequenceHandle; diff --git a/src/tpm2/IntegrityCommands.c b/src/tpm2/IntegrityCommands.c index 88dab7b56..1380e456f 100644 --- a/src/tpm2/IntegrityCommands.c +++ b/src/tpm2/IntegrityCommands.c @@ -343,7 +343,9 @@ LIB_EXPORT BOOL _TPM_Hash_Data(uint32_t dataSize, // IN: size of data to be ex } hashObject = (HASH_OBJECT *)HandleToObject(g_DRTMHandle); + pAssert_BOOL(hashObject != NULL); pAssert(hashObject->attributes.eventSeq); + // For each of the implemented hash algorithms, update the digest with the // data provided. for(i = 0; i < HASH_COUNT; i++) @@ -377,6 +379,9 @@ LIB_EXPORT BOOL _TPM_Hash_End(void) // Get DRTM sequence object hashObject = (HASH_OBJECT *)HandleToObject(g_DRTMHandle); + pAssert_BOOL(hashObject != NULL); + pAssert_BOOL(hashObject->attributes.eventSeq); + // Is this _TPM_Hash_End after Startup or before if(TPMIsStarted()) { diff --git a/src/tpm2/ObjectCommands.c b/src/tpm2/ObjectCommands.c index 6abfbacce..4f87ae090 100644 --- a/src/tpm2/ObjectCommands.c +++ b/src/tpm2/ObjectCommands.c @@ -121,7 +121,7 @@ TPM2_Create(Create_In* in, // IN: input parameter list TPMT_PUBLIC* publicArea; // Input Validation parentObject = HandleToObject(in->parentHandle); - pAssert(parentObject != NULL); + pAssert_RC(parentObject != NULL); // Does parent have the proper attributes? if(!ObjectIsParent(parentObject)) @@ -238,7 +238,7 @@ TPM2_Load( if(in->inPrivate.t.size == 0) return TPM_RCS_SIZE + RC_Load_inPrivate; parentObject = HandleToObject(in->parentHandle); - pAssert(parentObject != NULL); + pAssert_RC(parentObject != NULL); // Is the object that is being used as the parent actually a parent. if(!ObjectIsParent(parentObject)) return TPM_RCS_TYPE + RC_Load_parentHandle; @@ -343,6 +343,11 @@ TPM2_ReadPublic( // Can not read public area of a sequence object if(ObjectIsSequence(object)) return TPM_RC_SEQUENCE; + + // deliberately after ObjectIsSequence in case ObjectInSequence decides a + // null object is a non-fatal error + pAssert_RC(object != NULL); + // Command Output out->outPublic.publicArea = object->publicArea; out->name = object->name; @@ -386,6 +391,10 @@ TPM2_ActivateCredential( return TPM_RC_FAILURE; return RcSafeAddToResult(result, RC_ActivateCredential_secret); } + // this assertion is deliberately late, after other validation has happened + // soas to not change existing behavior of the function + pAssert_RC(activateObject != NULL); + // Retrieve secret data. A TPM_RC_INTEGRITY error or unmarshal // errors may be returned at this point result = CredentialToSecret(&in->credentialBlob.b, @@ -449,6 +458,8 @@ TPM2_Unseal( // Input Validation // Get pointer to loaded object object = HandleToObject(in->itemHandle); + pAssert_RC(object != NULL); + // Input handle must be a data object if(object->publicArea.type != TPM_ALG_KEYEDHASH) return TPM_RCS_TYPE + RC_Unseal_itemHandle; diff --git a/src/tpm2/SessionCommands.c b/src/tpm2/SessionCommands.c index 3d9deb8fc..a5ed0cb16 100644 --- a/src/tpm2/SessionCommands.c +++ b/src/tpm2/SessionCommands.c @@ -82,6 +82,7 @@ TPM2_StartAuthSession( { // Get pointer to loaded decrypt key tpmKey = HandleToObject(in->tpmKey); + pAssert_RC(tpmKey != NULL); // key must be asymmetric with its sensitive area loaded. Since this // command does not require authorization, the presence of the sensitive // area was not already checked as it is with most other commands that @@ -118,6 +119,8 @@ TPM2_StartAuthSession( case TPM_HT_TRANSIENT: { OBJECT *object = HandleToObject(in->bind); + pAssert_RC(object != NULL); + // If the bind handle references a transient object, make sure that we // can get to the authorization value. Also, make sure that the object // has a proper Name (nameAlg != TPM_ALG_NULL). If it doesn't, then diff --git a/src/tpm2/SessionProcess.c b/src/tpm2/SessionProcess.c index 9be9d1c76..8c5375045 100644 --- a/src/tpm2/SessionProcess.c +++ b/src/tpm2/SessionProcess.c @@ -208,7 +208,7 @@ static BOOL IsPolicySessionRequired(COMMAND_INDEX commandIndex, // IN: command if(type == TPM_HT_TRANSIENT) { OBJECT* object = HandleToObject(s_associatedHandles[sessionIndex]); - + pAssert_BOOL(object != NULL); if(!IS_ATTRIBUTE( object->publicArea.objectAttributes, TPMA_OBJECT, adminWithPolicy)) return FALSE; @@ -299,6 +299,7 @@ static BOOL IsAuthValueAvailable(TPM_HANDLE handle, // IN: handle of e TPMA_OBJECT attributes; // object = HandleToObject(handle); + pAssert_BOOL(object != NULL); attributes = object->publicArea.objectAttributes; // authValue is always available for a sequence object. @@ -433,6 +434,7 @@ static BOOL IsAuthPolicyAvailable(TPM_HANDLE handle, // IN: handle of // An evict object would already have been loaded and given a // transient object handle by this point. OBJECT* object = HandleToObject(handle); + pAssert_BOOL(object != NULL); // Policy authorization is not available for an object with only // public portion loaded. if(object->attributes.publicOnly == CLEAR) @@ -480,6 +482,7 @@ static BOOL IsAuthPolicyAvailable(TPM_HANDLE handle, // IN: handle of default: break; } + return result; } diff --git a/src/tpm2/SymmetricCommands.c b/src/tpm2/SymmetricCommands.c index dadf41ccc..ba702c03c 100644 --- a/src/tpm2/SymmetricCommands.c +++ b/src/tpm2/SymmetricCommands.c @@ -86,6 +86,7 @@ TPM2_EncryptDecrypt( TPMA_OBJECT attributes; // Input Validation symKey = HandleToObject(in->keyHandle); + pAssert_RC(symKey != NULL); mode = symKey->publicArea.parameters.symDetail.sym.mode.sym; attributes = symKey->publicArea.objectAttributes; // The input key should be a symmetric key @@ -258,6 +259,7 @@ TPM2_HMAC( // Input Validation // Get HMAC key object and public area pointers hmacObject = HandleToObject(in->handle); + pAssert_RC(hmacObject != NULL); publicArea = &hmacObject->publicArea; // Make sure that the key is an HMAC key if(publicArea->type != TPM_ALG_KEYEDHASH) @@ -318,6 +320,7 @@ TPM2_MAC( // Input Validation // Get MAC key object and public area pointers keyObject = HandleToObject(in->handle); + pAssert_RC(keyObject != NULL); publicArea = &keyObject->publicArea; // If the key is not able to do a MAC, indicate that the handle selects an // object that can't do a MAC From c3e7a1f0e0c965f49c92411b8285f18183f14eaf Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 23 Jul 2025 19:39:45 -0400 Subject: [PATCH 23/52] Sync: Rework some NVRAM functions to return TPM_RC and adjust pAsserts Signed-off-by: Stefan Berger --- src/tpm2/NvDynamic.c | 154 +++++++++++++++++++----------------------- src/tpm2/NvReserved.c | 71 ++----------------- 2 files changed, 73 insertions(+), 152 deletions(-) diff --git a/src/tpm2/NvDynamic.c b/src/tpm2/NvDynamic.c index cc48a7719..117c9ccc8 100644 --- a/src/tpm2/NvDynamic.c +++ b/src/tpm2/NvDynamic.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Dynamic space for user defined NV */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction @@ -277,7 +219,17 @@ NvWriteNvListEnd(NV_REF end) // Copy the maxCount value to the marker buffer MemoryCopy(&listEndMarker[sizeof(UINT32)], &maxCount, sizeof(UINT64)); - pAssert(end + sizeof(NV_LIST_TERMINATOR) <= s_evictNvEnd); + + // was a pAssert that (end + sizeof(NV_LIST_TERMINATOR) <= s_evictNvEnd); + if(end + sizeof(NV_LIST_TERMINATOR) > s_evictNvEnd) + { + // enter failure mode, but don't return yet. + FAIL_NORET(FATAL_ERROR_ASSERT); + // write NV_REF at last valid space. + // This will truncate the last entry, but + // better than writing past buffer or leaving buffer unterminated. + end = s_evictNvEnd - sizeof(NV_LIST_TERMINATOR); + } // Write it to memory NvWrite(end, sizeof(NV_LIST_TERMINATOR), &listEndMarker); @@ -364,7 +316,7 @@ static TPM_RC NvDelete(NV_REF entityRef // IN: reference to entity to be delete // If this is not the last entry, move everything up if(nextAddr < endRef) { - pAssert(nextAddr > entryRef); + pAssert_RC(nextAddr > entryRef); _plat__NvMemoryMove(nextAddr, entryRef, (endRef - nextAddr)); } // The end of the used space is now moved up by the amount of space we just @@ -397,7 +349,9 @@ static TPM_RC NvDelete(NV_REF entityRef // IN: reference to entity to be delete //*** NvRamNext() // This function is used to iterate trough the list of Ram Index values. *iter needs -// to be initialized by calling +// to be initialized to NV_RAM_REF_INIT before starting iteration. +// returns the handle and REF of the current item and advances iterator. +// return 0 when at the end of the list. static NV_RAM_REF NvRamNext(NV_RAM_REF* iter, // IN/OUT: the list iterator TPM_HANDLE* handle // OUT: the handle of the next item. ) @@ -418,19 +372,33 @@ static NV_RAM_REF NvRamNext(NV_RAM_REF* iter, // IN/OUT: the list iterator // that we are at the end of the list. The end of the list occurs when // we don't have space for a size and a handle if(currentAddr + sizeof(NV_RAM_HEADER) > RAM_ORDERLY_END) + { return NULL; + } + // read the header of the next entry memcpy(&header, currentAddr, sizeof(NV_RAM_HEADER)); // libtpms: do not use MemoryCopy to avoid gcc warning // if the size field is zero, then we have hit the end of the list if(header.size == 0) + { // leave the *iter pointing at the end of the list return NULL; + } + + if(*iter + header.size > RAM_ORDERLY_END) + { + // enter failure mode and stop iteration. + FAIL_IMMEDIATE(FATAL_ERROR_INTERNAL, 0); + } + // advance the header by the size of the entry - *iter = currentAddr + header.size; + *iter += header.size; - // pAssert(*iter <= RAM_ORDERLY_END); if(handle != NULL) + { *handle = header.handle; + } + return currentAddr; } @@ -502,7 +470,7 @@ void NvUpdateIndexOrderlyData(void) // This function should be called after the NV Index space has been updated // and the index removed. This insures that NV is available so that checking // for NV availability is not required during this function. -static void NvAddRAM(TPMS_NV_PUBLIC* index // IN: the index descriptor +static TPM_RC NvAddRAM(TPMS_NV_PUBLIC* index // IN: the index descriptor ) { NV_RAM_HEADER header; @@ -512,7 +480,7 @@ static void NvAddRAM(TPMS_NV_PUBLIC* index // IN: the index descriptor header.handle = index->nvIndex; MemoryCopy(&header.attributes, &index->attributes, sizeof(TPMA_NV)); - pAssert(ORDERLY_RAM_ADDRESS_OK(end, header.size)); + pAssert_RC(ORDERLY_RAM_ADDRESS_OK(end, header.size)); // Copy the header to the memory MemoryCopy(end, &header, sizeof(NV_RAM_HEADER)); @@ -529,7 +497,7 @@ static void NvAddRAM(TPMS_NV_PUBLIC* index // IN: the index descriptor // Write reserved RAM space to NV to reflect the newly added NV Index SET_NV_UPDATE(UT_ORDERLY); - return; + return TPM_RC_SUCCESS; } //*** NvDeleteRAM() @@ -542,7 +510,7 @@ static void NvAddRAM(TPMS_NV_PUBLIC* index // IN: the index descriptor // This function should be called after the NV Index space has been updated // and the index removed. This insures that NV is available so that checking // for NV availability is not required during this function. -static void NvDeleteRAM(TPMI_RH_NV_INDEX handle // IN: NV handle +static TPM_RC NvDeleteRAM(TPMI_RH_NV_INDEX handle // IN: NV handle ) { NV_RAM_REF nodeAddress; @@ -552,7 +520,7 @@ static void NvDeleteRAM(TPMI_RH_NV_INDEX handle // IN: NV handle // nodeAddress = NvRamGetIndex(handle); - pAssert(nodeAddress != 0); + pAssert_RC(nodeAddress != 0); // Get node size MemoryCopy(&size, nodeAddress, sizeof(size)); @@ -569,7 +537,7 @@ static void NvDeleteRAM(TPMI_RH_NV_INDEX handle // IN: NV handle // Write reserved RAM space to NV to reflect the newly delete NV Index SET_NV_UPDATE(UT_ORDERLY); - return; + return TPM_RC_SUCCESS; } //*** NvReadIndex() @@ -581,7 +549,10 @@ void NvReadNvIndexInfo(NV_REF ref, // IN: points to NV where index is loc NV_INDEX* nvIndex // OUT: place to receive index data ) { - pAssert(nvIndex != NULL); + // internal function that should have validated parameters. enter failure + // mode and return without reading. currently existing callers pass private + // buffers so are all guaranteed non-null + pAssert_VOID_OK(nvIndex != NULL); NvRead(nvIndex, ref, sizeof(NV_INDEX)); return; } @@ -923,12 +894,15 @@ void NvGetIndexData(NV_INDEX* nvIndex, // IN: the in RAM index descriptor ) { TPMA_NV nvAttributes; - // - pAssert(nvIndex != NULL); + + // early exit/fail to read is an appropriate response if input data is invalid. + // these should have been checked by NvReadAccessChecks before getting here, so + // failure mode is appropriate + pAssert_VOID_OK(nvIndex != NULL); nvAttributes = nvIndex->publicArea.attributes; - pAssert(IS_ATTRIBUTE(nvAttributes, TPMA_NV, WRITTEN)); + pAssert_VOID_OK(IS_ATTRIBUTE(nvAttributes, TPMA_NV, WRITTEN)); if(IS_ATTRIBUTE(nvAttributes, TPMA_NV, ORDERLY)) { @@ -942,8 +916,8 @@ void NvGetIndexData(NV_INDEX* nvIndex, // IN: the in RAM index descriptor else { // Validate that read falls within range of the index - pAssert(offset <= nvIndex->publicArea.dataSize - && size <= (nvIndex->publicArea.dataSize - offset)); + pAssert_VOID_OK(offset <= nvIndex->publicArea.dataSize + && size <= (nvIndex->publicArea.dataSize - offset)); NvRead(data, locator + sizeof(NV_INDEX) + offset, size); } return; @@ -1112,15 +1086,15 @@ NvWriteIndexData(NV_INDEX* nvIndex, // IN: the description of the index { TPM_RC result = TPM_RC_SUCCESS; // - pAssert(nvIndex != NULL); + pAssert_RC(nvIndex != NULL); // Make sure that this is dealing with the 'default' index. // Note: it is tempting to change the calling sequence so that the 'default' is // presumed. - pAssert(nvIndex->publicArea.nvIndex == s_cachedNvIndex.publicArea.nvIndex); + pAssert_RC(nvIndex->publicArea.nvIndex == s_cachedNvIndex.publicArea.nvIndex); // Validate that write falls within range of the index - pAssert(offset <= nvIndex->publicArea.dataSize - && size <= (nvIndex->publicArea.dataSize - offset)); + pAssert_RC(offset <= nvIndex->publicArea.dataSize + && size <= (nvIndex->publicArea.dataSize - offset)); // Update TPMA_NV_WRITTEN bit if necessary if(!IS_ATTRIBUTE(nvIndex->publicArea.attributes, TPMA_NV, WRITTEN)) @@ -1267,7 +1241,9 @@ NvDefineIndex(TPMS_NV_PUBLIC* publicArea, // IN: A template for an area to crea { // If the data of NV Index is RAM backed, add the data area in RAM as well if(IS_ATTRIBUTE(publicArea->attributes, TPMA_NV, ORDERLY)) - NvAddRAM(publicArea); + { + result = NvAddRAM(publicArea); + } } return result; } @@ -1348,7 +1324,13 @@ NvDeleteIndex(NV_INDEX* nvIndex, // IN: an in RAM index descriptor return result; // If the NV Index is RAM backed, delete the RAM data as well if(IS_ATTRIBUTE(nvIndex->publicArea.attributes, TPMA_NV, ORDERLY)) - NvDeleteRAM(nvIndex->publicArea.nvIndex); + { + result = NvDeleteRAM(nvIndex->publicArea.nvIndex); + } + + if(result != TPM_RC_SUCCESS) + return result; + NvIndexCacheInit(); } return TPM_RC_SUCCESS; @@ -1547,7 +1529,7 @@ NvCapGetPersistent(TPMI_DH_OBJECT handle, // IN: start handle NV_REF currentAddr; TPM_HANDLE entityHandle; // - pAssert(HandleGetType(handle) == TPM_HT_PERSISTENT); + VERIFY(HandleGetType(handle) == TPM_HT_PERSISTENT, FATAL_ERROR_INTERNAL, NO); // Initialize output handle list handleList->count = 0; @@ -1586,7 +1568,7 @@ BOOL NvCapGetOnePersistent(TPMI_DH_OBJECT handle) // IN: handle NV_REF currentAddr; TPM_HANDLE entityHandle; - pAssert(HandleGetType(handle) == TPM_HT_PERSISTENT); + pAssert_BOOL(HandleGetType(handle) == TPM_HT_PERSISTENT); while((currentAddr = NvNextEvict(&entityHandle, &iter)) != 0) { @@ -1616,7 +1598,7 @@ NvCapGetIndex(TPMI_DH_OBJECT handle, // IN: start handle NV_REF currentAddr; TPM_HANDLE nvHandle; // - pAssert(HandleGetType(handle) == TPM_HT_NV_INDEX); + VERIFY(HandleGetType(handle) == TPM_HT_NV_INDEX, FATAL_ERROR_INTERNAL, NO); // Initialize output handle list handleList->count = 0; @@ -1653,7 +1635,7 @@ BOOL NvCapGetOneIndex(TPMI_DH_OBJECT handle) // IN: handle NV_REF currentAddr; TPM_HANDLE nvHandle; - pAssert(HandleGetType(handle) == TPM_HT_NV_INDEX); + pAssert_BOOL(HandleGetType(handle) == TPM_HT_NV_INDEX); while((currentAddr = NvNextIndex(&nvHandle, &iter)) != 0) { diff --git a/src/tpm2/NvReserved.c b/src/tpm2/NvReserved.c index 5f1a8b956..2ad65bac6 100644 --- a/src/tpm2/NvReserved.c +++ b/src/tpm2/NvReserved.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* NV TPM persistent and state save data */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction @@ -228,13 +170,10 @@ BOOL NvWrite(UINT32 nvOffset, // IN: location in NV to receive data ) { // Input type should be valid - if(nvOffset + size <= NV_MEMORY_SIZE) - { - // Set the flag that a NV write happened - SET_NV_UPDATE(UT_NV); - return _plat__NvMemoryWrite(nvOffset, size, inBuffer); - } - return FALSE; + pAssert_BOOL(nvOffset + size <= NV_MEMORY_SIZE); + // Set the flag that a NV write happened + SET_NV_UPDATE(UT_NV); + return _plat__NvMemoryWrite(nvOffset, size, inBuffer); } #if 0 // libtpms added begin (for Coverity) From 54afc265f3598a83ad33cfb64dc1c3c8d92a83b2 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 6 Aug 2025 17:22:00 -0400 Subject: [PATCH 24/52] Sync: Have ComputeCommandHMAC return TPM_RC Signed-off-by: Stefan Berger --- src/tpm2/SessionProcess.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tpm2/SessionProcess.c b/src/tpm2/SessionProcess.c index 8c5375045..81e6e3ba0 100644 --- a/src/tpm2/SessionProcess.c +++ b/src/tpm2/SessionProcess.c @@ -835,7 +835,7 @@ static TPM_RC CheckPWAuthSession( // sessionAttributes A byte indicating the attributes associated with the // particular use of the session. */ -static TPM2B_DIGEST* ComputeCommandHMAC( +static TPM_RC ComputeCommandHMAC( COMMAND* command, // IN: primary control structure UINT32 sessionIndex, // IN: index of session to be processed TPM2B_DIGEST* hmac // OUT: authorization HMAC @@ -879,6 +879,7 @@ static TPM2B_DIGEST* ComputeCommandHMAC( // Have to have the nonce for the encrypt session. SESSION* encryptSession = SessionGet(s_sessionHandles[s_encryptSessionIndex]); + pAssert_RC(encryptSession != NULL); nonceEncrypt = &encryptSession->nonceTPM; } } @@ -910,7 +911,7 @@ static TPM2B_DIGEST* ComputeCommandHMAC( if(key.t.size == 0 && s_inputAuthValues[sessionIndex].t.size == 0) { hmac->t.size = 0; - return hmac; + return TPM_RC_SUCCESS; } // Start HMAC hmac->t.size = CryptHmacStart2B(&hmacState, session->authHashAlg, &key.b); @@ -932,7 +933,7 @@ static TPM2B_DIGEST* ComputeCommandHMAC( // Complete the HMAC computation CryptHmacEnd2B(&hmacState, &hmac->b); - return hmac; + return TPM_RC_SUCCESS; } //*** CheckSessionHMAC() @@ -958,7 +959,9 @@ static TPM_RC CheckSessionHMAC( TPM2B_DIGEST hmac; // authHMAC for comparing // // Compute authHMAC - ComputeCommandHMAC(command, sessionIndex, &hmac); + TPM_RC result = ComputeCommandHMAC(command, sessionIndex, &hmac); + if(result != TPM_RC_SUCCESS) + return result; // Compare the input HMAC with the authHMAC computed above. if(!MemoryEqual2B(&s_inputAuthValues[sessionIndex].b, &hmac.b)) From cfb121b1b1b3f02b8153e5cc7aa38a819d315d7d Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 6 Aug 2025 17:45:56 -0400 Subject: [PATCH 25/52] Sync: Have Object and PCR related functions return TPM_RC Split-out those TPM 2 command functions that need to be adapted due to the functions they call returning an error code. Split them out into their own files so they can be synchronized easier. Signed-off-by: Stefan Berger --- src/Makefile.am | 10 + src/tpm2/AttestationCommands.c | 45 ---- src/tpm2/Create.c | 137 +++++++++++ src/tpm2/CreateLoaded.c | 223 +++++++++++++++++ src/tpm2/CreatePrimary.c | 137 +++++++++++ src/tpm2/Duplicate.c | 132 ++++++++++ src/tpm2/DuplicationCommands.c | 195 --------------- src/tpm2/EACommands.c | 91 ------- src/tpm2/HierarchyCommands.c | 96 -------- src/tpm2/Import.c | 187 +++++++++++++++ src/tpm2/IntegrityCommands.c | 17 -- src/tpm2/MakeCredential.c | 61 +++++ src/tpm2/ObjectChangeAuth.c | 64 +++++ src/tpm2/ObjectCommands.c | 426 --------------------------------- src/tpm2/Object_spt.c | 116 +++------ src/tpm2/Object_spt_fp.h | 76 +----- src/tpm2/PCR.c | 22 +- src/tpm2/PCR_Read.c | 30 +++ src/tpm2/PCR_fp.h | 72 +----- src/tpm2/PolicyPCR.c | 98 ++++++++ src/tpm2/Quote.c | 75 ++++++ 21 files changed, 1212 insertions(+), 1098 deletions(-) create mode 100644 src/tpm2/Create.c create mode 100644 src/tpm2/CreateLoaded.c create mode 100644 src/tpm2/CreatePrimary.c create mode 100644 src/tpm2/Duplicate.c create mode 100644 src/tpm2/Import.c create mode 100644 src/tpm2/MakeCredential.c create mode 100644 src/tpm2/ObjectChangeAuth.c create mode 100644 src/tpm2/PCR_Read.c create mode 100644 src/tpm2/PolicyPCR.c create mode 100644 src/tpm2/Quote.c diff --git a/src/Makefile.am b/src/Makefile.am index f87ccb9b3..88537280a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -208,12 +208,16 @@ libtpms_tpm2_la_SOURCES = \ tpm2/CommandDispatcher.c \ tpm2/ContextCommands.c \ tpm2/Context_spt.c \ + tpm2/Create.c \ + tpm2/CreateLoaded.c \ + tpm2/CreatePrimary.c \ tpm2/CryptEccData.c \ tpm2/CryptSelfTest.c \ tpm2/CryptUtil.c \ tpm2/DA.c \ tpm2/DebugHelpers.c \ tpm2/DictionaryCommands.c \ + tpm2/Duplicate.c \ tpm2/DuplicationCommands.c \ tpm2/EACommands.c \ tpm2/EncryptDecrypt_spt.c \ @@ -227,11 +231,13 @@ libtpms_tpm2_la_SOURCES = \ tpm2/HashCommands.c \ tpm2/Hierarchy.c \ tpm2/HierarchyCommands.c \ + tpm2/Import.c \ tpm2/Init.c \ tpm2/IntegrityCommands.c \ tpm2/IoBuffers.c \ tpm2/Locality.c \ tpm2/LocalityPlat.c \ + tpm2/MakeCredential.c \ tpm2/ManagementCommands.c \ tpm2/Manufacture.c \ tpm2/Marshal.c \ @@ -243,13 +249,16 @@ libtpms_tpm2_la_SOURCES = \ tpm2/NvReserved.c \ tpm2/NV_spt.c \ tpm2/Object.c \ + tpm2/ObjectChangeAuth.c \ tpm2/ObjectCommands.c \ tpm2/Object_spt.c \ tpm2/PCR.c \ + tpm2/PCR_Read.c \ tpm2/PlatformACT.c \ tpm2/PlatformData.c \ tpm2/PlatformPcr.c \ tpm2/Policy_spt.c \ + tpm2/PolicyPCR.c \ tpm2/PolicyTransportSPDM.c \ tpm2/Power.c \ tpm2/PowerPlat.c \ @@ -257,6 +266,7 @@ libtpms_tpm2_la_SOURCES = \ tpm2/PPPlat.c \ tpm2/PrimeData.c \ tpm2/PropertyCap.c \ + tpm2/Quote.c \ tpm2/RandomCommands.c \ tpm2/ReadOnlyControl.c \ tpm2/Response.c \ diff --git a/src/tpm2/AttestationCommands.c b/src/tpm2/AttestationCommands.c index 1aa468fdf..a78cfedac 100644 --- a/src/tpm2/AttestationCommands.c +++ b/src/tpm2/AttestationCommands.c @@ -1,4 +1,3 @@ - /********************************************************************************/ /* */ /* Attestation Commands */ @@ -154,50 +153,6 @@ TPM2_CertifyCreation( #endif // CC_CertifyCreation #include "Tpm.h" #include "Attest_spt_fp.h" -#include "Quote_fp.h" -#if CC_Quote // Conditional expansion of this file -TPM_RC -TPM2_Quote( - Quote_In *in, // IN: input parameter list - Quote_Out *out // OUT: output parameter list - ) -{ - TPMI_ALG_HASH hashAlg; - TPMS_ATTEST quoted; - OBJECT *signObject = HandleToObject(in->signHandle); - // Input Validation - if(!IsSigningObject(signObject)) - return TPM_RCS_KEY + RC_Quote_signHandle; - if(!CryptSelectSignScheme(signObject, &in->inScheme)) - return TPM_RCS_SCHEME + RC_Quote_inScheme; - // Command Output - // Filling in attest information - // Common fields - // FillInAttestInfo may return TPM_RC_SCHEME or TPM_RC_KEY - FillInAttestInfo(in->signHandle, &in->inScheme, &in->qualifyingData, "ed); - // Quote specific fields - // Attestation type - quoted.type = TPM_ST_ATTEST_QUOTE; - // Get hash algorithm in sign scheme. This hash algorithm is used to - // compute PCR digest. If there is no algorithm, then the PCR cannot - // be digested and this command returns TPM_RC_SCHEME - hashAlg = in->inScheme.details.any.hashAlg; - if(hashAlg == TPM_ALG_NULL) - return TPM_RCS_SCHEME + RC_Quote_inScheme; - // Compute PCR digest - PCRComputeCurrentDigest(hashAlg, &in->PCRselect, - "ed.attested.quote.pcrDigest); - // Copy PCR select. "PCRselect" is modified in PCRComputeCurrentDigest - // function - quoted.attested.quote.pcrSelect = in->PCRselect; - // Sign attestation structure. A NULL signature will be returned if - // signObject is NULL. - return SignAttestInfo(signObject, &in->inScheme, "ed, &in->qualifyingData, - &out->quoted, &out->signature); -} -#endif // CC_Quote -#include "Tpm.h" -#include "Attest_spt_fp.h" #include "GetSessionAuditDigest_fp.h" #if CC_GetSessionAuditDigest // Conditional expansion of this file TPM_RC diff --git a/src/tpm2/Create.c b/src/tpm2/Create.c new file mode 100644 index 000000000..ef31cfff1 --- /dev/null +++ b/src/tpm2/Create.c @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "Object_spt_fp.h" +#include "Create_fp.h" + +#if CC_Create // Conditional expansion of this file + +/*(See part 3 specification) +// Create a regular object +*/ +// Return Type: TPM_RC +// TPM_RC_ATTRIBUTES 'sensitiveDataOrigin' is CLEAR when 'sensitive.data' +// is an Empty Buffer, or is SET when 'sensitive.data' is +// not empty; +// 'fixedTPM', 'fixedParent', or 'encryptedDuplication' +// attributes are inconsistent between themselves or with +// those of the parent object; +// inconsistent 'restricted', 'decrypt' and 'sign' +// attributes; +// attempt to inject sensitive data for an asymmetric +// key; +// TPM_RC_HASH non-duplicable storage key and its parent have +// different name algorithm +// TPM_RC_KDF incorrect KDF specified for decrypting keyed hash +// object +// TPM_RC_KEY invalid key size values in an asymmetric key public +// area or a provided symmetric key has a value that is +// not allowed +// TPM_RC_KEY_SIZE key size in public area for symmetric key differs from +// the size in the sensitive creation area; may also be +// returned if the TPM does not allow the key size to be +// used for a Storage Key +// TPM_RC_OBJECT_MEMORY a free slot is not available as scratch memory for +// object creation +// TPM_RC_RANGE the exponent value of an RSA key is not supported. +// TPM_RC_SCHEME inconsistent attributes 'decrypt', 'sign', or +// 'restricted' and key's scheme ID; or hash algorithm is +// inconsistent with the scheme ID for keyed hash object +// TPM_RC_SIZE size of public authPolicy or sensitive authValue does +// not match digest size of the name algorithm +// sensitive data size for the keyed hash object is +// larger than is allowed for the scheme +// TPM_RC_SYMMETRIC a storage key with no symmetric algorithm specified; +// or non-storage key with symmetric algorithm different +// from TPM_ALG_NULL +// TPM_RC_TYPE unknown object type; +// 'parentHandle' does not reference a restricted +// decryption key in the storage hierarchy with both +// public and sensitive portion loaded +// TPM_RC_VALUE exponent is not prime or could not find a prime using +// the provided parameters for an RSA key; +// unsupported name algorithm for an ECC key +// TPM_RC_OBJECT_MEMORY there is no free slot for the object +TPM_RC +TPM2_Create(Create_In* in, // IN: input parameter list + Create_Out* out // OUT: output parameter list +) +{ + TPM_RC result = TPM_RC_SUCCESS; + OBJECT* parentObject; + OBJECT* newObject; + TPMT_PUBLIC* publicArea; + + // Input Validation + parentObject = HandleToObject(in->parentHandle); + pAssert_RC(parentObject != NULL); + + // Does parent have the proper attributes? + if(!ObjectIsParent(parentObject)) + return TPM_RCS_TYPE + RC_Create_parentHandle; + + // Get a slot for the creation + newObject = FindEmptyObjectSlot(NULL); + if(newObject == NULL) + return TPM_RC_OBJECT_MEMORY; + // If the TPM2B_PUBLIC was passed as a structure, marshal it into is canonical + // form for processing + + // to save typing. + publicArea = &newObject->publicArea; + + // Copy the input structure to the allocated structure + *publicArea = in->inPublic.publicArea; + + // Check attributes in input public area. CreateChecks() checks the things that + // are unique to creation and then validates the attributes and values that are + // common to create and load. + result = CreateChecks(parentObject, + /* primaryHierarchy = */ 0, + publicArea, + in->inSensitive.sensitive.data.t.size); + if(result != TPM_RC_SUCCESS) + return RcSafeAddToResult(result, RC_Create_inPublic); + // Clean up the authValue if necessary + if(!AdjustAuthSize(&in->inSensitive.sensitive.userAuth, publicArea->nameAlg)) + return TPM_RCS_SIZE + RC_Create_inSensitive; + + // Command Output + // Create the object using the default TPM random-number generator + result = CryptCreateObject(newObject, &in->inSensitive.sensitive, NULL); + if(result != TPM_RC_SUCCESS) + return result; + // Fill in creation data + result = FillInCreationData(in->parentHandle, + publicArea->nameAlg, + &in->creationPCR, + &in->outsideInfo, + &out->creationData, + &out->creationHash); + if(result != TPM_RC_SUCCESS) + return result; + + // Compute creation ticket + result = TicketComputeCreation(EntityGetHierarchy(in->parentHandle), + &newObject->name, + &out->creationHash, + &out->creationTicket); + if(result != TPM_RC_SUCCESS) + return result; + + // Prepare output private data from sensitive + result = SensitiveToPrivate(&newObject->sensitive, + &newObject->name, + parentObject, + publicArea->nameAlg, + &out->outPrivate); + + newObject->hierarchy = parentObject->hierarchy; + + // Finish by copying the remaining return values + out->outPublic.publicArea = newObject->publicArea; + + return result; +} + +#endif // CC_Create diff --git a/src/tpm2/CreateLoaded.c b/src/tpm2/CreateLoaded.c new file mode 100644 index 000000000..c2ab154df --- /dev/null +++ b/src/tpm2/CreateLoaded.c @@ -0,0 +1,223 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "CreateLoaded_fp.h" + +#if CC_CreateLoaded // Conditional expansion of this file + +/*(See part 3 of specification) + * Create and load any type of key, including a temporary key. + * The input template is a marshaled public area rather than an unmarshaled one as + * used in Create and CreatePrimary. This is so that the label and context that + * could be in the template can be processed without changing the formats for the + * calls to Create and CreatePrimary. +*/ +// Return Type: TPM_RC +// TPM_RC_ATTRIBUTES 'sensitiveDataOrigin' is CLEAR when 'sensitive.data' +// is an Empty Buffer; +// 'fixedTPM', 'fixedParent', or 'encryptedDuplication' +// attributes are inconsistent between themselves or with +// those of the parent object; +// inconsistent 'restricted', 'decrypt' and 'sign' +// attributes; +// attempt to inject sensitive data for an asymmetric +// key; +// attempt to create a symmetric cipher key that is not +// a decryption key +// TPM_RC_FW_LIMITED The requested hierarchy is FW-limited, but the TPM +// does not support FW-limited objects or the TPM failed +// to derive the Firmware Secret. +// TPM_RC_SVN_LIMITED The requested hierarchy is SVN-limited, but the TPM +// does not support SVN-limited objects or the TPM failed +// to derive the Firmware SVN Secret for the requested +// SVN. +// TPM_RC_KDF incorrect KDF specified for decrypting keyed hash +// object +// TPM_RC_KEY the value of a provided symmetric key is not allowed +// TPM_RC_OBJECT_MEMORY there is no free slot for the object +// TPM_RC_SCHEME inconsistent attributes 'decrypt', 'sign', +// 'restricted' and key's scheme ID; or hash algorithm is +// inconsistent with the scheme ID for keyed hash object +// TPM_RC_SIZE size of public authorization policy or sensitive +// authorization value does not match digest size of the +// name algorithm sensitive data size for the keyed hash +// object is larger than is allowed for the scheme +// TPM_RC_SYMMETRIC a storage key with no symmetric algorithm specified; +// or non-storage key with symmetric algorithm different +// from TPM_ALG_NULL +// TPM_RC_TYPE cannot create the object of the indicated type +// (usually only occurs if trying to derive an RSA key). +TPM_RC +TPM2_CreateLoaded(CreateLoaded_In* in, // IN: input parameter list + CreateLoaded_Out* out // OUT: output parameter list +) +{ + TPM_RC result = TPM_RC_SUCCESS; + OBJECT* parent = HandleToObject(in->parentHandle); + OBJECT* newObject; + BOOL derivation; + TPMT_PUBLIC* publicArea; + RAND_STATE randState; + RAND_STATE* rand = &randState; + TPMS_DERIVE labelContext; + SEED_COMPAT_LEVEL seedCompatLevel = RuntimeProfileGetSeedCompatLevel(); // libtpms added + + // Input Validation + + // How the public area is unmarshaled is determined by the parent, so + // see if parent is a derivation parent + derivation = (parent != NULL && parent->attributes.derivation); + + // If the parent is an object, then make sure that it is either a parent or + // derivation parent + if(parent != NULL && !parent->attributes.isParent && !derivation) + return TPM_RCS_TYPE + RC_CreateLoaded_parentHandle; + + // Get a spot in which to create the newObject + newObject = FindEmptyObjectSlot(&out->objectHandle); + if(newObject == NULL) + return TPM_RC_OBJECT_MEMORY; + + // Do this to save typing + publicArea = &newObject->publicArea; + + // Unmarshal the template into the object space. TPM2_Create() and + // TPM2_CreatePrimary() have the publicArea unmarshaled by CommandDispatcher. + // This command is different because of an unfortunate property of the + // unique field of an ECC key. It is a structure rather than a single TPM2B. If + // if had been a TPM2B, then the label and context could be within a TPM2B and + // unmarshaled like other public areas. Since it is not, this command needs its + // on template that is a TPM2B that is unmarshaled as a BYTE array with a + // its own unmarshal function. + result = UnmarshalToPublic(publicArea, &in->inPublic, derivation, &labelContext); + if(result != TPM_RC_SUCCESS) + return result + RC_CreateLoaded_inPublic; + + // Validate that the authorization size is appropriate + if(!AdjustAuthSize(&in->inSensitive.sensitive.userAuth, publicArea->nameAlg)) + return TPM_RCS_SIZE + RC_CreateLoaded_inSensitive; + + // Command output + if(derivation) + { + TPMT_KEYEDHASH_SCHEME* scheme; + scheme = &parent->publicArea.parameters.keyedHashDetail.scheme; + + // SP800-108 is the only KDF supported by this implementation and there is + // no default hash algorithm. + pAssert_RC(scheme->details.xor.hashAlg != TPM_ALG_NULL + && scheme->details.xor.kdf == TPM_ALG_KDF1_SP800_108); + // Don't derive RSA keys + if(publicArea->type == TPM_ALG_RSA) + return TPM_RCS_TYPE + RC_CreateLoaded_inPublic; + if(publicArea->type == TPM_ALG_ECC && // libtpms added begin + RuntimeProfileRequiresAttributeFlags(&g_RuntimeProfile, + RUNTIME_ATTRIBUTE_NO_ECC_KEY_DERIVATION)) + return TPM_RCS_TYPE + RC_CreateLoaded_inPublic; // libtpms added end + // sensitiveDataOrigin has to be CLEAR in a derived object. Since this + // is specific to a derived object, it is checked here. + if(IS_ATTRIBUTE( + publicArea->objectAttributes, TPMA_OBJECT, sensitiveDataOrigin)) + return TPM_RCS_ATTRIBUTES; + // Check the rest of the attributes + result = PublicAttributesValidation(parent, 0, publicArea); + if(result != TPM_RC_SUCCESS) + return RcSafeAddToResult(result, RC_CreateLoaded_inPublic); + // Process the template and sensitive areas to get the actual 'label' and + // 'context' values to be used for this derivation. + result = SetLabelAndContext(&labelContext, &in->inSensitive.sensitive.data); + if(result != TPM_RC_SUCCESS) + return result; + // Set up the KDF for object generation + DRBG_InstantiateSeededKdf((KDF_STATE*)rand, + scheme->details.xor.hashAlg, + scheme->details.xor.kdf, + &parent->sensitive.sensitive.bits.b, + &labelContext.label.b, + &labelContext.context.b, + TPM_MAX_DERIVATION_BITS); + // Clear the sensitive size so that the creation functions will not try + // to use this value. + in->inSensitive.sensitive.data.t.size = 0; + seedCompatLevel = parent->seedCompatLevel; // libtpms added + } + else + { + // Check attributes in input public area. CreateChecks() checks the things + // that are unique to creation and then validates the attributes and values + // that are common to create and load. + result = CreateChecks(parent, + (parent == NULL) ? in->parentHandle : 0, + publicArea, + in->inSensitive.sensitive.data.t.size); + + if(result != TPM_RC_SUCCESS) + return RcSafeAddToResult(result, RC_CreateLoaded_inPublic); + // Creating a primary object + if(parent == NULL) + { + TPM2B_NAME name; + TPM2B_SEED primary_seed; + + newObject->attributes.primary = SET; + if(HierarchyNormalizeHandle(in->parentHandle) == TPM_RH_ENDORSEMENT) + newObject->attributes.epsHierarchy = SET; + seedCompatLevel = HierarchyGetPrimarySeedCompatLevel(in->parentHandle); // libtpms added + // If so, use the primary seed and the digest of the template + // to seed the DRBG + + result = HierarchyGetPrimarySeed(in->parentHandle, &primary_seed); + if(result != TPM_RC_SUCCESS) + return result; + + // If so, use the primary seed and the digest of the template + // to seed the DRBG + result = DRBG_InstantiateSeeded( + (DRBG_STATE*)rand, + &primary_seed.b, + PRIMARY_OBJECT_CREATION, + (TPM2B*)PublicMarshalAndComputeName(publicArea, &name), + &in->inSensitive.sensitive.data.b, + seedCompatLevel); // libtpms added + MemorySet(primary_seed.b.buffer, 0, primary_seed.b.size); + + if(result != TPM_RC_SUCCESS) + return result; + } + else + { + // This is an ordinary object so use the normal random number generator + rand = NULL; + } + } + // Internal data update + // Create the object + result = CryptCreateObject(newObject, &in->inSensitive.sensitive, rand); + DRBG_Uninstantiate((DRBG_STATE*)rand); + if(result != TPM_RC_SUCCESS) + return result; + // if this is not a Primary key and not a derived key, then return the sensitive + // area + if(parent != NULL && !derivation) + { + // Prepare output private data from sensitive + result = SensitiveToPrivate(&newObject->sensitive, + &newObject->name, + parent, + newObject->publicArea.nameAlg, + &out->outPrivate); + } + else + { + out->outPrivate.t.size = 0; + } + // Set the remaining return values + out->outPublic.publicArea = newObject->publicArea; + out->name = newObject->name; + // Set the remaining attributes for a loaded object + ObjectSetLoadedAttributes(newObject, in->parentHandle, + seedCompatLevel); // libtpms added + return result; +} + +#endif // CC_CreateLoaded diff --git a/src/tpm2/CreatePrimary.c b/src/tpm2/CreatePrimary.c new file mode 100644 index 000000000..1e5fa2ce2 --- /dev/null +++ b/src/tpm2/CreatePrimary.c @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "CreatePrimary_fp.h" + +#if CC_CreatePrimary // Conditional expansion of this file + +/*(See part 3 specification) +// Creates a primary or temporary object from a primary seed. +*/ +// Return Type: TPM_RC +// TPM_RC_ATTRIBUTES sensitiveDataOrigin is CLEAR when sensitive.data is an +// Empty Buffer; 'fixedTPM', 'fixedParent', or +// 'encryptedDuplication' attributes are inconsistent +// between themselves or with those of the parent object; +// inconsistent 'restricted', 'decrypt', 'sign', +// 'firmwareLimited', or 'svnLimited' attributes; +// attempt to inject sensitive data for an asymmetric +// key; +// TPM_RC_FW_LIMITED The requested hierarchy is FW-limited, but the TPM +// does not support FW-limited objects or the TPM failed +// to derive the Firmware Secret. +// TPM_RC_SVN_LIMITED The requested hierarchy is SVN-limited, but the TPM +// does not support SVN-limited objects or the TPM failed +// to derive the Firmware SVN Secret for the requested +// SVN. +// TPM_RC_KDF incorrect KDF specified for decrypting keyed hash +// object +// TPM_RC_KEY a provided symmetric key value is not allowed +// TPM_RC_OBJECT_MEMORY there is no free slot for the object +// TPM_RC_SCHEME inconsistent attributes 'decrypt', 'sign', +// 'restricted' and key's scheme ID; or hash algorithm is +// inconsistent with the scheme ID for keyed hash object +// TPM_RC_SIZE size of public authorization policy or sensitive +// authorization value does not match digest size of the +// name algorithm; or sensitive data size for the keyed +// hash object is larger than is allowed for the scheme +// TPM_RC_SYMMETRIC a storage key with no symmetric algorithm specified; +// or non-storage key with symmetric algorithm different +// from TPM_ALG_NULL +// TPM_RC_TYPE unknown object type +TPM_RC +TPM2_CreatePrimary(CreatePrimary_In* in, // IN: input parameter list + CreatePrimary_Out* out // OUT: output parameter list +) +{ + TPM_RC result = TPM_RC_SUCCESS; + TPMT_PUBLIC* publicArea; + DRBG_STATE rand; + OBJECT* newObject; + TPM2B_NAME name; + TPM2B_SEED primary_seed; + + // Input Validation + // Will need a place to put the result + newObject = FindEmptyObjectSlot(&out->objectHandle); + if(newObject == NULL) + return TPM_RC_OBJECT_MEMORY; + // Get the address of the public area in the new object + // (this is just to save typing) + publicArea = &newObject->publicArea; + + *publicArea = in->inPublic.publicArea; + + // Check attributes in input public area. CreateChecks() checks the things that + // are unique to creation and then validates the attributes and values that are + // common to create and load. + result = CreateChecks( + NULL, in->primaryHandle, publicArea, in->inSensitive.sensitive.data.t.size); + if(result != TPM_RC_SUCCESS) + return RcSafeAddToResult(result, RC_CreatePrimary_inPublic); + // Validate the sensitive area values + if(!AdjustAuthSize(&in->inSensitive.sensitive.userAuth, publicArea->nameAlg)) + return TPM_RCS_SIZE + RC_CreatePrimary_inSensitive; + // Command output + // Compute the name using out->name as a scratch area (this is not the value + // that ultimately will be returned, then instantiate the state that will be + // used as a random number generator during the object creation. + // The caller does not know the seed values so the actual name does not have + // to be over the input, it can be over the unmarshaled structure. + + result = HierarchyGetPrimarySeed(in->primaryHandle, &primary_seed); + if(result != TPM_RC_SUCCESS) + return result; + + result = + DRBG_InstantiateSeeded(&rand, + &primary_seed.b, + PRIMARY_OBJECT_CREATION, + (TPM2B*)PublicMarshalAndComputeName(publicArea, &name), + &in->inSensitive.sensitive.data.b, + HierarchyGetPrimarySeedCompatLevel(in->primaryHandle)); // libtpms added + MemorySet(primary_seed.b.buffer, 0, primary_seed.b.size); + + if(result == TPM_RC_SUCCESS) + { + newObject->attributes.primary = SET; + if(HierarchyNormalizeHandle(in->primaryHandle) == TPM_RH_ENDORSEMENT) + newObject->attributes.epsHierarchy = SET; + + // Create the primary object. + result = CryptCreateObject( + newObject, &in->inSensitive.sensitive, (RAND_STATE*)&rand); + DRBG_Uninstantiate(&rand); + } + if(result != TPM_RC_SUCCESS) + return result; + + // Set the publicArea and name from the computed values + out->outPublic.publicArea = newObject->publicArea; + out->name = newObject->name; + + // Fill in creation data + result = FillInCreationData(in->primaryHandle, + publicArea->nameAlg, + &in->creationPCR, + &in->outsideInfo, + &out->creationData, + &out->creationHash); + if(result != TPM_RC_SUCCESS) + return result; + + // Compute creation ticket + result = TicketComputeCreation(EntityGetHierarchy(in->primaryHandle), + &out->name, + &out->creationHash, + &out->creationTicket); + if(result != TPM_RC_SUCCESS) + return result; + + // Set the remaining attributes for a loaded object + ObjectSetLoadedAttributes(newObject, in->primaryHandle, + HierarchyGetPrimarySeedCompatLevel(in->primaryHandle)); // libtpms added + return result; +} + +#endif // CC_CreatePrimary diff --git a/src/tpm2/Duplicate.c b/src/tpm2/Duplicate.c new file mode 100644 index 000000000..df7f39efa --- /dev/null +++ b/src/tpm2/Duplicate.c @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "Duplicate_fp.h" + +#if CC_Duplicate // Conditional expansion of this file + +# include "Object_spt_fp.h" + +/*(See part 3 specification) +// Duplicate a loaded object +*/ +// Return Type: TPM_RC +// TPM_RC_ATTRIBUTES key to duplicate has 'fixedParent' SET +// TPM_RC_HASH for an RSA key, the nameAlg digest size for the +// newParent is not compatible with the key size +// TPM_RC_HIERARCHY 'encryptedDuplication' is SET and 'newParentHandle' +// specifies Null Hierarchy +// TPM_RC_KEY 'newParentHandle' references invalid ECC key (public +// point not on the curve) +// TPM_RC_SIZE input encryption key size does not match the +// size specified in symmetric algorithm +// TPM_RC_SYMMETRIC 'encryptedDuplication' is SET but no symmetric +// algorithm is provided +// TPM_RC_TYPE 'newParentHandle' is neither a storage key nor +// TPM_RH_NULL; or the object has a NULL nameAlg +// TPM_RC_VALUE for an RSA newParent, the sizes of the digest and +// the encryption key are too large to be OAEP encoded +TPM_RC +TPM2_Duplicate(Duplicate_In* in, // IN: input parameter list + Duplicate_Out* out // OUT: output parameter list +) +{ + TPM_RC result = TPM_RC_SUCCESS; + TPMT_SENSITIVE sensitive; + + UINT16 innerKeySize = 0; // encrypt key size for inner wrap + + OBJECT* object; + OBJECT* newParent; + TPM2B_DATA data; + + // Input Validation + + // Get duplicate object pointer + object = HandleToObject(in->objectHandle); + pAssert_RC(object != NULL); + + // Get new parent + newParent = HandleToObject(in->newParentHandle); + + // duplicate key must have fixParent bit CLEAR. + if(IS_ATTRIBUTE(object->publicArea.objectAttributes, TPMA_OBJECT, fixedParent)) + return TPM_RCS_ATTRIBUTES + RC_Duplicate_objectHandle; + + // Do not duplicate object with NULL nameAlg + if(object->publicArea.nameAlg == TPM_ALG_NULL) + return TPM_RCS_TYPE + RC_Duplicate_objectHandle; + + // new parent key must be a storage object or TPM_RH_NULL + if(in->newParentHandle != TPM_RH_NULL && !ObjectIsStorage(in->newParentHandle)) + return TPM_RCS_TYPE + RC_Duplicate_newParentHandle; + + // If the duplicated object has encryptedDuplication SET, then there must be + // an inner wrapper and the new parent may not be TPM_RH_NULL + if(IS_ATTRIBUTE( + object->publicArea.objectAttributes, TPMA_OBJECT, encryptedDuplication)) + { + if(in->symmetricAlg.algorithm == TPM_ALG_NULL) + return TPM_RCS_SYMMETRIC + RC_Duplicate_symmetricAlg; + if(in->newParentHandle == TPM_RH_NULL) + return TPM_RCS_HIERARCHY + RC_Duplicate_newParentHandle; + } + + if(in->symmetricAlg.algorithm == TPM_ALG_NULL) + { + // if algorithm is TPM_ALG_NULL, input key size must be 0 + if(in->encryptionKeyIn.t.size != 0) + return TPM_RCS_SIZE + RC_Duplicate_encryptionKeyIn; + } + else + { + // Get inner wrap key size + innerKeySize = in->symmetricAlg.keyBits.sym; + + // If provided the input symmetric key must match the size of the algorithm + if(in->encryptionKeyIn.t.size != 0 + && in->encryptionKeyIn.t.size != (innerKeySize + 7) / 8) + return TPM_RCS_SIZE + RC_Duplicate_encryptionKeyIn; + } + + // Command Output + + if(in->newParentHandle != TPM_RH_NULL) + { + // Make encrypt key and its associated secret structure. A TPM_RC_KEY + // error may be returned at this point + out->outSymSeed.t.size = sizeof(out->outSymSeed.t.secret); + result = + CryptSecretEncrypt(newParent, DUPLICATE_STRING, &data, &out->outSymSeed); + if(result != TPM_RC_SUCCESS) + return result; + } + else + { + // Do not apply outer wrapper + data.t.size = 0; + out->outSymSeed.t.size = 0; + } + + // Copy sensitive area + sensitive = object->sensitive; + + // Prepare output private data from sensitive. + // Note: If there is no encryption key, one will be provided by + // SensitiveToDuplicate(). This is why the assignment of encryptionKeyIn to + // encryptionKeyOut will work properly and is not conditional. + result = SensitiveToDuplicate(&sensitive, + &object->name.b, + newParent, + object->publicArea.nameAlg, + &data.b, + &in->symmetricAlg, + &in->encryptionKeyIn, + &out->duplicate); + + out->encryptionKeyOut = in->encryptionKeyIn; + + return result; +} + +#endif // CC_Duplicate diff --git a/src/tpm2/DuplicationCommands.c b/src/tpm2/DuplicationCommands.c index 8b8a65739..e45ec96f8 100644 --- a/src/tpm2/DuplicationCommands.c +++ b/src/tpm2/DuplicationCommands.c @@ -59,95 +59,6 @@ /* */ /********************************************************************************/ -#include "Tpm.h" -#include "Duplicate_fp.h" -#if CC_Duplicate // Conditional expansion of this file -#include "Object_spt_fp.h" -TPM_RC -TPM2_Duplicate( - Duplicate_In *in, // IN: input parameter list - Duplicate_Out *out // OUT: output parameter list - ) -{ - TPM_RC result = TPM_RC_SUCCESS; - TPMT_SENSITIVE sensitive; - UINT16 innerKeySize = 0; // encrypt key size for inner wrap - OBJECT *object; - OBJECT *newParent; - TPM2B_DATA data; - // Input Validation - // Get duplicate object pointer - object = HandleToObject(in->objectHandle); - pAssert_RC(object != NULL); - - // Get new parent - newParent = HandleToObject(in->newParentHandle); - // duplicate key must have fixParent bit CLEAR. - if(IS_ATTRIBUTE(object->publicArea.objectAttributes, TPMA_OBJECT, fixedParent)) - return TPM_RCS_ATTRIBUTES + RC_Duplicate_objectHandle; - // Do not duplicate object with NULL nameAlg - if(object->publicArea.nameAlg == TPM_ALG_NULL) - return TPM_RCS_TYPE + RC_Duplicate_objectHandle; - // new parent key must be a storage object or TPM_RH_NULL - if(in->newParentHandle != TPM_RH_NULL - && !ObjectIsStorage(in->newParentHandle)) - return TPM_RCS_TYPE + RC_Duplicate_newParentHandle; - // If the duplicated object has encryptedDuplication SET, then there must be - // an inner wrapper and the new parent may not be TPM_RH_NULL - if(IS_ATTRIBUTE(object->publicArea.objectAttributes, TPMA_OBJECT, - encryptedDuplication)) - { - if(in->symmetricAlg.algorithm == TPM_ALG_NULL) - return TPM_RCS_SYMMETRIC + RC_Duplicate_symmetricAlg; - if(in->newParentHandle == TPM_RH_NULL) - return TPM_RCS_HIERARCHY + RC_Duplicate_newParentHandle; - } - if(in->symmetricAlg.algorithm == TPM_ALG_NULL) - { - // if algorithm is TPM_ALG_NULL, input key size must be 0 - if(in->encryptionKeyIn.t.size != 0) - return TPM_RCS_SIZE + RC_Duplicate_encryptionKeyIn; - } - else - { - // Get inner wrap key size - innerKeySize = in->symmetricAlg.keyBits.sym; - // If provided the input symmetric key must match the size of the algorithm - if(in->encryptionKeyIn.t.size != 0 - && in->encryptionKeyIn.t.size != (innerKeySize + 7) / 8) - return TPM_RCS_SIZE + RC_Duplicate_encryptionKeyIn; - } - // Command Output - if(in->newParentHandle != TPM_RH_NULL) - { - // Make encrypt key and its associated secret structure. A TPM_RC_KEY - // error may be returned at this point - out->outSymSeed.t.size = sizeof(out->outSymSeed.t.secret); - result = CryptSecretEncrypt(newParent, DUPLICATE_STRING, &data, - &out->outSymSeed); - if(result != TPM_RC_SUCCESS) - return result; - } - else - { - // Do not apply outer wrapper - data.t.size = 0; - out->outSymSeed.t.size = 0; - } - // Copy sensitive area - sensitive = object->sensitive; - // Prepare output private data from sensitive. - // Note: If there is no encryption key, one will be provided by - // SensitiveToDuplicate(). This is why the assignment of encryptionKeyIn to - // encryptionKeyOut will work properly and is not conditional. - SensitiveToDuplicate(&sensitive, &object->name.b, newParent, - object->publicArea.nameAlg, &data.b, - &in->symmetricAlg, &in->encryptionKeyIn, - &out->duplicate); - out->encryptionKeyOut = in->encryptionKeyIn; - return TPM_RC_SUCCESS; -} -#endif // CC_Duplicate #include "Tpm.h" #include "Rewrap_fp.h" #if CC_Rewrap // Conditional expansion of this file @@ -254,109 +165,3 @@ TPM2_Rewrap( return TPM_RC_SUCCESS; } #endif // CC_Rewrap -#include "Tpm.h" -#include "Import_fp.h" -#if CC_Import // Conditional expansion of this file -#include "Object_spt_fp.h" -TPM_RC -TPM2_Import( - Import_In *in, // IN: input parameter list - Import_Out *out // OUT: output parameter list - ) -{ - TPM_RC result = TPM_RC_SUCCESS; - OBJECT *parentObject; - TPM2B_DATA data; // symmetric key - TPMT_SENSITIVE sensitive; - TPM2B_NAME name; - TPMA_OBJECT attributes; - UINT16 innerKeySize = 0; // encrypt key size for inner - // wrapper - // Input Validation - // to save typing - attributes = in->objectPublic.publicArea.objectAttributes; - // FixedTPM and fixedParent must be CLEAR - if(IS_ATTRIBUTE(attributes, TPMA_OBJECT, fixedTPM) - || IS_ATTRIBUTE(attributes, TPMA_OBJECT, fixedParent)) - return TPM_RCS_ATTRIBUTES + RC_Import_objectPublic; - // Get parent pointer - parentObject = HandleToObject(in->parentHandle); - pAssert_RC(parentObject != NULL); - - if(!ObjectIsParent(parentObject)) - return TPM_RCS_TYPE + RC_Import_parentHandle; - if(in->symmetricAlg.algorithm != TPM_ALG_NULL) - { - // Get inner wrap key size - innerKeySize = in->symmetricAlg.keyBits.sym; - // Input symmetric key must match the size of algorithm. - if(in->encryptionKey.t.size != (innerKeySize + 7) / 8) - return TPM_RCS_SIZE + RC_Import_encryptionKey; - } - else - { - // If input symmetric algorithm is NULL, input symmetric key size must - // be 0 as well - if(in->encryptionKey.t.size != 0) - return TPM_RCS_SIZE + RC_Import_encryptionKey; - // If encryptedDuplication is SET, then the object must have an inner - // wrapper - if(IS_ATTRIBUTE(attributes, TPMA_OBJECT, encryptedDuplication)) - return TPM_RCS_ATTRIBUTES + RC_Import_encryptionKey; - } - // See if there is an outer wrapper - if(in->inSymSeed.t.size != 0) - { - // in->inParentHandle is a parent, but in order to decrypt an outer wrapper, - // it must be able to do key exchange and a symmetric key can't do that. - if(parentObject->publicArea.type == TPM_ALG_SYMCIPHER) - return TPM_RCS_TYPE + RC_Import_parentHandle; - // Decrypt input secret data via asymmetric decryption. TPM_RC_ATTRIBUTES, - // TPM_RC_ECC_POINT, TPM_RC_INSUFFICIENT, TPM_RC_KEY, TPM_RC_NO_RESULT, - // TPM_RC_SIZE, TPM_RC_VALUE may be returned at this point - result = CryptSecretDecrypt(parentObject, NULL, DUPLICATE_STRING, - &in->inSymSeed, &data); - pAssert_RC(result != TPM_RC_BINDING); - if(result != TPM_RC_SUCCESS) - return RcSafeAddToResult(result, RC_Import_inSymSeed); - } - else - { - // If encrytpedDuplication is set, then the object must have an outer - // wrapper - if(IS_ATTRIBUTE(attributes, TPMA_OBJECT, encryptedDuplication)) - return TPM_RCS_ATTRIBUTES + RC_Import_inSymSeed; - data.t.size = 0; - } - // Compute name of object - PublicMarshalAndComputeName(&(in->objectPublic.publicArea), &name); - if(name.t.size == 0) - return TPM_RCS_HASH + RC_Import_objectPublic; - // Retrieve sensitive from private. - // TPM_RC_INSUFFICIENT, TPM_RC_INTEGRITY, TPM_RC_SIZE may be returned here. - result = DuplicateToSensitive(&in->duplicate.b, &name.b, parentObject, - in->objectPublic.publicArea.nameAlg, - &data.b, &in->symmetricAlg, - &in->encryptionKey.b, &sensitive); - if(result != TPM_RC_SUCCESS) - return RcSafeAddToResult(result, RC_Import_duplicate); - // If the parent of this object has fixedTPM SET, then validate this - // object as if it were being loaded so that validation can be skipped - // when it is actually loaded. - if(IS_ATTRIBUTE(parentObject->publicArea.objectAttributes, TPMA_OBJECT, fixedTPM)) - { - result = ObjectLoad(NULL, NULL, &in->objectPublic.publicArea, - &sensitive, RC_Import_objectPublic, RC_Import_duplicate, - NULL); - } - // Command output - if(result == TPM_RC_SUCCESS) - { - // Prepare output private data from sensitive - SensitiveToPrivate(&sensitive, &name, parentObject, - in->objectPublic.publicArea.nameAlg, - &out->outPrivate); - } - return result; -} -#endif // CC_Import diff --git a/src/tpm2/EACommands.c b/src/tpm2/EACommands.c index e274a5330..7c89a9acf 100644 --- a/src/tpm2/EACommands.c +++ b/src/tpm2/EACommands.c @@ -504,97 +504,6 @@ TPM2_PolicyOR(PolicyOR_In* in // IN: input parameter list #endif // CC_PolicyOR -#include "Tpm.h" - -#if CC_PolicyPCR // Conditional expansion of this file - -# include "PolicyPCR_fp.h" -# include "Marshal.h" - -/*(See part 3 specification) -// Add a PCR gate for a policy session -*/ -// Return Type: TPM_RC -// TPM_RC_VALUE if provided, 'pcrDigest' does not match the -// current PCR settings -// TPM_RC_PCR_CHANGED a previous TPM2_PolicyPCR() set -// pcrCounter and it has changed -TPM_RC -TPM2_PolicyPCR(PolicyPCR_In* in // IN: input parameter list - ) -{ - SESSION* session; - TPM2B_DIGEST pcrDigest; - BYTE pcrs[sizeof(TPML_PCR_SELECTION)]; - UINT32 pcrSize; - BYTE* buffer; - TPM_CC commandCode = TPM_CC_PolicyPCR; - HASH_STATE hashState; - // Input Validation - - // Get pointer to the session structure - session = SessionGet(in->policySession); - - // Compute current PCR digest - PCRComputeCurrentDigest(session->authHashAlg, &in->pcrs, &pcrDigest); - - // Do validation for non trial session - if(session->attributes.isTrialPolicy == CLEAR) - { - // Make sure that this is not going to invalidate a previous PCR check - if(session->pcrCounter != 0 && session->pcrCounter != gr.pcrCounter) - return TPM_RC_PCR_CHANGED; - - // If the caller specified the PCR digest and it does not - // match the current PCR settings, return an error.. - if(in->pcrDigest.t.size != 0) - { - if(!MemoryEqual2B(&in->pcrDigest.b, &pcrDigest.b)) - return TPM_RCS_VALUE + RC_PolicyPCR_pcrDigest; - } - } - else - { - // For trial session, just use the input PCR digest if one provided - // Note: It can't be too big because it is a TPM2B_DIGEST and the size - // would have been checked during unmarshaling - if(in->pcrDigest.t.size != 0) - pcrDigest = in->pcrDigest; - } - // Internal Data Update - // Update policy hash - // policyDigestnew = hash( policyDigestold || TPM_CC_PolicyPCR - // || PCRS || pcrDigest) - // Start hash - CryptHashStart(&hashState, session->authHashAlg); - - // add old digest - CryptDigestUpdate2B(&hashState, &session->u2.policyDigest.b); - - // add commandCode - CryptDigestUpdateInt(&hashState, sizeof(TPM_CC), commandCode); - - // add PCRS - buffer = pcrs; - pcrSize = TPML_PCR_SELECTION_Marshal(&in->pcrs, &buffer, NULL); - CryptDigestUpdate(&hashState, pcrSize, pcrs); - - // add PCR digest - CryptDigestUpdate2B(&hashState, &pcrDigest.b); - - // complete the hash and get the results - CryptHashEnd2B(&hashState, &session->u2.policyDigest.b); - - // update pcrCounter in session context for non trial session - if(session->attributes.isTrialPolicy == CLEAR) - { - session->pcrCounter = gr.pcrCounter; - } - - return TPM_RC_SUCCESS; -} - -#endif // CC_PolicyPCR #include "Tpm.h" #include "PolicyPhysicalPresence_fp.h" diff --git a/src/tpm2/HierarchyCommands.c b/src/tpm2/HierarchyCommands.c index e68eab467..2cbeb5fcd 100644 --- a/src/tpm2/HierarchyCommands.c +++ b/src/tpm2/HierarchyCommands.c @@ -58,102 +58,6 @@ /* */ /********************************************************************************/ -#include "Tpm.h" -#include "CreatePrimary_fp.h" -#if CC_CreatePrimary // Conditional expansion of this file -TPM_RC -TPM2_CreatePrimary( - CreatePrimary_In *in, // IN: input parameter list - CreatePrimary_Out *out // OUT: output parameter list - ) -{ - TPM_RC result = TPM_RC_SUCCESS; - TPMT_PUBLIC *publicArea; - DRBG_STATE rand; - OBJECT *newObject; - TPM2B_NAME name; - TPM2B_SEED primary_seed; - // Input Validation - // Will need a place to put the result - newObject = FindEmptyObjectSlot(&out->objectHandle); - if(newObject == NULL) - return TPM_RC_OBJECT_MEMORY; - // Get the address of the public area in the new object - // (this is just to save typing) - publicArea = &newObject->publicArea; - - *publicArea = in->inPublic.publicArea; - - // Check attributes in input public area. CreateChecks() checks the things that - // are unique to creation and then validates the attributes and values that are - // common to create and load. - result = CreateChecks( - NULL, in->primaryHandle, publicArea, in->inSensitive.sensitive.data.t.size); - if(result != TPM_RC_SUCCESS) - return RcSafeAddToResult(result, RC_CreatePrimary_inPublic); - // Validate the sensitive area values - if(!AdjustAuthSize(&in->inSensitive.sensitive.userAuth, publicArea->nameAlg)) - return TPM_RCS_SIZE + RC_CreatePrimary_inSensitive; - // Command output - // Compute the name using out->name as a scratch area (this is not the value - // that ultimately will be returned, then instantiate the state that will be - // used as a random number generator during the object creation. - // The caller does not know the seed values so the actual name does not have - // to be over the input, it can be over the unmarshaled structure. - - result = HierarchyGetPrimarySeed(in->primaryHandle, &primary_seed); - if(result != TPM_RC_SUCCESS) - return result; - - result = - DRBG_InstantiateSeeded(&rand, - &primary_seed.b, - PRIMARY_OBJECT_CREATION, - (TPM2B*)PublicMarshalAndComputeName(publicArea, &name), - &in->inSensitive.sensitive.data.b, - HierarchyGetPrimarySeedCompatLevel(in->primaryHandle)); // libtpms added - MemorySet(primary_seed.b.buffer, 0, primary_seed.b.size); - - if(result == TPM_RC_SUCCESS) - { - newObject->attributes.primary = SET; - if(HierarchyNormalizeHandle(in->primaryHandle) == TPM_RH_ENDORSEMENT) - newObject->attributes.epsHierarchy = SET; - - // Create the primary object. - result = CryptCreateObject( - newObject, &in->inSensitive.sensitive, (RAND_STATE*)&rand); - DRBG_Uninstantiate(&rand); - } - if(result != TPM_RC_SUCCESS) - return result; - - // Set the publicArea and name from the computed values - out->outPublic.publicArea = newObject->publicArea; - out->name = newObject->name; - - // Fill in creation data - FillInCreationData(in->primaryHandle, - publicArea->nameAlg, - &in->creationPCR, - &in->outsideInfo, - &out->creationData, - &out->creationHash); - - // Compute creation ticket - result = TicketComputeCreation(EntityGetHierarchy(in->primaryHandle), - &out->name, - &out->creationHash, - &out->creationTicket); - if(result != TPM_RC_SUCCESS) - return result; - - // Set the remaining attributes for a loaded object - ObjectSetLoadedAttributes(newObject, in->primaryHandle, - HierarchyGetPrimarySeedCompatLevel(in->primaryHandle)); // libtpms added - return result; -} -#endif // CC_CreatePrimary #include "Tpm.h" #include "HierarchyControl_fp.h" #if CC_HierarchyControl // Conditional expansion of this file diff --git a/src/tpm2/Import.c b/src/tpm2/Import.c new file mode 100644 index 000000000..e8dc4a1c6 --- /dev/null +++ b/src/tpm2/Import.c @@ -0,0 +1,187 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "Import_fp.h" + +#if CC_Import // Conditional expansion of this file + +# include "Object_spt_fp.h" + +/*(See part 3 specification) +// This command allows an asymmetrically encrypted blob, containing a duplicated +// object to be re-encrypted using the group symmetric key associated with the +// parent. +*/ +// Return Type: TPM_RC +// TPM_RC_ATTRIBUTES 'FixedTPM' and 'fixedParent' of 'objectPublic' are not +// both CLEAR; or 'inSymSeed' is nonempty and +// 'parentHandle' does not reference a decryption key; or +// 'objectPublic' and 'parentHandle' have incompatible +// or inconsistent attributes; or +// encrytpedDuplication is SET in 'objectPublic' but the +// inner or outer wrapper is missing. +// Note that if the TPM provides parameter values, the +// parameter number will indicate 'symmetricKey' (missing +// inner wrapper) or 'inSymSeed' (missing outer wrapper) +// TPM_RC_BINDING 'duplicate' and 'objectPublic' are not +// cryptographically bound +// TPM_RC_ECC_POINT 'inSymSeed' is nonempty and ECC point in 'inSymSeed' +// is not on the curve +// TPM_RC_HASH 'objectPublic' does not have a valid nameAlg +// TPM_RC_INSUFFICIENT 'inSymSeed' is nonempty and failed to retrieve ECC +// point from the secret; or unmarshaling sensitive value +// from 'duplicate' failed the result of 'inSymSeed' +// decryption +// TPM_RC_INTEGRITY 'duplicate' integrity is broken +// TPM_RC_KDF 'objectPublic' representing decrypting keyed hash +// object specifies invalid KDF +// TPM_RC_KEY inconsistent parameters of 'objectPublic'; or +// 'inSymSeed' is nonempty and 'parentHandle' does not +// reference a key of supported type; or +// invalid key size in 'objectPublic' representing an +// asymmetric key +// TPM_RC_NO_RESULT 'inSymSeed' is nonempty and multiplication resulted in +// ECC point at infinity +// TPM_RC_OBJECT_MEMORY no available object slot +// TPM_RC_SCHEME inconsistent attributes 'decrypt', 'sign', +// 'restricted' and key's scheme ID in 'objectPublic'; +// or hash algorithm is inconsistent with the scheme ID +// for keyed hash object +// TPM_RC_SIZE 'authPolicy' size does not match digest size of the +// name algorithm in 'objectPublic'; or +// 'symmetricAlg' and 'encryptionKey' have different +// sizes; or +// 'inSymSeed' is nonempty and it size is not +// consistent with the type of 'parentHandle'; or +// unmarshaling sensitive value from 'duplicate' failed +// TPM_RC_SYMMETRIC 'objectPublic' is either a storage key with no +// symmetric algorithm or a non-storage key with +// symmetric algorithm different from TPM_ALG_NULL +// TPM_RC_TYPE unsupported type of 'objectPublic'; or +// 'parentHandle' is not a storage key; or +// only the public portion of 'parentHandle' is loaded; +// or 'objectPublic' and 'duplicate' are of different +// types +// TPM_RC_VALUE nonempty 'inSymSeed' and its numeric value is +// greater than the modulus of the key referenced by +// 'parentHandle' or 'inSymSeed' is larger than the +// size of the digest produced by the name algorithm of +// the symmetric key referenced by 'parentHandle' +TPM_RC +TPM2_Import(Import_In* in, // IN: input parameter list + Import_Out* out // OUT: output parameter list +) +{ + TPM_RC result = TPM_RC_SUCCESS; + OBJECT* parentObject; + TPM2B_DATA data; // symmetric key + TPMT_SENSITIVE sensitive; + TPM2B_NAME name; + TPMA_OBJECT attributes; + UINT16 innerKeySize = 0; // encrypt key size for inner + // wrapper + + // Input Validation + // to save typing + attributes = in->objectPublic.publicArea.objectAttributes; + // FixedTPM and fixedParent must be CLEAR + if(IS_ATTRIBUTE(attributes, TPMA_OBJECT, fixedTPM) + || IS_ATTRIBUTE(attributes, TPMA_OBJECT, fixedParent)) + return TPM_RCS_ATTRIBUTES + RC_Import_objectPublic; + + // Get parent pointer + parentObject = HandleToObject(in->parentHandle); + pAssert_RC(parentObject != NULL); + + if(!ObjectIsParent(parentObject)) + return TPM_RCS_TYPE + RC_Import_parentHandle; + + if(in->symmetricAlg.algorithm != TPM_ALG_NULL) + { + // Get inner wrap key size + innerKeySize = in->symmetricAlg.keyBits.sym; + // Input symmetric key must match the size of algorithm. + if(in->encryptionKey.t.size != (innerKeySize + 7) / 8) + return TPM_RCS_SIZE + RC_Import_encryptionKey; + } + else + { + // If input symmetric algorithm is NULL, input symmetric key size must + // be 0 as well + if(in->encryptionKey.t.size != 0) + return TPM_RCS_SIZE + RC_Import_encryptionKey; + // If encryptedDuplication is SET, then the object must have an inner + // wrapper + if(IS_ATTRIBUTE(attributes, TPMA_OBJECT, encryptedDuplication)) + return TPM_RCS_ATTRIBUTES + RC_Import_encryptionKey; + } + // See if there is an outer wrapper + if(in->inSymSeed.t.size != 0) + { + // in->inParentHandle is a parent, but in order to decrypt an outer wrapper, + // it must be able to do key exchange and a symmetric key can't do that. + if(parentObject->publicArea.type == TPM_ALG_SYMCIPHER) + return TPM_RCS_TYPE + RC_Import_parentHandle; + + // Decrypt input secret data via asymmetric decryption. TPM_RC_ATTRIBUTES, + // TPM_RC_ECC_POINT, TPM_RC_INSUFFICIENT, TPM_RC_KEY, TPM_RC_NO_RESULT, + // TPM_RC_SIZE, TPM_RC_VALUE may be returned at this point + result = CryptSecretDecrypt( + parentObject, NULL, DUPLICATE_STRING, &in->inSymSeed, &data); + pAssert_RC(result != TPM_RC_BINDING); + if(result != TPM_RC_SUCCESS) + return RcSafeAddToResult(result, RC_Import_inSymSeed); + } + else + { + // If encrytpedDuplication is set, then the object must have an outer + // wrapper + if(IS_ATTRIBUTE(attributes, TPMA_OBJECT, encryptedDuplication)) + return TPM_RCS_ATTRIBUTES + RC_Import_inSymSeed; + data.t.size = 0; + } + // Compute name of object + PublicMarshalAndComputeName(&(in->objectPublic.publicArea), &name); + if(name.t.size == 0) + return TPM_RCS_HASH + RC_Import_objectPublic; + + // Retrieve sensitive from private. + // TPM_RC_INSUFFICIENT, TPM_RC_INTEGRITY, TPM_RC_SIZE may be returned here. + result = DuplicateToSensitive(&in->duplicate.b, + &name.b, + parentObject, + in->objectPublic.publicArea.nameAlg, + &data.b, + &in->symmetricAlg, + &in->encryptionKey.b, + &sensitive); + if(result != TPM_RC_SUCCESS) + return RcSafeAddToResult(result, RC_Import_duplicate); + + // If the parent of this object has fixedTPM SET, then validate this + // object as if it were being loaded so that validation can be skipped + // when it is actually loaded. + if(IS_ATTRIBUTE(parentObject->publicArea.objectAttributes, TPMA_OBJECT, fixedTPM)) + { + result = ObjectLoad(NULL, + NULL, + &in->objectPublic.publicArea, + &sensitive, + RC_Import_objectPublic, + RC_Import_duplicate, + NULL); + } + // Command output + if(result == TPM_RC_SUCCESS) + { + // Prepare output private data from sensitive + result = SensitiveToPrivate(&sensitive, + &name, + parentObject, + in->objectPublic.publicArea.nameAlg, + &out->outPrivate); + } + return result; +} + +#endif // CC_Import diff --git a/src/tpm2/IntegrityCommands.c b/src/tpm2/IntegrityCommands.c index 1380e456f..a5e100c85 100644 --- a/src/tpm2/IntegrityCommands.c +++ b/src/tpm2/IntegrityCommands.c @@ -140,23 +140,6 @@ TPM2_PCR_Event( } #endif // CC_PCR_Event #include "Tpm.h" -#include "PCR_Read_fp.h" -#if CC_PCR_Read // Conditional expansion of this file -TPM_RC -TPM2_PCR_Read( - PCR_Read_In *in, // IN: input parameter list - PCR_Read_Out *out // OUT: output parameter list - ) -{ - // Command Output - // Call PCR read function. input pcrSelectionIn parameter could be changed - // to reflect the actual PCR being returned - PCRRead(&in->pcrSelectionIn, &out->pcrValues, &out->pcrUpdateCounter); - out->pcrSelectionOut = in->pcrSelectionIn; - return TPM_RC_SUCCESS; -} -#endif // CC_PCR_Read -#include "Tpm.h" #include "PCR_Allocate_fp.h" #if CC_PCR_Allocate // Conditional expansion of this file TPM_RC diff --git a/src/tpm2/MakeCredential.c b/src/tpm2/MakeCredential.c new file mode 100644 index 000000000..f858d5b1d --- /dev/null +++ b/src/tpm2/MakeCredential.c @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "MakeCredential_fp.h" + +#if CC_MakeCredential // Conditional expansion of this file + +# include "Object_spt_fp.h" + +/*(See part 3 specification) +// Make Credential with an object +*/ +// Return Type: TPM_RC +// TPM_RC_KEY 'handle' referenced an ECC key that has a unique +// field that is not a point on the curve of the key +// TPM_RC_SIZE 'credential' is larger than the digest size of +// Name algorithm of 'handle' +// TPM_RC_TYPE 'handle' does not reference an asymmetric +// decryption key +TPM_RC +TPM2_MakeCredential(MakeCredential_In* in, // IN: input parameter list + MakeCredential_Out* out // OUT: output parameter list +) +{ + TPM_RC result = TPM_RC_SUCCESS; + + OBJECT* object; + TPM2B_DATA data; + + // Input Validation + + // Get object pointer + object = HandleToObject(in->handle); + pAssert_RC(object != NULL); + + // input key must be an asymmetric, restricted decryption key + // NOTE: Needs to be restricted to have a symmetric value. + if(!CryptIsAsymAlgorithm(object->publicArea.type) + || !IS_ATTRIBUTE(object->publicArea.objectAttributes, TPMA_OBJECT, decrypt) + || !IS_ATTRIBUTE(object->publicArea.objectAttributes, TPMA_OBJECT, restricted)) + return TPM_RCS_TYPE + RC_MakeCredential_handle; + + // The credential information may not be larger than the digest size used for + // the Name of the key associated with handle. + if(in->credential.t.size > CryptHashGetDigestSize(object->publicArea.nameAlg)) + return TPM_RCS_SIZE + RC_MakeCredential_credential; + + // Command Output + + // Make encrypt key and its associated secret structure. + out->secret.t.size = sizeof(out->secret.t.secret); + result = CryptSecretEncrypt(object, IDENTITY_STRING, &data, &out->secret); + if(result != TPM_RC_SUCCESS) + return result; + + // Prepare output credential data from secret + return SecretToCredential( + &in->credential, &in->objectName.b, &data.b, object, &out->credentialBlob); +} + +#endif // CC_MakeCredential diff --git a/src/tpm2/ObjectChangeAuth.c b/src/tpm2/ObjectChangeAuth.c new file mode 100644 index 000000000..55c07c3f0 --- /dev/null +++ b/src/tpm2/ObjectChangeAuth.c @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "ObjectChangeAuth_fp.h" + +#if CC_ObjectChangeAuth // Conditional expansion of this file + +# include "Object_spt_fp.h" + +/*(See part 3 specification) +// Create an object +*/ +// Return Type: TPM_RC +// TPM_RC_SIZE 'newAuth' is larger than the size of the digest +// of the Name algorithm of 'objectHandle' +// TPM_RC_TYPE the key referenced by 'parentHandle' is not the +// parent of the object referenced by 'objectHandle'; +// or 'objectHandle' is a sequence object. +TPM_RC +TPM2_ObjectChangeAuth(ObjectChangeAuth_In* in, // IN: input parameter list + ObjectChangeAuth_Out* out // OUT: output parameter list +) +{ + TPMT_SENSITIVE sensitive; + + OBJECT* object = HandleToObject(in->objectHandle); + TPM2B_NAME QNCompare; + + // Input Validation + + // Can not change authorization on sequence object + if(ObjectIsSequence(object)) + return TPM_RCS_TYPE + RC_ObjectChangeAuth_objectHandle; + + // deliberately after ObjectIsSequence in case ObjectInSequence decides a + // null object is a non-fatal error + pAssert_RC(object != NULL); + + // Make sure that the authorization value is consistent with the nameAlg + if(!AdjustAuthSize(&in->newAuth, object->publicArea.nameAlg)) + return TPM_RCS_SIZE + RC_ObjectChangeAuth_newAuth; + + // Parent handle should be the parent of object handle. In this + // implementation we verify this by checking the QN of object. Other + // implementation may choose different method to verify this attribute. + ComputeQualifiedName( + in->parentHandle, object->publicArea.nameAlg, &object->name, &QNCompare); + if(!MemoryEqual2B(&object->qualifiedName.b, &QNCompare.b)) + return TPM_RCS_TYPE + RC_ObjectChangeAuth_parentHandle; + + // Command Output + // Prepare the sensitive area with the new authorization value + sensitive = object->sensitive; + sensitive.authValue = in->newAuth; + + // Protect the sensitive area + return SensitiveToPrivate(&sensitive, + &object->name, + HandleToObject(in->parentHandle), + object->publicArea.nameAlg, + &out->outPrivate); +} + +#endif // CC_ObjectChangeAuth diff --git a/src/tpm2/ObjectCommands.c b/src/tpm2/ObjectCommands.c index 4f87ae090..972ad441d 100644 --- a/src/tpm2/ObjectCommands.c +++ b/src/tpm2/ObjectCommands.c @@ -58,138 +58,6 @@ /* */ /********************************************************************************/ -#include "Tpm.h" -#include "Object_spt_fp.h" -#include "Create_fp.h" - -#if CC_Create // Conditional expansion of this file - -/*(See part 3 specification) -// Create a regular object -*/ -// Return Type: TPM_RC -// TPM_RC_ATTRIBUTES 'sensitiveDataOrigin' is CLEAR when 'sensitive.data' -// is an Empty Buffer, or is SET when 'sensitive.data' is -// not empty; -// 'fixedTPM', 'fixedParent', or 'encryptedDuplication' -// attributes are inconsistent between themselves or with -// those of the parent object; -// inconsistent 'restricted', 'decrypt' and 'sign' -// attributes; -// attempt to inject sensitive data for an asymmetric -// key; -// TPM_RC_HASH non-duplicable storage key and its parent have -// different name algorithm -// TPM_RC_KDF incorrect KDF specified for decrypting keyed hash -// object -// TPM_RC_KEY invalid key size values in an asymmetric key public -// area or a provided symmetric key has a value that is -// not allowed -// TPM_RC_KEY_SIZE key size in public area for symmetric key differs from -// the size in the sensitive creation area; may also be -// returned if the TPM does not allow the key size to be -// used for a Storage Key -// TPM_RC_OBJECT_MEMORY a free slot is not available as scratch memory for -// object creation -// TPM_RC_RANGE the exponent value of an RSA key is not supported. -// TPM_RC_SCHEME inconsistent attributes 'decrypt', 'sign', or -// 'restricted' and key's scheme ID; or hash algorithm is -// inconsistent with the scheme ID for keyed hash object -// TPM_RC_SIZE size of public authPolicy or sensitive authValue does -// not match digest size of the name algorithm -// sensitive data size for the keyed hash object is -// larger than is allowed for the scheme -// TPM_RC_SYMMETRIC a storage key with no symmetric algorithm specified; -// or non-storage key with symmetric algorithm different -// from TPM_ALG_NULL -// TPM_RC_TYPE unknown object type; -// 'parentHandle' does not reference a restricted -// decryption key in the storage hierarchy with both -// public and sensitive portion loaded -// TPM_RC_VALUE exponent is not prime or could not find a prime using -// the provided parameters for an RSA key; -// unsupported name algorithm for an ECC key -// TPM_RC_OBJECT_MEMORY there is no free slot for the object -TPM_RC -TPM2_Create(Create_In* in, // IN: input parameter list - Create_Out* out // OUT: output parameter list - ) -{ - TPM_RC result = TPM_RC_SUCCESS; - OBJECT* parentObject; - OBJECT* newObject; - TPMT_PUBLIC* publicArea; - // Input Validation - parentObject = HandleToObject(in->parentHandle); - pAssert_RC(parentObject != NULL); - - // Does parent have the proper attributes? - if(!ObjectIsParent(parentObject)) - return TPM_RCS_TYPE + RC_Create_parentHandle; - - // Get a slot for the creation - newObject = FindEmptyObjectSlot(NULL); - if(newObject == NULL) - return TPM_RC_OBJECT_MEMORY; - // If the TPM2B_PUBLIC was passed as a structure, marshal it into is canonical - // form for processing - - // to save typing. - publicArea = &newObject->publicArea; - - // Copy the input structure to the allocated structure - *publicArea = in->inPublic.publicArea; - - // Check attributes in input public area. CreateChecks() checks the things that - // are unique to creation and then validates the attributes and values that are - // common to create and load. - result = CreateChecks(parentObject, - /* primaryHierarchy = */ 0, - publicArea, - in->inSensitive.sensitive.data.t.size); - if(result != TPM_RC_SUCCESS) - return RcSafeAddToResult(result, RC_Create_inPublic); - // Clean up the authValue if necessary - if(!AdjustAuthSize(&in->inSensitive.sensitive.userAuth, publicArea->nameAlg)) - return TPM_RCS_SIZE + RC_Create_inSensitive; - - // Command Output - // Create the object using the default TPM random-number generator - result = CryptCreateObject(newObject, &in->inSensitive.sensitive, NULL); - if(result != TPM_RC_SUCCESS) - return result; - // Fill in creation data - FillInCreationData(in->parentHandle, - publicArea->nameAlg, - &in->creationPCR, - &in->outsideInfo, - &out->creationData, - &out->creationHash); - - // Compute creation ticket - result = TicketComputeCreation(EntityGetHierarchy(in->parentHandle), - &newObject->name, - &out->creationHash, - &out->creationTicket); - if(result != TPM_RC_SUCCESS) - return result; - - // Prepare output private data from sensitive - SensitiveToPrivate(&newObject->sensitive, - &newObject->name, - parentObject, - publicArea->nameAlg, - &out->outPrivate); - - newObject->hierarchy = parentObject->hierarchy; - - // Finish by copying the remaining return values - out->outPublic.publicArea = newObject->publicArea; - return TPM_RC_SUCCESS; -} - -#endif // CC_Create - #include "Tpm.h" #include "Load_fp.h" #if CC_Load // Conditional expansion of this file @@ -408,44 +276,6 @@ TPM2_ActivateCredential( } #endif // CC_ActivateCredential #include "Tpm.h" -#include "MakeCredential_fp.h" -#if CC_MakeCredential // Conditional expansion of this file -#include "Object_spt_fp.h" -TPM_RC -TPM2_MakeCredential( - MakeCredential_In *in, // IN: input parameter list - MakeCredential_Out *out // OUT: output parameter list - ) -{ - TPM_RC result = TPM_RC_SUCCESS; - OBJECT *object; - TPM2B_DATA data; - // Input Validation - // Get object pointer - object = HandleToObject(in->handle); - // input key must be an asymmetric, restricted decryption key - // NOTE: Needs to be restricted to have a symmetric value. - if(!CryptIsAsymAlgorithm(object->publicArea.type) - || !IS_ATTRIBUTE(object->publicArea.objectAttributes, TPMA_OBJECT, decrypt) - || !IS_ATTRIBUTE(object->publicArea.objectAttributes, TPMA_OBJECT, restricted)) - return TPM_RCS_TYPE + RC_MakeCredential_handle; - // The credential information may not be larger than the digest size used for - // the Name of the key associated with handle. - if(in->credential.t.size > CryptHashGetDigestSize(object->publicArea.nameAlg)) - return TPM_RCS_SIZE + RC_MakeCredential_credential; - // Command Output - // Make encrypt key and its associated secret structure. - out->secret.t.size = sizeof(out->secret.t.secret); - result = CryptSecretEncrypt(object, IDENTITY_STRING, &data, &out->secret); - if(result != TPM_RC_SUCCESS) - return result; - // Prepare output credential data from secret - SecretToCredential(&in->credential, &in->objectName.b, &data.b, - object, &out->credentialBlob); - return TPM_RC_SUCCESS; -} -#endif // CC_MakeCredential -#include "Tpm.h" #include "Unseal_fp.h" #if CC_Unseal // Conditional expansion of this file TPM_RC @@ -473,260 +303,4 @@ TPM2_Unseal( return TPM_RC_SUCCESS; } #endif // CC_Unseal -#include "Tpm.h" -#include "ObjectChangeAuth_fp.h" -#if CC_ObjectChangeAuth // Conditional expansion of this file -#include "Object_spt_fp.h" -TPM_RC -TPM2_ObjectChangeAuth( - ObjectChangeAuth_In *in, // IN: input parameter list - ObjectChangeAuth_Out *out // OUT: output parameter list - ) -{ - TPMT_SENSITIVE sensitive; - OBJECT *object = HandleToObject(in->objectHandle); - TPM2B_NAME QNCompare; - // Input Validation - // Can not change authorization on sequence object - if(ObjectIsSequence(object)) - return TPM_RCS_TYPE + RC_ObjectChangeAuth_objectHandle; - // Make sure that the authorization value is consistent with the nameAlg - if(!AdjustAuthSize(&in->newAuth, object->publicArea.nameAlg)) - return TPM_RCS_SIZE + RC_ObjectChangeAuth_newAuth; - // Parent handle should be the parent of object handle. In this - // implementation we verify this by checking the QN of object. Other - // implementation may choose different method to verify this attribute. - ComputeQualifiedName(in->parentHandle, - object->publicArea.nameAlg, - &object->name, &QNCompare); - if(!MemoryEqual2B(&object->qualifiedName.b, &QNCompare.b)) - return TPM_RCS_TYPE + RC_ObjectChangeAuth_parentHandle; - // Command Output - // Prepare the sensitive area with the new authorization value - sensitive = object->sensitive; - sensitive.authValue = in->newAuth; - // Protect the sensitive area - SensitiveToPrivate(&sensitive, &object->name, HandleToObject(in->parentHandle), - object->publicArea.nameAlg, - &out->outPrivate); - return TPM_RC_SUCCESS; -} -#endif // CC_ObjectChangeAuth - -#include "Tpm.h" -#include "CreateLoaded_fp.h" - -#if CC_CreateLoaded // Conditional expansion of this file - -/*(See part 3 of specification) - * Create and load any type of key, including a temporary key. - * The input template is a marshaled public area rather than an unmarshaled one as - * used in Create and CreatePrimary. This is so that the label and context that - * could be in the template can be processed without changing the formats for the - * calls to Create and CreatePrimary. - */ -// Return Type: TPM_RC -// TPM_RC_ATTRIBUTES 'sensitiveDataOrigin' is CLEAR when 'sensitive.data' -// is an Empty Buffer; -// 'fixedTPM', 'fixedParent', or 'encryptedDuplication' -// attributes are inconsistent between themselves or with -// those of the parent object; -// inconsistent 'restricted', 'decrypt' and 'sign' -// attributes; -// attempt to inject sensitive data for an asymmetric -// key; -// attempt to create a symmetric cipher key that is not -// a decryption key -// TPM_RC_FW_LIMITED The requested hierarchy is FW-limited, but the TPM -// does not support FW-limited objects or the TPM failed -// to derive the Firmware Secret. -// TPM_RC_SVN_LIMITED The requested hierarchy is SVN-limited, but the TPM -// does not support SVN-limited objects or the TPM failed -// to derive the Firmware SVN Secret for the requested -// SVN. -// TPM_RC_KDF incorrect KDF specified for decrypting keyed hash -// object -// TPM_RC_KEY the value of a provided symmetric key is not allowed -// TPM_RC_OBJECT_MEMORY there is no free slot for the object -// TPM_RC_SCHEME inconsistent attributes 'decrypt', 'sign', -// 'restricted' and key's scheme ID; or hash algorithm is -// inconsistent with the scheme ID for keyed hash object -// TPM_RC_SIZE size of public authorization policy or sensitive -// authorization value does not match digest size of the -// name algorithm sensitive data size for the keyed hash -// object is larger than is allowed for the scheme -// TPM_RC_SYMMETRIC a storage key with no symmetric algorithm specified; -// or non-storage key with symmetric algorithm different -// from TPM_ALG_NULL -// TPM_RC_TYPE cannot create the object of the indicated type -// (usually only occurs if trying to derive an RSA key). -TPM_RC -TPM2_CreateLoaded(CreateLoaded_In* in, // IN: input parameter list - CreateLoaded_Out* out // OUT: output parameter list - ) -{ - TPM_RC result = TPM_RC_SUCCESS; - OBJECT* parent = HandleToObject(in->parentHandle); - OBJECT* newObject; - BOOL derivation; - TPMT_PUBLIC* publicArea; - RAND_STATE randState; - RAND_STATE* rand = &randState; - TPMS_DERIVE labelContext; - SEED_COMPAT_LEVEL seedCompatLevel = RuntimeProfileGetSeedCompatLevel(); // libtpms added - - // Input Validation - - // How the public area is unmarshaled is determined by the parent, so - // see if parent is a derivation parent - derivation = (parent != NULL && parent->attributes.derivation); - - // If the parent is an object, then make sure that it is either a parent or - // derivation parent - if(parent != NULL && !parent->attributes.isParent && !derivation) - return TPM_RCS_TYPE + RC_CreateLoaded_parentHandle; - - // Get a spot in which to create the newObject - newObject = FindEmptyObjectSlot(&out->objectHandle); - if(newObject == NULL) - return TPM_RC_OBJECT_MEMORY; - - // Do this to save typing - publicArea = &newObject->publicArea; - - // Unmarshal the template into the object space. TPM2_Create() and - // TPM2_CreatePrimary() have the publicArea unmarshaled by CommandDispatcher. - // This command is different because of an unfortunate property of the - // unique field of an ECC key. It is a structure rather than a single TPM2B. If - // if had been a TPM2B, then the label and context could be within a TPM2B and - // unmarshaled like other public areas. Since it is not, this command needs its - // on template that is a TPM2B that is unmarshaled as a BYTE array with a - // its own unmarshal function. - result = UnmarshalToPublic(publicArea, &in->inPublic, derivation, &labelContext); - if(result != TPM_RC_SUCCESS) - return result + RC_CreateLoaded_inPublic; - - // Validate that the authorization size is appropriate - if(!AdjustAuthSize(&in->inSensitive.sensitive.userAuth, publicArea->nameAlg)) - return TPM_RCS_SIZE + RC_CreateLoaded_inSensitive; - - // Command output - if(derivation) - { - TPMT_KEYEDHASH_SCHEME* scheme; - scheme = &parent->publicArea.parameters.keyedHashDetail.scheme; - - // SP800-108 is the only KDF supported by this implementation and there is - // no default hash algorithm. - pAssert(scheme->details.xor.hashAlg != TPM_ALG_NULL - && scheme->details.xor.kdf == TPM_ALG_KDF1_SP800_108); - // Don't derive RSA keys - if(publicArea->type == TPM_ALG_RSA) - return TPM_RCS_TYPE + RC_CreateLoaded_inPublic; - if(publicArea->type == TPM_ALG_ECC && // libtpms added begin - RuntimeProfileRequiresAttributeFlags(&g_RuntimeProfile, - RUNTIME_ATTRIBUTE_NO_ECC_KEY_DERIVATION)) - return TPM_RCS_TYPE + RC_CreateLoaded_inPublic; // libtpms added end - // sensitiveDataOrigin has to be CLEAR in a derived object. Since this - // is specific to a derived object, it is checked here. - if(IS_ATTRIBUTE( - publicArea->objectAttributes, TPMA_OBJECT, sensitiveDataOrigin)) - return TPM_RCS_ATTRIBUTES; - // Check the rest of the attributes - result = PublicAttributesValidation(parent, 0, publicArea); - if(result != TPM_RC_SUCCESS) - return RcSafeAddToResult(result, RC_CreateLoaded_inPublic); - // Process the template and sensitive areas to get the actual 'label' and - // 'context' values to be used for this derivation. - result = SetLabelAndContext(&labelContext, &in->inSensitive.sensitive.data); - if(result != TPM_RC_SUCCESS) - return result; - // Set up the KDF for object generation - DRBG_InstantiateSeededKdf((KDF_STATE*)rand, - scheme->details.xor.hashAlg, - scheme->details.xor.kdf, - &parent->sensitive.sensitive.bits.b, - &labelContext.label.b, - &labelContext.context.b, - TPM_MAX_DERIVATION_BITS); - // Clear the sensitive size so that the creation functions will not try - // to use this value. - in->inSensitive.sensitive.data.t.size = 0; - seedCompatLevel = parent->seedCompatLevel; // libtpms added - } - else - { - // Check attributes in input public area. CreateChecks() checks the things - // that are unique to creation and then validates the attributes and values - // that are common to create and load. - result = CreateChecks(parent, - (parent == NULL) ? in->parentHandle : 0, - publicArea, - in->inSensitive.sensitive.data.t.size); - - if(result != TPM_RC_SUCCESS) - return RcSafeAddToResult(result, RC_CreateLoaded_inPublic); - // Creating a primary object - if(parent == NULL) - { - TPM2B_NAME name; - TPM2B_SEED primary_seed; - - newObject->attributes.primary = SET; - if(HierarchyNormalizeHandle(in->parentHandle) == TPM_RH_ENDORSEMENT) - newObject->attributes.epsHierarchy = SET; - seedCompatLevel = HierarchyGetPrimarySeedCompatLevel(in->parentHandle); // libtpms added - // If so, use the primary seed and the digest of the template - // to seed the DRBG - - result = HierarchyGetPrimarySeed(in->parentHandle, &primary_seed); - if(result != TPM_RC_SUCCESS) - return result; - - // If so, use the primary seed and the digest of the template - // to seed the DRBG - result = DRBG_InstantiateSeeded( - (DRBG_STATE*)rand, - &primary_seed.b, - PRIMARY_OBJECT_CREATION, - (TPM2B*)PublicMarshalAndComputeName(publicArea, &name), - &in->inSensitive.sensitive.data.b, - seedCompatLevel); // libtpms added - MemorySet(primary_seed.b.buffer, 0, primary_seed.b.size); - - if(result != TPM_RC_SUCCESS) - return result; - } - else - { - // This is an ordinary object so use the normal random number generator - rand = NULL; - } - } - // Internal data update - // Create the object - result = CryptCreateObject(newObject, &in->inSensitive.sensitive, rand); - DRBG_Uninstantiate((DRBG_STATE*)rand); - if(result != TPM_RC_SUCCESS) - return result; - // if this is not a Primary key and not a derived key, then return the sensitive - // area - if(parent != NULL && !derivation) - // Prepare output private data from sensitive - SensitiveToPrivate(&newObject->sensitive, - &newObject->name, - parent, - newObject->publicArea.nameAlg, - &out->outPrivate); - else - out->outPrivate.t.size = 0; - // Set the remaining return values - out->outPublic.publicArea = newObject->publicArea; - out->name = newObject->name; - // Set the remaining attributes for a loaded object - ObjectSetLoadedAttributes(newObject, in->parentHandle, - seedCompatLevel); // libtpms added - return result; -} -#endif // CC_CreateLoaded diff --git a/src/tpm2/Object_spt.c b/src/tpm2/Object_spt.c index a758c051c..3fc22324e 100644 --- a/src/tpm2/Object_spt.c +++ b/src/tpm2/Object_spt.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Object Command Support */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes #include "Tpm.h" @@ -804,7 +746,7 @@ PublicAttributesValidation( //*** FillInCreationData() // Fill in creation data for an object. // Return Type: void -void FillInCreationData( +TPM_RC FillInCreationData( TPMI_DH_OBJECT parentHandle, // IN: handle of parent TPMI_ALG_HASH nameHashAlg, // IN: name hash algorithm TPML_PCR_SELECTION* creationPCR, // IN: PCR selection @@ -820,8 +762,10 @@ void FillInCreationData( // Fill in TPMS_CREATION_DATA in outCreation // Compute PCR digest - PCRComputeCurrentDigest( + TPM_RC result = PCRComputeCurrentDigest( nameHashAlg, creationPCR, &outCreation->creationData.pcrDigest); + if(result != TPM_RC_SUCCESS) + return result; // Put back PCR selection list outCreation->creationData.pcrSelect = *creationPCR; @@ -867,7 +811,7 @@ void FillInCreationData( CryptDigestUpdate(&hashState, outCreation->size, creationBuffer); CryptHashEnd2B(&hashState, &creationDigest->b); - return; + return TPM_RC_SUCCESS; } //*** GetSeedForKDF() @@ -1127,7 +1071,7 @@ static UINT16 MarshalSensitive( // 1. marshal TPM2B_SENSITIVE structure into the buffer of TPM2B_PRIVATE // 2. apply encryption to the sensitive area. // 3. apply outer integrity computation. -void SensitiveToPrivate( +TPM_RC SensitiveToPrivate( TPMT_SENSITIVE* sensitive, // IN: sensitive structure TPM2B_NAME* name, // IN: the name of the object OBJECT* parent, // IN: The parent object @@ -1144,7 +1088,7 @@ void SensitiveToPrivate( UINT16 integritySize; UINT16 ivSize; // - pAssert(name != NULL && name->t.size != 0); + pAssert_RC(name != NULL && name->t.size != 0); // Find the hash algorithm for integrity computation if(parent == NULL) @@ -1178,7 +1122,8 @@ void SensitiveToPrivate( //Produce outer wrap, including encryption and HMAC outPrivate->t.size = ProduceOuterWrap( parent, &name->b, hashAlg, NULL, TRUE, dataSize, outPrivate->t.buffer); - return; + + return TPM_RC_SUCCESS; } //*** PrivateToSensitive() @@ -1271,7 +1216,7 @@ PrivateToSensitive(TPM2B* inPrivate, // IN: input private structure // 1. marshal TPMT_SENSITIVE structure into the buffer of TPM2B_PRIVATE // 2. apply inner wrap to the sensitive area if required // 3. apply outer wrap if required -void SensitiveToDuplicate( +TPM_RC SensitiveToDuplicate( TPMT_SENSITIVE* sensitive, // IN: sensitive structure TPM2B* name, // IN: the name of the object OBJECT* parent, // IN: The new parent object @@ -1301,10 +1246,10 @@ void SensitiveToDuplicate( BOOL doOuterWrap = FALSE; // // Make sure that name is provided - pAssert(name != NULL && name->size != 0); + pAssert_RC(name != NULL && name->size != 0); // Make sure symDef and innerSymKey are not NULL - pAssert(symDef != NULL && innerSymKey != NULL); + pAssert_RC(symDef != NULL && innerSymKey != NULL); // Starting of sensitive data without wrappers sensitiveData = outPrivate->t.buffer; @@ -1333,6 +1278,7 @@ void SensitiveToDuplicate( } // Marshal sensitive area dataSize = MarshalSensitive(NULL, sensitiveData, sensitive, nameAlg); + pAssert_RC(dataSize != 0); // 0 indicates a failure mode assertion // Apply inner wrap for duplication blob. It includes both integrity and // encryption @@ -1357,18 +1303,18 @@ void SensitiveToDuplicate( else { // assume the input key size should matches the symmetric definition - pAssert(innerSymKey->t.size == (symDef->keyBits.sym + 7) / 8); + pAssert_RC(innerSymKey->t.size == (symDef->keyBits.sym + 7) / 8); } // Encrypt inner buffer in place - CryptSymmetricEncrypt(innerBuffer, - symDef->algorithm, - symDef->keyBits.sym, - innerSymKey->t.buffer, - NULL, - TPM_ALG_CFB, - dataSize, - innerBuffer); + VERIFY_RC(CryptSymmetricEncrypt(innerBuffer, + symDef->algorithm, + symDef->keyBits.sym, + innerSymKey->t.buffer, + NULL, + TPM_ALG_CFB, + dataSize, + innerBuffer)); // If the symmetric encryption key is imported, clear the buffer for // output @@ -1385,7 +1331,7 @@ void SensitiveToDuplicate( // Data size for output outPrivate->t.size = dataSize; - return; + return TPM_RC_SUCCESS; } //*** DuplicateToSensitive() @@ -1501,11 +1447,11 @@ DuplicateToSensitive( // 2. encrypt the private buffer, excluding the leading integrity HMAC area // 3. compute integrity HMAC and append to the beginning of the buffer. // 4. Set the total size of TPM2B_ID_OBJECT buffer -void SecretToCredential(TPM2B_DIGEST* secret, // IN: secret information - TPM2B* name, // IN: the name of the object - TPM2B* seed, // IN: an external seed. - OBJECT* protector, // IN: the protector - TPM2B_ID_OBJECT* outIDObject // OUT: output credential +TPM_RC SecretToCredential(TPM2B_DIGEST* secret, // IN: secret information + TPM2B* name, // IN: the name of the object + TPM2B* seed, // IN: an external seed. + OBJECT* protector, // IN: the protector + TPM2B_ID_OBJECT* outIDObject // OUT: output credential ) { BYTE* buffer; // Auxiliary buffer pointer @@ -1513,7 +1459,7 @@ void SecretToCredential(TPM2B_DIGEST* secret, // IN: secret information TPMI_ALG_HASH outerHash; // The hash algorithm for outer wrap UINT16 dataSize; // data blob size // - pAssert(secret != NULL && outIDObject != NULL); + pAssert_RC(secret != NULL && outIDObject != NULL); // use protector's name algorithm as outer hash ???? outerHash = protector->publicArea.nameAlg; @@ -1528,7 +1474,7 @@ void SecretToCredential(TPM2B_DIGEST* secret, // IN: secret information // Apply outer wrap outIDObject->t.size = ProduceOuterWrap( protector, name, outerHash, seed, FALSE, dataSize, outIDObject->t.credential); - return; + return TPM_RC_SUCCESS; } //*** CredentialToSecret() diff --git a/src/tpm2/Object_spt_fp.h b/src/tpm2/Object_spt_fp.h index 780d2c739..bafbde9d1 100644 --- a/src/tpm2/Object_spt_fp.h +++ b/src/tpm2/Object_spt_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Object Command Support */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -154,7 +96,7 @@ PublicAttributesValidation( //*** FillInCreationData() // Fill in creation data for an object. // Return Type: void -void FillInCreationData( +TPM_RC FillInCreationData( TPMI_DH_OBJECT parentHandle, // IN: handle of parent TPMI_ALG_HASH nameHashAlg, // IN: name hash algorithm TPML_PCR_SELECTION* creationPCR, // IN: PCR selection @@ -232,7 +174,7 @@ UnwrapOuter(OBJECT* protector, // IN: The object that provides // a) marshals TPM2B_SENSITIVE structure into the buffer of TPM2B_PRIVATE // b) applies encryption to the sensitive area; and // c) applies outer integrity computation. -void SensitiveToPrivate( +TPM_RC SensitiveToPrivate( TPMT_SENSITIVE* sensitive, // IN: sensitive structure TPM2B_NAME* name, // IN: the name of the object OBJECT* parent, // IN: The parent object @@ -278,7 +220,7 @@ PrivateToSensitive(TPM2B* inPrivate, // IN: input private structure // a) marshals TPMT_SENSITIVE structure into the buffer of TPM2B_PRIVATE; // b) applies inner wrap to the sensitive area if required; and // c) applies outer wrap if required. -void SensitiveToDuplicate( +TPM_RC SensitiveToDuplicate( TPMT_SENSITIVE* sensitive, // IN: sensitive structure TPM2B* name, // IN: the name of the object OBJECT* parent, // IN: The new parent object @@ -338,11 +280,11 @@ DuplicateToSensitive( // b) encrypts the private buffer, excluding the leading integrity HMAC area; // c) computes integrity HMAC and append to the beginning of the buffer; and // d) sets the total size of TPM2B_ID_OBJECT buffer. -void SecretToCredential(TPM2B_DIGEST* secret, // IN: secret information - TPM2B* name, // IN: the name of the object - TPM2B* seed, // IN: an external seed. - OBJECT* protector, // IN: the protector - TPM2B_ID_OBJECT* outIDObject // OUT: output credential +TPM_RC SecretToCredential(TPM2B_DIGEST* secret, // IN: secret information + TPM2B* name, // IN: the name of the object + TPM2B* seed, // IN: an external seed. + OBJECT* protector, // IN: the protector + TPM2B_ID_OBJECT* outIDObject // OUT: output credential ); //*** CredentialToSecret() diff --git a/src/tpm2/PCR.c b/src/tpm2/PCR.c index 313b83d01..152e748d5 100644 --- a/src/tpm2/PCR.c +++ b/src/tpm2/PCR.c @@ -746,7 +746,7 @@ void PCRExtend(TPMI_DH_PCR handle, // IN: PCR handle to be extended // // As a side-effect, 'selection' is modified so that only the implemented PCR // will have their bits still set. -void PCRComputeCurrentDigest( +TPM_RC PCRComputeCurrentDigest( TPMI_ALG_HASH hashAlg, // IN: hash algorithm to compute digest TPML_PCR_SELECTION* selection, // IN/OUT: PCR selection (filtered on // output) @@ -762,7 +762,7 @@ void PCRComputeCurrentDigest( // Initialize the hash digest->t.size = CryptHashStart(&hashState, hashAlg); - pAssert(digest->t.size > 0 && digest->t.size < UINT16_MAX); + pAssert_RC(digest->t.size > 0 && digest->t.size < UINT16_MAX); // Iterate through the list of PCR selection structures for(i = 0; i < selection->count; i++) @@ -781,7 +781,7 @@ void PCRComputeCurrentDigest( { // Get pointer to the digest data for the bank pcrData = GetPcrPointer(selection->pcrSelections[i].hash, pcr); - pAssert(pcrData != NULL); + pAssert_RC(pcrData != NULL); CryptDigestUpdate(&hashState, pcrSize, pcrData); // add to digest } } @@ -789,18 +789,18 @@ void PCRComputeCurrentDigest( // Complete hash stack CryptHashEnd2B(&hashState, &digest->b); - return; + return TPM_RC_SUCCESS; } //*** PCRRead() // This function is used to read a list of selected PCR. If the requested PCR // number exceeds the maximum number that can be output, the 'selection' is // adjusted to reflect the actual output PCR. -void PCRRead(TPML_PCR_SELECTION* selection, // IN/OUT: PCR selection (filtered on - // output) - TPML_DIGEST* digest, // OUT: digest - UINT32* pcrCounter // OUT: the current value of PCR generation - // number +TPM_RC PCRRead(TPML_PCR_SELECTION* selection, // IN/OUT: PCR selection (filtered on + // output) + TPML_DIGEST* digest, // OUT: digest + UINT32* pcrCounter // OUT: the current value of PCR generation + // number ) { TPMS_PCR_SELECTION* select; @@ -843,7 +843,7 @@ void PCRRead(TPML_PCR_SELECTION* selection, // IN/OUT: PCR selection (filtered // Get pointer to the digest data for the bank pcrData = GetPcrPointer(selection->pcrSelections[i].hash, pcr); - pAssert(pcrData != NULL); + pAssert_RC(pcrData != NULL); // Add to the data to digest MemoryCopy(digest->digests[digest->count].t.buffer, pcrData, @@ -869,7 +869,7 @@ void PCRRead(TPML_PCR_SELECTION* selection, // IN/OUT: PCR selection (filtered *pcrCounter = gr.pcrCounter; - return; + return TPM_RC_SUCCESS; } //*** PCRAllocate() diff --git a/src/tpm2/PCR_Read.c b/src/tpm2/PCR_Read.c new file mode 100644 index 000000000..0cb1f552a --- /dev/null +++ b/src/tpm2/PCR_Read.c @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "PCR_Read_fp.h" + +#if CC_PCR_Read // Conditional expansion of this file + +/*(See part 3 specification) +// Read a set of PCR +*/ +TPM_RC +TPM2_PCR_Read(PCR_Read_In* in, // IN: input parameter list + PCR_Read_Out* out // OUT: output parameter list +) +{ + // Command Output + + // Call PCR read function. input pcrSelectionIn parameter could be changed + // to reflect the actual PCR being returned + TPM_RC result = + PCRRead(&in->pcrSelectionIn, &out->pcrValues, &out->pcrUpdateCounter); + if(result == TPM_RC_SUCCESS) + { + out->pcrSelectionOut = in->pcrSelectionIn; + } + + return result; +} + +#endif // CC_PCR_Read diff --git a/src/tpm2/PCR_fp.h b/src/tpm2/PCR_fp.h index f1d853b23..90bf463b9 100644 --- a/src/tpm2/PCR_fp.h +++ b/src/tpm2/PCR_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Functions Needed for PCR Access and Manipulation */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -213,7 +155,7 @@ void PCRExtend(TPMI_DH_PCR handle, // IN: PCR handle to be extended // // As a side-effect, 'selection' is modified so that only the implemented PCR // will have their bits still set. -void PCRComputeCurrentDigest( +TPM_RC PCRComputeCurrentDigest( TPMI_ALG_HASH hashAlg, // IN: hash algorithm to compute digest TPML_PCR_SELECTION* selection, // IN/OUT: PCR selection (filtered on // output) @@ -224,11 +166,11 @@ void PCRComputeCurrentDigest( // This function is used to read a list of selected PCR. If the requested PCR // number exceeds the maximum number that can be output, the 'selection' is // adjusted to reflect the actual output PCR. -void PCRRead(TPML_PCR_SELECTION* selection, // IN/OUT: PCR selection (filtered on - // output) - TPML_DIGEST* digest, // OUT: digest - UINT32* pcrCounter // OUT: the current value of PCR generation - // number +TPM_RC PCRRead(TPML_PCR_SELECTION* selection, // IN/OUT: PCR selection (filtered on + // output) + TPML_DIGEST* digest, // OUT: digest + UINT32* pcrCounter // OUT: the current value of PCR generation + // number ); //*** PCRAllocate() diff --git a/src/tpm2/PolicyPCR.c b/src/tpm2/PolicyPCR.c new file mode 100644 index 000000000..e8292c405 --- /dev/null +++ b/src/tpm2/PolicyPCR.c @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" + +#if CC_PolicyPCR // Conditional expansion of this file + +# include "PolicyPCR_fp.h" +# include "Marshal.h" + +/*(See part 3 specification) +// Add a PCR gate for a policy session +*/ +// Return Type: TPM_RC +// TPM_RC_VALUE if provided, 'pcrDigest' does not match the +// current PCR settings +// TPM_RC_PCR_CHANGED a previous TPM2_PolicyPCR() set +// pcrCounter and it has changed +TPM_RC +TPM2_PolicyPCR(PolicyPCR_In* in // IN: input parameter list +) +{ + SESSION* session; + TPM2B_DIGEST pcrDigest; + BYTE pcrs[sizeof(TPML_PCR_SELECTION)]; + UINT32 pcrSize; + BYTE* buffer; + TPM_CC commandCode = TPM_CC_PolicyPCR; + HASH_STATE hashState; + + // Input Validation + + // Get pointer to the session structure + session = SessionGet(in->policySession); + pAssert_RC(session); + + // Compute current PCR digest + TPM_RC result = + PCRComputeCurrentDigest(session->authHashAlg, &in->pcrs, &pcrDigest); + if(result != TPM_RC_SUCCESS) + return result; + + // Do validation for non trial session + if(session->attributes.isTrialPolicy == CLEAR) + { + // Make sure that this is not going to invalidate a previous PCR check + if(session->pcrCounter != 0 && session->pcrCounter != gr.pcrCounter) + return TPM_RC_PCR_CHANGED; + + // If the caller specified the PCR digest and it does not + // match the current PCR settings, return an error.. + if(in->pcrDigest.t.size != 0) + { + if(!MemoryEqual2B(&in->pcrDigest.b, &pcrDigest.b)) + return TPM_RCS_VALUE + RC_PolicyPCR_pcrDigest; + } + } + else + { + // For trial session, just use the input PCR digest if one provided + // Note: It can't be too big because it is a TPM2B_DIGEST and the size + // would have been checked during unmarshaling + if(in->pcrDigest.t.size != 0) + pcrDigest = in->pcrDigest; + } + // Internal Data Update + // Update policy hash + // policyDigestnew = hash( policyDigestold || TPM_CC_PolicyPCR + // || PCRS || pcrDigest) + // Start hash + CryptHashStart(&hashState, session->authHashAlg); + + // add old digest + CryptDigestUpdate2B(&hashState, &session->u2.policyDigest.b); + + // add commandCode + CryptDigestUpdateInt(&hashState, sizeof(TPM_CC), commandCode); + + // add PCRS + buffer = pcrs; + pcrSize = TPML_PCR_SELECTION_Marshal(&in->pcrs, &buffer, NULL); + CryptDigestUpdate(&hashState, pcrSize, pcrs); + + // add PCR digest + CryptDigestUpdate2B(&hashState, &pcrDigest.b); + + // complete the hash and get the results + CryptHashEnd2B(&hashState, &session->u2.policyDigest.b); + + // update pcrCounter in session context for non trial session + if(session->attributes.isTrialPolicy == CLEAR) + { + session->pcrCounter = gr.pcrCounter; + } + + return TPM_RC_SUCCESS; +} + +#endif // CC_PolicyPCR diff --git a/src/tpm2/Quote.c b/src/tpm2/Quote.c new file mode 100644 index 000000000..6ffc1b75c --- /dev/null +++ b/src/tpm2/Quote.c @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "Attest_spt_fp.h" +#include "Quote_fp.h" + +#if CC_Quote // Conditional expansion of this file + +/*(See part 3 specification) +// quote PCR values +*/ +// Return Type: TPM_RC +// TPM_RC_KEY 'signHandle' does not reference a signing key; +// TPM_RC_SCHEME the scheme is not compatible with sign key type, +// or input scheme is not compatible with default +// scheme, or the chosen scheme is not a valid +// sign scheme +TPM_RC +TPM2_Quote(Quote_In* in, // IN: input parameter list + Quote_Out* out // OUT: output parameter list +) +{ + TPMI_ALG_HASH hashAlg; + TPMS_ATTEST quoted; + OBJECT* signObject = HandleToObject(in->signHandle); + // Input Validation + if(!IsSigningObject(signObject)) + return TPM_RCS_KEY + RC_Quote_signHandle; + if(!CryptSelectSignScheme(signObject, &in->inScheme)) + return TPM_RCS_SCHEME + RC_Quote_inScheme; + + // Command Output + + // Filling in attest information + // Common fields + // FillInAttestInfo may return TPM_RC_SCHEME or TPM_RC_KEY + FillInAttestInfo(in->signHandle, &in->inScheme, &in->qualifyingData, "ed); + + // Quote specific fields + // Attestation type + quoted.type = TPM_ST_ATTEST_QUOTE; + + // Get hash algorithm in sign scheme. This hash algorithm is used to + // compute PCR digest. If there is no algorithm, then the PCR cannot + // be digested and this command returns TPM_RC_SCHEME + hashAlg = in->inScheme.details.any.hashAlg; + + if(hashAlg == TPM_ALG_NULL) + return TPM_RCS_SCHEME + RC_Quote_inScheme; + + // Compute PCR digest + TPM_RC result = PCRComputeCurrentDigest( + hashAlg, &in->PCRselect, "ed.attested.quote.pcrDigest); + + if(result != TPM_RC_SUCCESS) + return result; + + // Copy PCR select. "PCRselect" is modified in PCRComputeCurrentDigest + // function + quoted.attested.quote.pcrSelect = in->PCRselect; + + // Sign attestation structure. A NULL signature will be returned if + // signObject is NULL. + + result = SignAttestInfo(signObject, + &in->inScheme, + "ed, + &in->qualifyingData, + &out->quoted, + &out->signature); + + return result; +} + +#endif // CC_Quote From 6c36f02e7aee18d065da542bc9ce3438c53bf812 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 10:11:38 -0400 Subject: [PATCH 26/52] Sync: Have PolicyContextUpdate return TPM_RC Split-out those TPM 2 command functions that need to be adapted due to the functions they call returning an error code. Split them out into their own files so they can be synchronized easier. Signed-off-by: Stefan Berger --- src/Makefile.am | 5 + src/tpm2/EACommands.c | 568 ----------------------------------- src/tpm2/PolicyAuthorize.c | 98 ++++++ src/tpm2/PolicyAuthorizeNV.c | 91 ++++++ src/tpm2/PolicySecret.c | 120 ++++++++ src/tpm2/PolicySigned.c | 164 ++++++++++ src/tpm2/PolicyTicket.c | 107 +++++++ src/tpm2/Policy_spt.c | 70 +---- src/tpm2/Policy_spt_fp.h | 63 +--- 9 files changed, 593 insertions(+), 693 deletions(-) create mode 100644 src/tpm2/PolicyAuthorize.c create mode 100644 src/tpm2/PolicyAuthorizeNV.c create mode 100644 src/tpm2/PolicySecret.c create mode 100644 src/tpm2/PolicySigned.c create mode 100644 src/tpm2/PolicyTicket.c diff --git a/src/Makefile.am b/src/Makefile.am index 88537280a..3bf0b5e77 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -258,7 +258,12 @@ libtpms_tpm2_la_SOURCES = \ tpm2/PlatformData.c \ tpm2/PlatformPcr.c \ tpm2/Policy_spt.c \ + tpm2/PolicyAuthorize.c \ + tpm2/PolicyAuthorizeNV.c \ tpm2/PolicyPCR.c \ + tpm2/PolicySecret.c \ + tpm2/PolicySigned.c \ + tpm2/PolicyTicket.c \ tpm2/PolicyTransportSPDM.c \ tpm2/Power.c \ tpm2/PowerPlat.c \ diff --git a/src/tpm2/EACommands.c b/src/tpm2/EACommands.c index 7c89a9acf..588a4c7f8 100644 --- a/src/tpm2/EACommands.c +++ b/src/tpm2/EACommands.c @@ -58,385 +58,6 @@ /* */ /********************************************************************************/ -#include "Tpm.h" -#include "Policy_spt_fp.h" -#include "PolicySigned_fp.h" -#include "RuntimeProfile_fp.h" - -#if CC_PolicySigned // Conditional expansion of this file - -/*(See part 3 specification) -// Include an asymmetrically signed authorization to the policy evaluation -*/ -// Return Type: TPM_RC -// TPM_RC_CPHASH cpHash was previously set to a different value -// TPM_RC_EXPIRED 'expiration' indicates a time in the past or -// 'expiration' is non-zero but no nonceTPM is present -// TPM_RC_NONCE 'nonceTPM' is not the nonce associated with the -// 'policySession' -// TPM_RC_SCHEME the signing scheme of 'auth' is not supported by the -// TPM -// TPM_RC_SIGNATURE the signature is not genuine -// TPM_RC_SIZE input cpHash has wrong size -TPM_RC -TPM2_PolicySigned(PolicySigned_In* in, // IN: input parameter list - PolicySigned_Out* out // OUT: output parameter list - ) -{ - TPM_RC result = TPM_RC_SUCCESS; - SESSION* session; - TPM2B_NAME entityName; - TPM2B_DIGEST authHash; - HASH_STATE hashState; - UINT64 authTimeout = 0; - // Input Validation - // Set up local pointers - session = SessionGet(in->policySession); // the session structure - pAssert_RC(session); - - // Only do input validation if this is not a trial policy session - if(session->attributes.isTrialPolicy == CLEAR) - { - authTimeout = ComputeAuthTimeout(session, in->expiration, &in->nonceTPM); - - result = PolicyParameterChecks(session, - authTimeout, - &in->cpHashA, - &in->nonceTPM, - RC_PolicySigned_nonceTPM, - RC_PolicySigned_cpHashA, - RC_PolicySigned_expiration); - if(result != TPM_RC_SUCCESS) - return result; - // Re-compute the digest being signed - /*(See part 3 specification) - // The digest is computed as: - // aHash := hash ( nonceTPM | expiration | cpHashA | policyRef) - // where: - // hash() the hash associated with the signed authorization - // nonceTPM the nonceTPM value from the TPM2_StartAuthSession . - // response If the authorization is not limited to this - // session, the size of this value is zero. - // expiration time limit on authorization set by authorizing object. - // This 32-bit value is set to zero if the expiration - // time is not being set. - // cpHashA hash of the command parameters for the command being - // approved using the hash algorithm of the PSAP session. - // Set to NULLauth if the authorization is not limited - // to a specific command. - // policyRef hash of an opaque value determined by the authorizing - // object. Set to the NULLdigest if no hash is present. - */ - // Start hash - authHash.t.size = CryptHashStart(&hashState, CryptGetSignHashAlg(&in->auth)); - // If there is no digest size, then we don't have a verification function - // for this algorithm (e.g. TPM_ALG_ECDAA) so indicate that it is a - // bad scheme. - if(authHash.t.size == 0) - return TPM_RCS_SCHEME + RC_PolicySigned_auth; - - // nonceTPM - CryptDigestUpdate2B(&hashState, &in->nonceTPM.b); - - // expiration - CryptDigestUpdateInt(&hashState, sizeof(UINT32), in->expiration); - - // cpHashA - CryptDigestUpdate2B(&hashState, &in->cpHashA.b); - - // policyRef - CryptDigestUpdate2B(&hashState, &in->policyRef.b); - - // Complete digest - CryptHashEnd2B(&hashState, &authHash.b); - - // Validate Signature. A TPM_RC_SCHEME, TPM_RC_HANDLE or TPM_RC_SIGNATURE - // error may be returned at this point - result = CryptValidateSignature(in->authObject, &authHash, &in->auth); - if(result != TPM_RC_SUCCESS) - return RcSafeAddToResult(result, RC_PolicySigned_auth); - } - // Internal Data Update - // Update policy with input policyRef and name of authorization key - // These values are updated even if the session is a trial session - PolicyContextUpdate(TPM_CC_PolicySigned, - EntityGetName(in->authObject, &entityName), - &in->policyRef, - &in->cpHashA, - authTimeout, - session); - // Command Output - // Create ticket and timeout buffer if in->expiration < 0 and this is not - // a trial session. - // NOTE: PolicyParameterChecks() makes sure that nonceTPM is present - // when expiration is non-zero. - if(in->expiration < 0 && session->attributes.isTrialPolicy == CLEAR) - { - BOOL expiresOnReset = (in->nonceTPM.t.size == 0); - // Compute policy ticket - authTimeout &= ~EXPIRATION_BIT; - - result = TicketComputeAuth(TPM_ST_AUTH_SIGNED, - EntityGetHierarchy(in->authObject), - authTimeout, - expiresOnReset, - &in->cpHashA, - &in->policyRef, - &entityName, - &out->policyTicket); - if(result != TPM_RC_SUCCESS) - return result; - - // Generate timeout buffer. The format of output timeout buffer is - // TPM-specific. - // Note: In this implementation, the timeout buffer value is computed after - // the ticket is produced so, when the ticket is checked, the expiration - // flag needs to be extracted before the ticket is checked. - // In the Windows compatible version, the least-significant bit of the - // timeout value is used as a flag to indicate if the authorization expires - // on reset. The flag is the MSb. - out->timeout.t.size = sizeof(authTimeout); - if(expiresOnReset) - authTimeout |= EXPIRATION_BIT; - UINT64_TO_BYTE_ARRAY(authTimeout, out->timeout.t.buffer); - } - else - { - // Generate a null ticket. - // timeout buffer is null - out->timeout.t.size = 0; - - // authorization ticket is null - out->policyTicket.tag = TPM_ST_AUTH_SIGNED; - out->policyTicket.hierarchy = TPM_RH_NULL; - out->policyTicket.digest.t.size = 0; - } - return TPM_RC_SUCCESS; -} - -#endif // CC_PolicySigned - - -#include "Tpm.h" -#include "PolicySecret_fp.h" - -#if CC_PolicySecret // Conditional expansion of this file - -# include "Policy_spt_fp.h" -# include "NV_spt_fp.h" - -/*(See part 3 specification) -// Add a secret-based authorization to the policy evaluation -*/ -// Return Type: TPM_RC -// TPM_RC_CPHASH cpHash for policy was previously set to a -// value that is not the same as 'cpHashA' -// TPM_RC_EXPIRED 'expiration' indicates a time in the past -// TPM_RC_NONCE 'nonceTPM' does not match the nonce associated -// with 'policySession' -// TPM_RC_SIZE 'cpHashA' is not the size of a digest for the -// hash associated with 'policySession' -TPM_RC -TPM2_PolicySecret(PolicySecret_In* in, // IN: input parameter list - PolicySecret_Out* out // OUT: output parameter list - ) -{ - TPM_RC result; - SESSION* session; - TPM2B_NAME entityName; - UINT64 authTimeout = 0; - -# if CC_ReadOnlyControl - // Don't allow on PIN PASS or PIN FAIL indices when in Read-Only mode - if(gc.readOnly && NvIsPinCountedIndex(in->authHandle)) - return TPM_RC_READ_ONLY; -# endif // CC_ReadOnlyControl - - // Input Validation - // Get pointer to the session structure - session = SessionGet(in->policySession); - pAssert_RC(session); - - //Only do input validation if this is not a trial policy session - if(session->attributes.isTrialPolicy == CLEAR) - { - authTimeout = ComputeAuthTimeout(session, in->expiration, &in->nonceTPM); - - result = PolicyParameterChecks(session, - authTimeout, - &in->cpHashA, - &in->nonceTPM, - RC_PolicySecret_nonceTPM, - RC_PolicySecret_cpHashA, - RC_PolicySecret_expiration); - if(result != TPM_RC_SUCCESS) - return result; - } - // Internal Data Update - // Update policy context with input policyRef and name of authorizing key - // This value is computed even for trial sessions. Possibly update the cpHash - PolicyContextUpdate(TPM_CC_PolicySecret, - EntityGetName(in->authHandle, &entityName), - &in->policyRef, - &in->cpHashA, - authTimeout, - session); - // Command Output - // Create ticket and timeout buffer if in->expiration < 0 and this is not - // a trial session. - // NOTE: PolicyParameterChecks() makes sure that nonceTPM is present - // when expiration is non-zero. - if(in->expiration < 0 && session->attributes.isTrialPolicy == CLEAR - && !NvIsPinPassIndex(in->authHandle)) - { - BOOL expiresOnReset = (in->nonceTPM.t.size == 0); - // Compute policy ticket - authTimeout &= ~EXPIRATION_BIT; - result = TicketComputeAuth(TPM_ST_AUTH_SECRET, - EntityGetHierarchy(in->authHandle), - authTimeout, - expiresOnReset, - &in->cpHashA, - &in->policyRef, - &entityName, - &out->policyTicket); - if(result != TPM_RC_SUCCESS) - return result; - - // Generate timeout buffer. The format of output timeout buffer is - // TPM-specific. - // Note: In this implementation, the timeout buffer value is computed after - // the ticket is produced so, when the ticket is checked, the expiration - // flag needs to be extracted before the ticket is checked. - out->timeout.t.size = sizeof(authTimeout); - // In the Windows compatible version, the least-significant bit of the - // timeout value is used as a flag to indicate if the authorization expires - // on reset. The flag is the MSb. - if(expiresOnReset) - authTimeout |= EXPIRATION_BIT; - UINT64_TO_BYTE_ARRAY(authTimeout, out->timeout.t.buffer); - } - else - { - // timeout buffer is null - out->timeout.t.size = 0; - - // authorization ticket is null - out->policyTicket.tag = TPM_ST_AUTH_SECRET; - out->policyTicket.hierarchy = TPM_RH_NULL; - out->policyTicket.digest.t.size = 0; - } - return TPM_RC_SUCCESS; -} - -#endif // CC_PolicySecret - -#include "Tpm.h" -#include "PolicyTicket_fp.h" - -#if CC_PolicyTicket // Conditional expansion of this file - -# include "Policy_spt_fp.h" - -/*(See part 3 specification) -// Include ticket to the policy evaluation -*/ -// Return Type: TPM_RC -// TPM_RC_CPHASH policy's cpHash was previously set to a different -// value -// TPM_RC_EXPIRED 'timeout' value in the ticket is in the past and the -// ticket has expired -// TPM_RC_SIZE 'timeout' or 'cpHash' has invalid size for the -// TPM_RC_TICKET 'ticket' is not valid -TPM_RC -TPM2_PolicyTicket(PolicyTicket_In* in // IN: input parameter list - ) -{ - TPM_RC result; - SESSION* session; - UINT64 authTimeout; - TPMT_TK_AUTH ticketToCompare; - TPM_CC commandCode = TPM_CC_PolicySecret; - BOOL expiresOnReset; - // Input Validation - - // Get pointer to the session structure - session = SessionGet(in->policySession); - pAssert_RC(session); - - // NOTE: A trial policy session is not allowed to use this command. - // A ticket is used in place of a previously given authorization. Since - // a trial policy doesn't actually authenticate, the validated - // ticket is not necessary and, in place of using a ticket, one - // should use the intended authorization for which the ticket - // would be a substitute. - if(session->attributes.isTrialPolicy) - return TPM_RCS_ATTRIBUTES + RC_PolicyTicket_policySession; - // Restore timeout data. The format of timeout buffer is TPM-specific. - // In this implementation, the most significant bit of the timeout value is - // used as the flag to indicate that the ticket expires on TPM Reset or - // TPM Restart. The flag has to be removed before the parameters and ticket - // are checked. - if(in->timeout.t.size != sizeof(UINT64)) - return TPM_RCS_SIZE + RC_PolicyTicket_timeout; - authTimeout = BYTE_ARRAY_TO_UINT64(in->timeout.t.buffer); - - // extract the flag - expiresOnReset = (authTimeout & EXPIRATION_BIT) != 0; - authTimeout &= ~EXPIRATION_BIT; - - // Do the normal checks on the cpHashA and timeout values - result = PolicyParameterChecks(session, - authTimeout, - &in->cpHashA, - NULL, // no nonce - 0, // no bad nonce return - RC_PolicyTicket_cpHashA, - RC_PolicyTicket_timeout); - if(result != TPM_RC_SUCCESS) - return result; - // Validate Ticket - // Re-generate policy ticket by input parameters - result = TicketComputeAuth(in->ticket.tag, - in->ticket.hierarchy, - authTimeout, - expiresOnReset, - &in->cpHashA, - &in->policyRef, - &in->authName, - &ticketToCompare); - if(result != TPM_RC_SUCCESS) - return result; - - // Compare generated digest with input ticket digest - if(!MemoryEqual2B(&in->ticket.digest.b, &ticketToCompare.digest.b)) - return TPM_RCS_TICKET + RC_PolicyTicket_ticket; - - // Internal Data Update - - // Is this ticket to take the place of a TPM2_PolicySigned() or - // a TPM2_PolicySecret()? - if(in->ticket.tag == TPM_ST_AUTH_SIGNED) - commandCode = TPM_CC_PolicySigned; - else if(in->ticket.tag == TPM_ST_AUTH_SECRET) - commandCode = TPM_CC_PolicySecret; - else - // There could only be two possible tag values. Any other value should - // be caught by the ticket validation process. - FAIL(FATAL_ERROR_INTERNAL); - - // Update policy context - PolicyContextUpdate(commandCode, - &in->authName, - &in->policyRef, - &in->cpHashA, - authTimeout, - session); - - return TPM_RC_SUCCESS; -} - -#endif // CC_PolicyTicket #include "Tpm.h" #include "PolicyOR_fp.h" @@ -1138,105 +759,6 @@ TPM2_PolicyDuplicationSelect( #endif // CC_PolicyDuplicationSelect -#include "Tpm.h" -#include "PolicyAuthorize_fp.h" - -#if CC_PolicyAuthorize // Conditional expansion of this file - -# include "Policy_spt_fp.h" - -/*(See part 3 specification) -// Change policy by a signature from authority -*/ -// Return Type: TPM_RC -// TPM_RC_HASH hash algorithm in 'keyName' is not supported -// TPM_RC_SIZE 'keyName' is not the correct size for its hash algorithm -// TPM_RC_VALUE the current policyDigest of 'policySession' does not -// match 'approvedPolicy'; or 'checkTicket' doesn't match -// the provided values -TPM_RC -TPM2_PolicyAuthorize(PolicyAuthorize_In* in // IN: input parameter list - ) -{ - TPM_RC result = TPM_RC_SUCCESS; - SESSION* session; - TPM2B_DIGEST authHash; - HASH_STATE hashState; - TPMT_TK_VERIFIED ticket; - TPM_ALG_ID hashAlg; - UINT16 digestSize; - // Input Validation - - // Get pointer to the session structure - session = SessionGet(in->policySession); - pAssert_RC(session); - - if(in->keySign.t.size < 2) - { - return TPM_RCS_SIZE + RC_PolicyAuthorize_keySign; - } - - // Extract from the Name of the key, the algorithm used to compute its Name - hashAlg = BYTE_ARRAY_TO_UINT16(in->keySign.t.name); - - // 'keySign' parameter needs to use a supported hash algorithm, otherwise - // can't tell how large the digest should be - if(!CryptHashIsValidAlg(hashAlg, FALSE)) - return TPM_RCS_HASH + RC_PolicyAuthorize_keySign; - - digestSize = CryptHashGetDigestSize(hashAlg); - if(digestSize != (in->keySign.t.size - 2)) - return TPM_RCS_SIZE + RC_PolicyAuthorize_keySign; - - //If this is a trial policy, skip all validations - if(session->attributes.isTrialPolicy == CLEAR) - { - // Check that "approvedPolicy" matches the current value of the - // policyDigest in policy session - if(!MemoryEqual2B(&session->u2.policyDigest.b, &in->approvedPolicy.b)) - return TPM_RCS_VALUE + RC_PolicyAuthorize_approvedPolicy; - - // Validate ticket TPMT_TK_VERIFIED - // Compute aHash. The authorizing object sign a digest - // aHash := hash(approvedPolicy || policyRef). - // Start hash - authHash.t.size = CryptHashStart(&hashState, hashAlg); - - // add approvedPolicy - CryptDigestUpdate2B(&hashState, &in->approvedPolicy.b); - - // add policyRef - CryptDigestUpdate2B(&hashState, &in->policyRef.b); - - // complete hash - CryptHashEnd2B(&hashState, &authHash.b); - - // re-compute TPMT_TK_VERIFIED - result = TicketComputeVerified(in->checkTicket.hierarchy, &authHash, - &in->keySign, &ticket); - if(result != TPM_RC_SUCCESS) - return result; - - // Compare ticket digest. If not match, return error - if(!MemoryEqual2B(&in->checkTicket.digest.b, &ticket.digest.b)) - return TPM_RCS_VALUE + RC_PolicyAuthorize_checkTicket; - } - - // Internal Data Update - - // Set policyDigest to zero digest - PolicyDigestClear(session); - - // Update policyDigest - PolicyContextUpdate( - TPM_CC_PolicyAuthorize, &in->keySign, &in->policyRef, NULL, 0, session); - - return TPM_RC_SUCCESS; -} - -#endif // CC_PolicyAuthorize - - #include "Tpm.h" #include "PolicyAuthValue_fp.h" @@ -1479,96 +1001,6 @@ TPM2_PolicyTemplate(PolicyTemplate_In* in // IN: input parameter list #endif // CC_PolicyTemplate -#include "Tpm.h" - -#if CC_PolicyAuthorizeNV // Conditional expansion of this file - -# include "PolicyAuthorizeNV_fp.h" -# include "Policy_spt_fp.h" -# include "Marshal.h" - -/*(See part 3 specification) -// Change policy by a signature from authority -*/ -// Return Type: TPM_RC -// TPM_RC_HASH hash algorithm in 'keyName' is not supported or is not -// the same as the hash algorithm of the policy session -// TPM_RC_SIZE 'keyName' is not the correct size for its hash algorithm -// TPM_RC_VALUE the current policyDigest of 'policySession' does not -// match 'approvedPolicy'; or 'checkTicket' doesn't match -// the provided values -TPM_RC -TPM2_PolicyAuthorizeNV(PolicyAuthorizeNV_In* in) -{ - SESSION* session; - TPM_RC result; - NV_REF locator; - NV_INDEX* nvIndex = NvGetIndexInfo(in->nvIndex, &locator); - TPM2B_NAME name; - TPMT_HA policyInNv = { - .hashAlg = 0, // libpms added: Coverity - }; - BYTE nvTemp[sizeof(TPMT_HA)]; - BYTE* buffer = nvTemp; - INT32 size; - // Input Validation - // Get pointer to the session structure - session = SessionGet(in->policySession); - pAssert_RC(session); - - // Skip checks if this is a trial policy - if(!session->attributes.isTrialPolicy) - { - // Check the authorizations for reading - // Common read access checks. NvReadAccessChecks() returns - // TPM_RC_NV_AUTHORIZATION, TPM_RC_NV_LOCKED, or TPM_RC_NV_UNINITIALIZED - // error may be returned at this point - result = NvReadAccessChecks( - in->authHandle, in->nvIndex, nvIndex->publicArea.attributes); - if(result != TPM_RC_SUCCESS) - return result; - - // Read the contents of the index into a temp buffer - size = MIN(nvIndex->publicArea.dataSize, sizeof(TPMT_HA)); - NvGetIndexData(nvIndex, locator, 0, (UINT16)size, nvTemp); - - // Unmarshal the contents of the buffer into the internal format of a - // TPMT_HA so that the hash and digest elements can be accessed from the - // structure rather than the byte array that is in the Index (written by - // user of the Index). - result = TPMT_HA_Unmarshal(&policyInNv, &buffer, &size, FALSE); - if(result != TPM_RC_SUCCESS) - return result; - - // Verify that the hash is the same - if(policyInNv.hashAlg != session->authHashAlg) - return TPM_RC_HASH; - - // See if the contents of the digest in the Index matches the value - // in the policy - if(!MemoryEqual(&policyInNv.digest, - &session->u2.policyDigest.t.buffer, - session->u2.policyDigest.t.size)) - return TPM_RC_VALUE; - } - - // Internal Data Update - - // Set policyDigest to zero digest - PolicyDigestClear(session); - - // Update policyDigest - PolicyContextUpdate(TPM_CC_PolicyAuthorizeNV, - EntityGetName(in->nvIndex, &name), - NULL, - NULL, - 0, - session); - - return TPM_RC_SUCCESS; -} - -#endif // CC_PolicyAuthorizeNV #include "Tpm.h" #include "PolicyCapability_fp.h" diff --git a/src/tpm2/PolicyAuthorize.c b/src/tpm2/PolicyAuthorize.c new file mode 100644 index 000000000..4a18c71ff --- /dev/null +++ b/src/tpm2/PolicyAuthorize.c @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "PolicyAuthorize_fp.h" + +#if CC_PolicyAuthorize // Conditional expansion of this file + +# include "Policy_spt_fp.h" + +/*(See part 3 specification) +// Change policy by a signature from authority +*/ +// Return Type: TPM_RC +// TPM_RC_HASH hash algorithm in 'keyName' is not supported +// TPM_RC_SIZE 'keyName' is not the correct size for its hash algorithm +// TPM_RC_VALUE the current policyDigest of 'policySession' does not +// match 'approvedPolicy'; or 'checkTicket' doesn't match +// the provided values +TPM_RC +TPM2_PolicyAuthorize(PolicyAuthorize_In* in // IN: input parameter list +) +{ + TPM_RC result = TPM_RC_SUCCESS; + SESSION* session; + TPM2B_DIGEST authHash; + HASH_STATE hashState; + TPMT_TK_VERIFIED ticket; + TPM_ALG_ID hashAlg; + UINT16 digestSize; + + // Input Validation + + // Get pointer to the session structure + session = SessionGet(in->policySession); + pAssert_RC(session); + + if(in->keySign.t.size < 2) + { + return TPM_RCS_SIZE + RC_PolicyAuthorize_keySign; + } + + // Extract from the Name of the key, the algorithm used to compute its Name + hashAlg = BYTE_ARRAY_TO_UINT16(in->keySign.t.name); + + // 'keySign' parameter needs to use a supported hash algorithm, otherwise + // can't tell how large the digest should be + if(!CryptHashIsValidAlg(hashAlg, FALSE)) + return TPM_RCS_HASH + RC_PolicyAuthorize_keySign; + + digestSize = CryptHashGetDigestSize(hashAlg); + if(digestSize != (in->keySign.t.size - 2)) + return TPM_RCS_SIZE + RC_PolicyAuthorize_keySign; + + //If this is a trial policy, skip all validations + if(session->attributes.isTrialPolicy == CLEAR) + { + // Check that "approvedPolicy" matches the current value of the + // policyDigest in policy session + if(!MemoryEqual2B(&session->u2.policyDigest.b, &in->approvedPolicy.b)) + return TPM_RCS_VALUE + RC_PolicyAuthorize_approvedPolicy; + + // Validate ticket TPMT_TK_VERIFIED + // Compute aHash. The authorizing object sign a digest + // aHash := hash(approvedPolicy || policyRef). + // Start hash + authHash.t.size = CryptHashStart(&hashState, hashAlg); + + // add approvedPolicy + CryptDigestUpdate2B(&hashState, &in->approvedPolicy.b); + + // add policyRef + CryptDigestUpdate2B(&hashState, &in->policyRef.b); + + // complete hash + CryptHashEnd2B(&hashState, &authHash.b); + + // re-compute TPMT_TK_VERIFIED + result = TicketComputeVerified( + in->checkTicket.hierarchy, &authHash, &in->keySign, &ticket); + if(result != TPM_RC_SUCCESS) + return result; + + // Compare ticket digest. If not match, return error + if(!MemoryEqual2B(&in->checkTicket.digest.b, &ticket.digest.b)) + return TPM_RCS_VALUE + RC_PolicyAuthorize_checkTicket; + } + + // Internal Data Update + + // Set policyDigest to zero digest + PolicyDigestClear(session); + + // Update policyDigest + return PolicyContextUpdate( + TPM_CC_PolicyAuthorize, &in->keySign, &in->policyRef, NULL, 0, session); +} + +#endif // CC_PolicyAuthorize diff --git a/src/tpm2/PolicyAuthorizeNV.c b/src/tpm2/PolicyAuthorizeNV.c new file mode 100644 index 000000000..c4b8236f6 --- /dev/null +++ b/src/tpm2/PolicyAuthorizeNV.c @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" + +#if CC_PolicyAuthorizeNV // Conditional expansion of this file + +# include "PolicyAuthorizeNV_fp.h" +# include "Policy_spt_fp.h" +# include "Marshal.h" + +/*(See part 3 specification) +// Change policy by a signature from authority +*/ +// Return Type: TPM_RC +// TPM_RC_HASH hash algorithm in 'keyName' is not supported or is not +// the same as the hash algorithm of the policy session +// TPM_RC_SIZE 'keyName' is not the correct size for its hash algorithm +// TPM_RC_VALUE the current policyDigest of 'policySession' does not +// match 'approvedPolicy'; or 'checkTicket' doesn't match +// the provided values +TPM_RC +TPM2_PolicyAuthorizeNV(PolicyAuthorizeNV_In* in) +{ + SESSION* session; + TPM_RC result; + NV_REF locator; + NV_INDEX* nvIndex = NvGetIndexInfo(in->nvIndex, &locator); + TPM2B_NAME name; + TPMT_HA policyInNv = { + .hashAlg = 0, // libpms added: Coverity + }; + BYTE nvTemp[sizeof(TPMT_HA)]; + BYTE* buffer = nvTemp; + INT32 size; + + // Input Validation + // Get pointer to the session structure + session = SessionGet(in->policySession); + pAssert_RC(session); + + // Skip checks if this is a trial policy + if(!session->attributes.isTrialPolicy) + { + // Check the authorizations for reading + // Common read access checks. NvReadAccessChecks() returns + // TPM_RC_NV_AUTHORIZATION, TPM_RC_NV_LOCKED, or TPM_RC_NV_UNINITIALIZED + // error may be returned at this point + result = NvReadAccessChecks( + in->authHandle, in->nvIndex, nvIndex->publicArea.attributes); + if(result != TPM_RC_SUCCESS) + return result; + + // Read the contents of the index into a temp buffer + size = MIN(nvIndex->publicArea.dataSize, sizeof(TPMT_HA)); + NvGetIndexData(nvIndex, locator, 0, (UINT16)size, nvTemp); + + // Unmarshal the contents of the buffer into the internal format of a + // TPMT_HA so that the hash and digest elements can be accessed from the + // structure rather than the byte array that is in the Index (written by + // user of the Index). + result = TPMT_HA_Unmarshal(&policyInNv, &buffer, &size, FALSE); + if(result != TPM_RC_SUCCESS) + return result; + + // Verify that the hash is the same + if(policyInNv.hashAlg != session->authHashAlg) + return TPM_RC_HASH; + + // See if the contents of the digest in the Index matches the value + // in the policy + if(!MemoryEqual(&policyInNv.digest, + &session->u2.policyDigest.t.buffer, + session->u2.policyDigest.t.size)) + return TPM_RC_VALUE; + } + + // Internal Data Update + + // Set policyDigest to zero digest + PolicyDigestClear(session); + + // Update policyDigest + return PolicyContextUpdate(TPM_CC_PolicyAuthorizeNV, + EntityGetName(in->nvIndex, &name), + NULL, + NULL, + 0, + session); +} + +#endif // CC_PolicyAuthorize diff --git a/src/tpm2/PolicySecret.c b/src/tpm2/PolicySecret.c new file mode 100644 index 000000000..6ef0fb64c --- /dev/null +++ b/src/tpm2/PolicySecret.c @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "PolicySecret_fp.h" + +#if CC_PolicySecret // Conditional expansion of this file + +# include "Policy_spt_fp.h" +# include "NV_spt_fp.h" + +/*(See part 3 specification) +// Add a secret-based authorization to the policy evaluation +*/ +// Return Type: TPM_RC +// TPM_RC_CPHASH cpHash for policy was previously set to a +// value that is not the same as 'cpHashA' +// TPM_RC_EXPIRED 'expiration' indicates a time in the past +// TPM_RC_NONCE 'nonceTPM' does not match the nonce associated +// with 'policySession' +// TPM_RC_SIZE 'cpHashA' is not the size of a digest for the +// hash associated with 'policySession' +TPM_RC +TPM2_PolicySecret(PolicySecret_In* in, // IN: input parameter list + PolicySecret_Out* out // OUT: output parameter list +) +{ + TPM_RC result; + SESSION* session; + TPM2B_NAME entityName; + UINT64 authTimeout = 0; + // Input Validation + +# if CC_ReadOnlyControl + // Don't allow on PIN PASS or PIN FAIL indices when in Read-Only mode + if(gc.readOnly && NvIsPinCountedIndex(in->authHandle)) + return TPM_RC_READ_ONLY; +# endif // CC_ReadOnlyControl + + // Get pointer to the session structure + session = SessionGet(in->policySession); + pAssert_RC(session); + + //Only do input validation if this is not a trial policy session + if(session->attributes.isTrialPolicy == CLEAR) + { + authTimeout = ComputeAuthTimeout(session, in->expiration, &in->nonceTPM); + + result = PolicyParameterChecks(session, + authTimeout, + &in->cpHashA, + &in->nonceTPM, + RC_PolicySecret_nonceTPM, + RC_PolicySecret_cpHashA, + RC_PolicySecret_expiration); + if(result != TPM_RC_SUCCESS) + return result; + } + // Internal Data Update + // Update policy context with input policyRef and name of authorizing key + // This value is computed even for trial sessions. Possibly update the cpHash + result = PolicyContextUpdate(TPM_CC_PolicySecret, + EntityGetName(in->authHandle, &entityName), + &in->policyRef, + &in->cpHashA, + authTimeout, + session); + if(result != TPM_RC_SUCCESS) + { + return result; + } + + // Command Output + // Create ticket and timeout buffer if in->expiration < 0 and this is not + // a trial session. + // NOTE: PolicyParameterChecks() makes sure that nonceTPM is present + // when expiration is non-zero. + if(in->expiration < 0 && session->attributes.isTrialPolicy == CLEAR + && !NvIsPinPassIndex(in->authHandle)) + { + BOOL expiresOnReset = (in->nonceTPM.t.size == 0); + // Compute policy ticket + authTimeout &= ~EXPIRATION_BIT; + result = TicketComputeAuth(TPM_ST_AUTH_SECRET, + EntityGetHierarchy(in->authHandle), + authTimeout, + expiresOnReset, + &in->cpHashA, + &in->policyRef, + &entityName, + &out->policyTicket); + if(result != TPM_RC_SUCCESS) + return result; + + // Generate timeout buffer. The format of output timeout buffer is + // TPM-specific. + // Note: In this implementation, the timeout buffer value is computed after + // the ticket is produced so, when the ticket is checked, the expiration + // flag needs to be extracted before the ticket is checked. + out->timeout.t.size = sizeof(authTimeout); + // In the Windows compatible version, the least-significant bit of the + // timeout value is used as a flag to indicate if the authorization expires + // on reset. The flag is the MSb. + if(expiresOnReset) + authTimeout |= EXPIRATION_BIT; + UINT64_TO_BYTE_ARRAY(authTimeout, out->timeout.t.buffer); + } + else + { + // timeout buffer is null + out->timeout.t.size = 0; + + // authorization ticket is null + out->policyTicket.tag = TPM_ST_AUTH_SECRET; + out->policyTicket.hierarchy = TPM_RH_NULL; + out->policyTicket.digest.t.size = 0; + } + return result; +} + +#endif // CC_PolicySecret diff --git a/src/tpm2/PolicySigned.c b/src/tpm2/PolicySigned.c new file mode 100644 index 000000000..37a1f1950 --- /dev/null +++ b/src/tpm2/PolicySigned.c @@ -0,0 +1,164 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "Policy_spt_fp.h" +#include "PolicySigned_fp.h" + +#if CC_PolicySigned // Conditional expansion of this file + +/*(See part 3 specification) +// Include an asymmetrically signed authorization to the policy evaluation +*/ +// Return Type: TPM_RC +// TPM_RC_CPHASH cpHash was previously set to a different value +// TPM_RC_EXPIRED 'expiration' indicates a time in the past or +// 'expiration' is non-zero but no nonceTPM is present +// TPM_RC_NONCE 'nonceTPM' is not the nonce associated with the +// 'policySession' +// TPM_RC_SCHEME the signing scheme of 'auth' is not supported by the +// TPM +// TPM_RC_SIGNATURE the signature is not genuine +// TPM_RC_SIZE input cpHash has wrong size +TPM_RC +TPM2_PolicySigned(PolicySigned_In* in, // IN: input parameter list + PolicySigned_Out* out // OUT: output parameter list +) +{ + TPM_RC result = TPM_RC_SUCCESS; + SESSION* session; + TPM2B_NAME entityName; + TPM2B_DIGEST authHash; + HASH_STATE hashState; + UINT64 authTimeout = 0; + // Input Validation + // Set up local pointers + session = SessionGet(in->policySession); // the session structure + pAssert_RC(session); + + // Only do input validation if this is not a trial policy session + if(session->attributes.isTrialPolicy == CLEAR) + { + authTimeout = ComputeAuthTimeout(session, in->expiration, &in->nonceTPM); + + result = PolicyParameterChecks(session, + authTimeout, + &in->cpHashA, + &in->nonceTPM, + RC_PolicySigned_nonceTPM, + RC_PolicySigned_cpHashA, + RC_PolicySigned_expiration); + if(result != TPM_RC_SUCCESS) + return result; + // Re-compute the digest being signed + /*(See part 3 specification) + // The digest is computed as: + // aHash := hash ( nonceTPM | expiration | cpHashA | policyRef) + // where: + // hash() the hash associated with the signed authorization + // nonceTPM the nonceTPM value from the TPM2_StartAuthSession . + // response If the authorization is not limited to this + // session, the size of this value is zero. + // expiration time limit on authorization set by authorizing object. + // This 32-bit value is set to zero if the expiration + // time is not being set. + // cpHashA hash of the command parameters for the command being + // approved using the hash algorithm of the PSAP session. + // Set to NULLauth if the authorization is not limited + // to a specific command. + // policyRef hash of an opaque value determined by the authorizing + // object. Set to the NULLdigest if no hash is present. + */ + // Start hash + authHash.t.size = CryptHashStart(&hashState, CryptGetSignHashAlg(&in->auth)); + // If there is no digest size, then we don't have a verification function + // for this algorithm (e.g. TPM_ALG_ECDAA) so indicate that it is a + // bad scheme. + if(authHash.t.size == 0) + return TPM_RCS_SCHEME + RC_PolicySigned_auth; + + // nonceTPM + CryptDigestUpdate2B(&hashState, &in->nonceTPM.b); + + // expiration + CryptDigestUpdateInt(&hashState, sizeof(UINT32), in->expiration); + + // cpHashA + CryptDigestUpdate2B(&hashState, &in->cpHashA.b); + + // policyRef + CryptDigestUpdate2B(&hashState, &in->policyRef.b); + + // Complete digest + CryptHashEnd2B(&hashState, &authHash.b); + + // Validate Signature. A TPM_RC_SCHEME, TPM_RC_HANDLE or TPM_RC_SIGNATURE + // error may be returned at this point + result = CryptValidateSignature(in->authObject, &authHash, &in->auth); + if(result != TPM_RC_SUCCESS) + return RcSafeAddToResult(result, RC_PolicySigned_auth); + } + // Internal Data Update + // Update policy with input policyRef and name of authorization key + // These values are updated even if the session is a trial session + result = PolicyContextUpdate(TPM_CC_PolicySigned, + EntityGetName(in->authObject, &entityName), + &in->policyRef, + &in->cpHashA, + authTimeout, + session); + + if(result != TPM_RC_SUCCESS) + { + return result; + } + + // Command Output + // Create ticket and timeout buffer if in->expiration < 0 and this is not + // a trial session. + // NOTE: PolicyParameterChecks() makes sure that nonceTPM is present + // when expiration is non-zero. + if(in->expiration < 0 && session->attributes.isTrialPolicy == CLEAR) + { + BOOL expiresOnReset = (in->nonceTPM.t.size == 0); + // Compute policy ticket + authTimeout &= ~EXPIRATION_BIT; + + result = TicketComputeAuth(TPM_ST_AUTH_SIGNED, + EntityGetHierarchy(in->authObject), + authTimeout, + expiresOnReset, + &in->cpHashA, + &in->policyRef, + &entityName, + &out->policyTicket); + if(result != TPM_RC_SUCCESS) + return result; + + // Generate timeout buffer. The format of output timeout buffer is + // TPM-specific. + // Note: In this implementation, the timeout buffer value is computed after + // the ticket is produced so, when the ticket is checked, the expiration + // flag needs to be extracted before the ticket is checked. + // In the Windows compatible version, the least-significant bit of the + // timeout value is used as a flag to indicate if the authorization expires + // on reset. The flag is the MSb. + out->timeout.t.size = sizeof(authTimeout); + if(expiresOnReset) + authTimeout |= EXPIRATION_BIT; + UINT64_TO_BYTE_ARRAY(authTimeout, out->timeout.t.buffer); + } + else + { + // Generate a null ticket. + // timeout buffer is null + out->timeout.t.size = 0; + + // authorization ticket is null + out->policyTicket.tag = TPM_ST_AUTH_SIGNED; + out->policyTicket.hierarchy = TPM_RH_NULL; + out->policyTicket.digest.t.size = 0; + } + return result; +} + +#endif // CC_PolicySigned diff --git a/src/tpm2/PolicyTicket.c b/src/tpm2/PolicyTicket.c new file mode 100644 index 000000000..c2ad3b731 --- /dev/null +++ b/src/tpm2/PolicyTicket.c @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "PolicyTicket_fp.h" + +#if CC_PolicyTicket // Conditional expansion of this file + +# include "Policy_spt_fp.h" + +/*(See part 3 specification) +// Include ticket to the policy evaluation +*/ +// Return Type: TPM_RC +// TPM_RC_CPHASH policy's cpHash was previously set to a different +// value +// TPM_RC_EXPIRED 'timeout' value in the ticket is in the past and the +// ticket has expired +// TPM_RC_SIZE 'timeout' or 'cpHash' has invalid size for the +// TPM_RC_TICKET 'ticket' is not valid +TPM_RC +TPM2_PolicyTicket(PolicyTicket_In* in // IN: input parameter list +) +{ + TPM_RC result; + SESSION* session; + UINT64 authTimeout; + TPMT_TK_AUTH ticketToCompare; + TPM_CC commandCode = TPM_CC_PolicySecret; + BOOL expiresOnReset; + + // Input Validation + + // Get pointer to the session structure + session = SessionGet(in->policySession); + pAssert_RC(session); + + // NOTE: A trial policy session is not allowed to use this command. + // A ticket is used in place of a previously given authorization. Since + // a trial policy doesn't actually authenticate, the validated + // ticket is not necessary and, in place of using a ticket, one + // should use the intended authorization for which the ticket + // would be a substitute. + if(session->attributes.isTrialPolicy) + return TPM_RCS_ATTRIBUTES + RC_PolicyTicket_policySession; + // Restore timeout data. The format of timeout buffer is TPM-specific. + // In this implementation, the most significant bit of the timeout value is + // used as the flag to indicate that the ticket expires on TPM Reset or + // TPM Restart. The flag has to be removed before the parameters and ticket + // are checked. + if(in->timeout.t.size != sizeof(UINT64)) + return TPM_RCS_SIZE + RC_PolicyTicket_timeout; + authTimeout = BYTE_ARRAY_TO_UINT64(in->timeout.t.buffer); + + // extract the flag + expiresOnReset = (authTimeout & EXPIRATION_BIT) != 0; + authTimeout &= ~EXPIRATION_BIT; + + // Do the normal checks on the cpHashA and timeout values + result = PolicyParameterChecks(session, + authTimeout, + &in->cpHashA, + NULL, // no nonce + 0, // no bad nonce return + RC_PolicyTicket_cpHashA, + RC_PolicyTicket_timeout); + if(result != TPM_RC_SUCCESS) + return result; + // Validate Ticket + // Re-generate policy ticket by input parameters + result = TicketComputeAuth(in->ticket.tag, + in->ticket.hierarchy, + authTimeout, + expiresOnReset, + &in->cpHashA, + &in->policyRef, + &in->authName, + &ticketToCompare); + if(result != TPM_RC_SUCCESS) + return result; + + // Compare generated digest with input ticket digest + if(!MemoryEqual2B(&in->ticket.digest.b, &ticketToCompare.digest.b)) + return TPM_RCS_TICKET + RC_PolicyTicket_ticket; + + // Internal Data Update + + // Is this ticket to take the place of a TPM2_PolicySigned() or + // a TPM2_PolicySecret()? + if(in->ticket.tag == TPM_ST_AUTH_SIGNED) + commandCode = TPM_CC_PolicySigned; + else if(in->ticket.tag == TPM_ST_AUTH_SECRET) + commandCode = TPM_CC_PolicySecret; + else + // There could only be two possible tag values. Any other value should + // be caught by the ticket validation process. + FAIL(FATAL_ERROR_INTERNAL); + + // Update policy context + return PolicyContextUpdate(commandCode, + &in->authName, + &in->policyRef, + &in->cpHashA, + authTimeout, + session); +} + +#endif // CC_PolicyTicket diff --git a/src/tpm2/Policy_spt.c b/src/tpm2/Policy_spt.c index 30e627245..8bee89d0c 100644 --- a/src/tpm2/Policy_spt.c +++ b/src/tpm2/Policy_spt.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Policy Command Support */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Policy_spt.c 1594 2020-03-26 22:15:48Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2020 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes #include "Tpm.h" @@ -121,7 +62,7 @@ PolicyParameterChecks(SESSION* session, // objectName to it. This will also update the cpHash if it is present. // // Return Type: void -void PolicyContextUpdate( +TPM_RC PolicyContextUpdate( TPM_CC commandCode, // IN: command code TPM2B_NAME* name, // IN: name of entity TPM2B_NONCE* ref, // IN: the reference data @@ -136,8 +77,8 @@ void PolicyContextUpdate( CryptHashStart(&hashState, session->authHashAlg); // policyDigest size should always be the digest size of session hash algorithm. - pAssert(session->u2.policyDigest.t.size - == CryptHashGetDigestSize(session->authHashAlg)); + pAssert_RC(session->u2.policyDigest.t.size + == CryptHashGetDigestSize(session->authHashAlg)); // add old digest CryptDigestUpdate2B(&hashState, &session->u2.policyDigest.b); @@ -186,7 +127,8 @@ void PolicyContextUpdate( if(session->timeout == 0 || session->timeout > policyTimeout) session->timeout = policyTimeout; } - return; + VERIFY_NOT_FAILED(); + return TPM_RC_SUCCESS; } //*** ComputeAuthTimeout() // This function is used to determine what the authorization timeout value for diff --git a/src/tpm2/Policy_spt_fp.h b/src/tpm2/Policy_spt_fp.h index 7ae827ab9..62bc6d530 100644 --- a/src/tpm2/Policy_spt_fp.h +++ b/src/tpm2/Policy_spt_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Policy_spt_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -87,7 +28,7 @@ PolicyParameterChecks(SESSION* session, // objectName to it. This will also update the cpHash if it is present. // // Return Type: void -void PolicyContextUpdate( +TPM_RC PolicyContextUpdate( TPM_CC commandCode, // IN: command code TPM2B_NAME* name, // IN: name of entity TPM2B_NONCE* ref, // IN: the reference data From 82e982e167d3cc5b09841a7a5b73d7fc71ab3b95 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 23 Jul 2025 16:37:43 -0400 Subject: [PATCH 27/52] Sync: Adjust pAssert variant being used depending on function return type Signed-off-by: Stefan Berger --- src/tpm2/AlgorithmTests.c | 64 +--------- src/tpm2/Bits.c | 78 ++---------- src/tpm2/CommandDispatcher.c | 8 +- src/tpm2/Context_spt.c | 64 +--------- src/tpm2/CryptSelfTest.c | 2 +- src/tpm2/CryptUtil.c | 2 + src/tpm2/Entity.c | 2 +- src/tpm2/ExecCommand.c | 8 +- src/tpm2/Handle.c | 68 +--------- src/tpm2/IoBuffers.c | 65 +--------- src/tpm2/Locality.c | 63 +--------- src/tpm2/Manufacture.c | 2 +- src/tpm2/Memory.c | 75 ++--------- src/tpm2/NVMarshal.c | 2 +- src/tpm2/NvDynamic.c | 6 +- src/tpm2/NvReserved.c | 20 ++- src/tpm2/Object.c | 30 +++-- src/tpm2/Object_spt.c | 16 ++- src/tpm2/PCR.c | 6 +- src/tpm2/PolicyTransportSPDM.c | 1 - src/tpm2/Session.c | 46 +++---- src/tpm2/SessionProcess.c | 25 ++-- src/tpm2/Time.c | 62 +--------- src/tpm2/TpmASN1.c | 64 +--------- src/tpm2/TpmEcc_Signature_SM2.c | 116 +++++------------- src/tpm2/TpmEcc_Util.c | 62 +--------- src/tpm2/X509_spt.c | 62 +--------- src/tpm2/crypto/openssl/CryptCmac.c | 67 +--------- src/tpm2/crypto/openssl/CryptEccKeyExchange.c | 9 +- src/tpm2/crypto/openssl/CryptEccMain.c | 65 +--------- src/tpm2/crypto/openssl/CryptEccSignature.c | 70 +---------- src/tpm2/crypto/openssl/CryptHash.c | 25 ++-- src/tpm2/crypto/openssl/CryptPrime.c | 64 +--------- src/tpm2/crypto/openssl/CryptRand.c | 19 +-- src/tpm2/crypto/openssl/CryptSym.c | 76 ++---------- 35 files changed, 239 insertions(+), 1175 deletions(-) diff --git a/src/tpm2/AlgorithmTests.c b/src/tpm2/AlgorithmTests.c index d97ffcfc0..a5814506b 100644 --- a/src/tpm2/AlgorithmTests.c +++ b/src/tpm2/AlgorithmTests.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Code to perform the various self-test functions. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the code to perform the various self-test functions. @@ -123,7 +65,7 @@ static TPM_RC TestHash(TPM_ALG_ID hashAlg, ALGORITHM_VECTOR* toTest) const TPM2B* testDigest = NULL; // TPM2B_TYPE(HMAC_BLOCK, DEFAULT_TEST_HASH_BLOCK_SIZE); - pAssert(hashAlg != TPM_ALG_NULL); + pAssert_RC(hashAlg != TPM_ALG_NULL); # define HASH_CASE_FOR_TEST(HASH, hash) \ case ALG_##HASH##_VALUE: \ testDigest = &c_##HASH##_digest.b; \ @@ -366,7 +308,7 @@ static TPM_RC TestSymmetric(TPM_ALG_ID alg, ALGORITHM_VECTOR* toTest) } } else - pAssert(alg == 0 && alg != 0); + pAssert_RC(alg == 0 && alg != 0); return TPM_RC_SUCCESS; } diff --git a/src/tpm2/Bits.c b/src/tpm2/Bits.c index 47bfeff31..d95616170 100644 --- a/src/tpm2/Bits.c +++ b/src/tpm2/Bits.c @@ -1,73 +1,10 @@ -/********************************************************************************/ -/* */ -/* Bit Manipulation Routines */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Bits.c 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains bit manipulation routines. They operate on bit arrays. // // The 0th bit in the array is the right-most bit in the 0th octet in // the array. -// -// NOTE: If pAssert() is defined, the functions will assert if the indicated bit -// number is outside of the range of 'bArray'. How the assert is handled is -// implementation dependent. //** Includes @@ -85,7 +22,8 @@ BOOL TestBit(unsigned int bitNum, // IN: number of the bit in 'bArray' unsigned int bytesInArray // IN: size in bytes of 'bArray' ) { - pAssert(bytesInArray > (bitNum >> 3)); + NOT_REFERENCED(bytesInArray); // if assertions are disabled. + pAssert_BOOL(bytesInArray > (bitNum >> 3)); return ((bArray[bitNum >> 3] & (1 << (bitNum & 7))) != 0); } @@ -96,7 +34,10 @@ void SetBit(unsigned int bitNum, // IN: number of the bit in 'bArray' unsigned int bytesInArray // IN: size in bytes of 'bArray' ) { - pAssert(bytesInArray > (bitNum >> 3)); + NOT_REFERENCED(bytesInArray); // if assertions are disabled. + // failure will get checked at the end of the command processing, which + // is soon enough for SetBit use cases. + pAssert_VOID_OK(bytesInArray > (bitNum >> 3)); bArray[bitNum >> 3] |= (1 << (bitNum & 7)); } @@ -107,6 +48,9 @@ void ClearBit(unsigned int bitNum, // IN: number of the bit in 'bArray'. unsigned int bytesInArray // IN: size in bytes of 'bArray' ) { - pAssert(bytesInArray > (bitNum >> 3)); + NOT_REFERENCED(bytesInArray); // if assertions are disabled. + // failure will get checked at the end of the command processing, which + // is soon enough for ClearBit use cases. (command auditing, self-test, etc.) + pAssert_VOID_OK(bytesInArray > (bitNum >> 3)); bArray[bitNum >> 3] &= ~(1 << (bitNum & 7)); } diff --git a/src/tpm2/CommandDispatcher.c b/src/tpm2/CommandDispatcher.c index de11158f5..8b0ea4c4f 100644 --- a/src/tpm2/CommandDispatcher.c +++ b/src/tpm2/CommandDispatcher.c @@ -111,12 +111,12 @@ ParseHandleBuffer(COMMAND* command) BYTE dType; // Make sure that nothing strange has happened - pAssert( + pAssert_RC( command->index < sizeof(s_CommandDataArray) / sizeof(COMMAND_DESCRIPTOR_t*)); // Get the address of the descriptor for this command desc = s_CommandDataArray[command->index]; - pAssert(desc != NULL); + pAssert_RC(desc != NULL); // Get the associated list of unmarshaling data types. types = &((BYTE*)desc)[desc->typesOffset]; @@ -199,12 +199,12 @@ CommandDispatcher(COMMAND* command) TPM_RC result; // // Get the address of the descriptor for this command - pAssert( + pAssert_RC( command->index < sizeof(s_CommandDataArray) / sizeof(COMMAND_DESCRIPTOR_t*)); desc = s_CommandDataArray[command->index]; // Get the list of parameter types for this command - pAssert(desc != NULL); + pAssert_RC(desc != NULL); types = &((BYTE*)desc)[desc->typesOffset]; // Get a pointer to the list of parameter offsets diff --git a/src/tpm2/Context_spt.c b/src/tpm2/Context_spt.c index 963d9f880..9107a25eb 100644 --- a/src/tpm2/Context_spt.c +++ b/src/tpm2/Context_spt.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Context Management Command Support */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes @@ -140,11 +82,11 @@ TPM_RC ComputeContextProtectionKey(TPMS_CONTEXT* contextBlob, // IN: context b MemorySet(proof.b.buffer, 0, proof.b.size); // Copy part of the returned value as the key - pAssert(symKey->t.size <= sizeof(symKey->t.buffer)); + pAssert_RC(symKey->t.size <= sizeof(symKey->t.buffer)); MemoryCopy(symKey->t.buffer, kdfResult, symKey->t.size); // Copy the rest as the IV - pAssert(iv->t.size <= sizeof(iv->t.buffer)); + pAssert_RC(iv->t.size <= sizeof(iv->t.buffer)); MemoryCopy(iv->t.buffer, &kdfResult[symKey->t.size], iv->t.size); return TPM_RC_SUCCESS; diff --git a/src/tpm2/CryptSelfTest.c b/src/tpm2/CryptSelfTest.c index d20831aaa..525aadbff 100644 --- a/src/tpm2/CryptSelfTest.c +++ b/src/tpm2/CryptSelfTest.c @@ -151,7 +151,7 @@ CryptIncrementalSelfTest(TPML_ALG* toTest, // IN: list of algorithms to be tes TPM_ALG_ID alg; UINT32 i; - pAssert(toTest != NULL && toDoList != NULL); + pAssert_RC(toTest != NULL && toDoList != NULL); if(toTest->count > 0) { // Transcribe the toTest list into the toTestVector diff --git a/src/tpm2/CryptUtil.c b/src/tpm2/CryptUtil.c index f5f30df9d..7f52cdcdc 100644 --- a/src/tpm2/CryptUtil.c +++ b/src/tpm2/CryptUtil.c @@ -1222,6 +1222,8 @@ CryptCreateObject(OBJECT* object, // IN: new object structure po DRBG_AdditionalData((DRBG_STATE*)rand, &gp.shProof.b); DRBG_AdditionalData((DRBG_STATE*)rand, &gp.ehProof.b); } + VERIFY_NOT_FAILED(); + // Generate a seedValue that is the size of the digest produced by nameAlg sensitive->seedValue.t.size = DRBG_Generate(rand, diff --git a/src/tpm2/Entity.c b/src/tpm2/Entity.c index 89aa441b3..e06606923 100644 --- a/src/tpm2/Entity.c +++ b/src/tpm2/Entity.c @@ -232,7 +232,7 @@ EntityGetAuthValue(TPMI_DH_ENTITY handle, // IN: handle of entity // Authorization is available only when the private portion of // the object is loaded. The check should be made before // this function is called - pAssert(object->attributes.publicOnly == CLEAR); + pAssert_ZERO(object && object->attributes.publicOnly == CLEAR); pAuth = &object->sensitive.authValue; } } diff --git a/src/tpm2/ExecCommand.c b/src/tpm2/ExecCommand.c index bf8c63ddf..943425664 100644 --- a/src/tpm2/ExecCommand.c +++ b/src/tpm2/ExecCommand.c @@ -50,11 +50,9 @@ // // 'request' and 'response' may point to the same buffer // -// Note: As of February, 2016, the failure processing has been moved to the +// Note: The failure processing has been moved to the // platform-specific code. When the TPM code encounters an unrecoverable failure, it -// will SET g_inFailureMode and call _plat__Fail(). That function should not return -// but may call ExecuteCommand(). -// +// will call _plat__Fail() and call _plat__InFailureMode() to query failure mode. LIB_EXPORT void ExecuteCommand( uint32_t requestSize, // IN: command buffer size unsigned char* request, // IN: command buffer @@ -306,7 +304,7 @@ LIB_EXPORT void ExecuteCommand( FAIL(FATAL_ERROR_INTERNAL); g_updateNV = UT_NONE; } - pAssert((UINT32)command.parameterSize <= maxResponse); + pAssert_NORET((UINT32)command.parameterSize <= maxResponse); // Clear unused bits in response buffer. MemorySet(*response + *responseSize, 0, maxResponse - *responseSize); diff --git a/src/tpm2/Handle.c b/src/tpm2/Handle.c index 46041719f..12246c253 100644 --- a/src/tpm2/Handle.c +++ b/src/tpm2/Handle.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* fUnctions that return the type of a handle. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // This file contains the functions that return the type of a handle. @@ -159,7 +101,7 @@ PermanentCapGetHandles(TPM_HANDLE handle, // IN: start handle TPMI_YES_NO more = NO; UINT32 i; - pAssert(HandleGetType(handle) == TPM_HT_PERMANENT); + VERIFY(HandleGetType(handle) == TPM_HT_PERMANENT, FATAL_ERROR_ASSERT, NO); // Initialize output handle list handleList->count = 0; @@ -195,7 +137,7 @@ BOOL PermanentCapGetOneHandle(TPM_HANDLE handle) // IN: handle { UINT32 i; - pAssert(HandleGetType(handle) == TPM_HT_PERMANENT); + pAssert_BOOL(HandleGetType(handle) == TPM_HT_PERMANENT); // Iterate permanent handle range for(i = NextPermanentHandle(handle); i != 0; i = NextPermanentHandle(i + 1)) @@ -223,7 +165,7 @@ PermanentHandleGetPolicy(TPM_HANDLE handle, // IN: start handle { TPMI_YES_NO more = NO; - pAssert(HandleGetType(handle) == TPM_HT_PERMANENT); + VERIFY(HandleGetType(handle) == TPM_HT_PERMANENT, FATAL_ERROR_ASSERT, NO); // Initialize output handle list policyList->count = 0; @@ -270,7 +212,7 @@ BOOL PermanentHandleGetOnePolicy(TPM_HANDLE handle, // IN: handle TPMS_TAGGED_POLICY* policy // OUT: tagged policy ) { - pAssert(HandleGetType(handle) == TPM_HT_PERMANENT); + pAssert_BOOL(HandleGetType(handle) == TPM_HT_PERMANENT); if(NextPermanentHandle(handle) == handle) { diff --git a/src/tpm2/IoBuffers.c b/src/tpm2/IoBuffers.c index f9de0ef0a..17e152dd3 100644 --- a/src/tpm2/IoBuffers.c +++ b/src/tpm2/IoBuffers.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* I/O Buffers */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: IoBuffers.c 1311 2018-08-23 21:39:29Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes and Data Definitions @@ -99,7 +40,7 @@ BYTE* MemoryGetInBuffer(UINT32 size // Size, in bytes, required for the input // unmarshaling ) { - pAssert(size <= sizeof(s_actionIoBuffer)); + pAssert_NULL(size <= sizeof(s_actionIoBuffer)); // In this implementation, a static buffer is set aside for the command action // buffers. The buffer is shared between input and output. This is because // there is no need to allocate for the worst case input and worst case output @@ -119,7 +60,7 @@ BYTE* MemoryGetOutBuffer(UINT32 size // required size of the buffer ) { BYTE* retVal = (BYTE*)(&s_actionIoBuffer[s_actionIoAllocation / UoM]); - pAssert((size + s_actionIoAllocation) < (sizeof(s_actionIoBuffer))); + pAssert_NULL((size + s_actionIoAllocation) < (sizeof(s_actionIoBuffer))); // In this implementation, a static buffer is set aside for the command action // output buffer. memset(retVal, 0, size); diff --git a/src/tpm2/Locality.c b/src/tpm2/Locality.c index f9cf23548..88ba47ca4 100644 --- a/src/tpm2/Locality.c +++ b/src/tpm2/Locality.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Locality.c 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016, 2017 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes #include "Tpm.h" @@ -93,7 +34,7 @@ LocalityGetAttributes(UINT8 locality // IN: locality value SET_ATTRIBUTE(locality_attributes, TPMA_LOCALITY, TPM_LOC_FOUR); break; default: - pAssert(locality > 31); + VERIFY(locality > 31, FATAL_ERROR_ASSERT, 0); *localityAsByte = locality; break; } diff --git a/src/tpm2/Manufacture.c b/src/tpm2/Manufacture.c index c5cab8f9d..527e64a52 100644 --- a/src/tpm2/Manufacture.c +++ b/src/tpm2/Manufacture.c @@ -59,7 +59,7 @@ LIB_EXPORT int TPM_Manufacture( // trigger failure mode if called in error. int nvReadyState = _plat__GetNvReadyState(); - pAssert(nvReadyState == NV_READY); // else failure mode + pAssert_NORET(nvReadyState == NV_READY); // else failure mode if(nvReadyState != NV_READY) { return MANUF_NV_NOT_READY; diff --git a/src/tpm2/Memory.c b/src/tpm2/Memory.c index 7b15026aa..9ade6c610 100644 --- a/src/tpm2/Memory.c +++ b/src/tpm2/Memory.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Miscellaneous Memory Manipulation Routines */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Memory.c 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2021 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // This file contains a set of miscellaneous memory manipulation routines. Many @@ -116,12 +57,12 @@ LIB_EXPORT INT16 MemoryCopy2B(TPM2B* dest, // OUT: receiving TPM2B unsigned int dSize // IN: size of the receiving buffer ) { - pAssert(dest != NULL); - if(source == NULL) - dest->size = 0; - else + pAssert_ZERO(dest != NULL); + dest->size = 0; + if(source != NULL) { - pAssert(source->size <= dSize); + NOT_REFERENCED(dSize); // if pAsserts compiled out. + pAssert_ZERO(source->size <= dSize); MemoryCopy(dest->buffer, source->buffer, source->size); dest->size = source->size; } @@ -139,7 +80,9 @@ void MemoryConcat2B( // aInOut.size) ) { - pAssert(bIn->size <= aMaxSize - aInOut->size); + NOT_REFERENCED(aMaxSize); // if pAsserts compiled out. + // if won't fit, enter failure mode and return unchanged. + pAssert_VOID_OK(bIn->size <= aMaxSize - aInOut->size); MemoryCopy(&aInOut->buffer[aInOut->size], &bIn->buffer, bIn->size); aInOut->size = aInOut->size + bIn->size; return; diff --git a/src/tpm2/NVMarshal.c b/src/tpm2/NVMarshal.c index 1356c2597..6e195b275 100644 --- a/src/tpm2/NVMarshal.c +++ b/src/tpm2/NVMarshal.c @@ -142,7 +142,7 @@ static void block_skip_write_pop(block_skip_t *bs, INT32 *size) { UINT16 skip; unsigned i = --bs->idx; - pAssert((int)bs->idx >= 0); + pAssert_VOID_OK((int)bs->idx >= 0); skip = bs->pos[i].size - *size - sizeof(UINT16); UINT16_Marshal(&skip, &bs->pos[i].buffer, &bs->pos[i].size); } diff --git a/src/tpm2/NvDynamic.c b/src/tpm2/NvDynamic.c index 117c9ccc8..a73513b6d 100644 --- a/src/tpm2/NvDynamic.c +++ b/src/tpm2/NvDynamic.c @@ -605,11 +605,11 @@ static void NvObjectFromBuffer(OBJECT* object, BYTE* buf, UINT32 buf_size) */ rc = ANY_OBJECT_Unmarshal(object, &buffer, &size, false); if (!rc) { - pAssert(size == 0); + pAssert_VOID_OK(size == 0); } else { /* It could not be unmarshalled, it must be a plain RSA3072_OBJECT */ rc = RSA3072_OBJECT_Buffer_To_OBJECT(object, buf, buf_size); - pAssert(rc == TPM_RC_SUCCESS); + pAssert_VOID_OK(rc == TPM_RC_SUCCESS); } } // libtpms added end @@ -632,7 +632,7 @@ void NvReadObject(NV_REF ref, // IN: points to NV where index is located entrysize -= sizeof(NV_ENTRY_HEADER); /* read the flat object into a buffer */ - pAssert(entrysize <= sizeof(buffer)); + pAssert_VOID_OK(entrysize <= sizeof(buffer)); NvRead(buffer, ref + sizeof(TPM_HANDLE), entrysize); NvObjectFromBuffer(object, buffer, entrysize); diff --git a/src/tpm2/NvReserved.c b/src/tpm2/NvReserved.c index 2ad65bac6..dcda91883 100644 --- a/src/tpm2/NvReserved.c +++ b/src/tpm2/NvReserved.c @@ -155,8 +155,10 @@ void NvRead(void* outBuffer, // OUT: buffer to receive data UINT32 size // IN: size of the value to read ) { - // Input type should be valid - pAssert(nvOffset + size < NV_MEMORY_SIZE); + // Input addresses must be inside the memory buffer. + // void is OK because we simply skip the read, which is the only reasonable + // response. + pAssert_VOID_OK(nvOffset + size < NV_MEMORY_SIZE); _plat__NvMemoryRead(nvOffset, size, outBuffer); return; } @@ -186,7 +188,12 @@ void NvUpdatePersistent( void* buffer // IN: the new data ) { - pAssert(offset + size <= sizeof(gp)); + // Input addresses must be inside the memory buffer. Any callers using the + // expected CLEAR_PERSISTENT macro should encounter a build error before + // tripping this assert so void is reasonable as a defense in depth against + // a manual caller of this function. Skipping the write is the only + // reasonable response. + pAssert_VOID_OK(offset + size <= sizeof(gp)); MemoryCopy(&gp + offset, buffer, size); NvWrite(offset, size, buffer); } @@ -198,7 +205,12 @@ void NvClearPersistent(UINT32 offset, // IN: the offset in the PERMANENT_DATA UINT32 size // IN: number of bytes to clear ) { - pAssert(offset + size <= sizeof(gp)); + // Input addresses must be inside the memory buffer. Any callers using the + // expected CLEAR_PERSISTENT macro should encounter a build error before + // tripping this assert so void is reasonable as a defense in depth against + // a manual caller of this function. Skipping the write is the only + // reasonable response. + pAssert_VOID_OK(offset + size <= sizeof(gp)); MemorySet((&gp) + offset, 0, size); NvWrite(offset, size, (&gp) + offset); } diff --git a/src/tpm2/Object.c b/src/tpm2/Object.c index 0960db44e..ff321d29f 100644 --- a/src/tpm2/Object.c +++ b/src/tpm2/Object.c @@ -99,7 +99,7 @@ BOOL IsObjectPresent(TPMI_DH_OBJECT handle // IN: handle to be checked BOOL ObjectIsSequence(OBJECT* object // IN: handle to be checked ) { - pAssert(object != NULL); + pAssert_BOOL(object != NULL); return (object->attributes.hmacSeq == SET || object->attributes.hashSeq == SET || object->attributes.eventSeq == SET); } @@ -120,9 +120,16 @@ OBJECT* HandleToObject(TPMI_DH_OBJECT handle // IN: handle of the object return NULL; // In this implementation, the handle is determined by the slot occupied by the // object. + // this can be an underflow if TPM_Init hasn't happened or the usual handle + // checks are skipped. Enter failure mode on this unexpected condition + if(handle < TRANSIENT_FIRST) + { + FAIL_NULL(FATAL_ERROR_ASSERT); + } + index = handle - TRANSIENT_FIRST; - pAssert(index < MAX_LOADED_OBJECTS); - pAssert(s_objects[index].attributes.occupied); + pAssert_NULL(index < MAX_LOADED_OBJECTS); + pAssert_NULL(s_objects[index].attributes.occupied); return &s_objects[index]; } @@ -327,7 +334,7 @@ ObjectLoad(OBJECT* object, // IN: pointer to object slot TPM_RC result = TPM_RC_SUCCESS; // // Do validations of public area object descriptions - pAssert(publicArea != NULL); + pAssert_RC(publicArea != NULL); // Is this public only or a no-name object? if(sensitive == NULL || publicArea->nameAlg == TPM_ALG_NULL) @@ -640,12 +647,13 @@ ObjectContextLoadLibtpms(BYTE *buffer, // This function frees an object slot. // // This function requires that the object is loaded. +// returns FALSE and enters failure mode if the handle is invalid. BOOL FlushObject(TPMI_DH_OBJECT handle // IN: handle to be freed ) { UINT32 index = handle - TRANSIENT_FIRST; - // - pAssert(index < MAX_LOADED_OBJECTS); + // checks for underflow due to unsigned math + pAssert_BOOL(index < MAX_LOADED_OBJECTS); // Clear all the object attributes MemorySet((BYTE*)&(s_objects[index].attributes), 0, sizeof(OBJECT_ATTRIBUTES)); return TRUE; @@ -862,8 +870,8 @@ ObjectCapGetLoaded(TPMI_DH_OBJECT handle, // IN: start handle { TPMI_YES_NO more = NO; UINT32 i; - // - pAssert(HandleGetType(handle) == TPM_HT_TRANSIENT); + // enter failure mode and stop iterating if we encounter an internal error + VERIFY(HandleGetType(handle) == TPM_HT_TRANSIENT, FATAL_ERROR_INTERNAL, NO); // Initialize output handle list handleList->count = 0; @@ -878,7 +886,7 @@ ObjectCapGetLoaded(TPMI_DH_OBJECT handle, // IN: start handle if(s_objects[i].attributes.occupied == TRUE) { // A valid transient object can not be the copy of a persistent object - pAssert(s_objects[i].attributes.evict == CLEAR); + VERIFY(s_objects[i].attributes.evict == CLEAR, FATAL_ERROR_INTERNAL, NO); if(handleList->count < count) { @@ -906,7 +914,7 @@ BOOL ObjectCapGetOneLoaded(TPMI_DH_OBJECT handle) // IN: handle { UINT32 i; - pAssert(HandleGetType(handle) == TPM_HT_TRANSIENT); + pAssert_BOOL(HandleGetType(handle) == TPM_HT_TRANSIENT); // Iterate object slots to get loaded object handles for(i = handle - TRANSIENT_FIRST; i < MAX_LOADED_OBJECTS; i++) @@ -914,7 +922,7 @@ BOOL ObjectCapGetOneLoaded(TPMI_DH_OBJECT handle) // IN: handle if(s_objects[i].attributes.occupied == TRUE) { // A valid transient object can not be the copy of a persistent object - pAssert(s_objects[i].attributes.evict == CLEAR); + pAssert_BOOL(s_objects[i].attributes.evict == CLEAR); return TRUE; } diff --git a/src/tpm2/Object_spt.c b/src/tpm2/Object_spt.c index 3fc22324e..f267758a2 100644 --- a/src/tpm2/Object_spt.c +++ b/src/tpm2/Object_spt.c @@ -531,7 +531,7 @@ SchemeChecks(OBJECT* parentObject, // IN: parent (null if primary seed) curveID = publicArea->parameters.eccDetail.curveID; curveScheme = CryptGetCurveSignScheme(curveID); // The curveId must be valid or the unmarshaling is busted. - pAssert(curveScheme != NULL); + pAssert_RC(curveScheme != NULL); // If the curveID requires a specific scheme, then the key must // select the same scheme @@ -1018,7 +1018,7 @@ UnwrapOuter(OBJECT* protector, // IN: The object that provides // This function is used to marshal a sensitive area. Among other things, it // adjusts the size of the authValue to be no smaller than the digest of // 'nameAlg' -// Returns the size of the marshaled area. +// Returns the size of the marshaled area. 0 indicates an error static UINT16 MarshalSensitive( OBJECT* parent LIBTPMS_ATTR_UNUSED, // IN: the object parent (optional) BYTE* buffer, // OUT: receiving buffer @@ -1039,6 +1039,7 @@ static UINT16 MarshalSensitive( // If the sensitive size is the special case for a prime in the type if((sensitive->sensitive.rsa.t.size & RSA_prime_flag) > 0) { + pAssert_ZERO(sensitive->sensitiveType == ALG_RSA_VALUE); UINT16 sizeSave = sensitive->sensitive.rsa.t.size; // // Turn off the flag that indicates that the sensitive->sensitive contains @@ -1057,7 +1058,9 @@ static UINT16 MarshalSensitive( } else #endif + { retVal = TPMT_SENSITIVE_Marshal(sensitive, &buffer, NULL); + } // Marshal the size retVal = (UINT16)(retVal + UINT16_Marshal(&retVal, &sizeField, NULL)); @@ -1118,6 +1121,7 @@ TPM_RC SensitiveToPrivate( // Marshal the sensitive area including authValue size adjustments. dataSize = MarshalSensitive(parent, sensitiveData, sensitive, nameAlg); + pAssert_RC(dataSize != 0); // 0 indicates a failure mode assertion //Produce outer wrap, including encryption and HMAC outPrivate->t.size = ProduceOuterWrap( @@ -1167,7 +1171,7 @@ PrivateToSensitive(TPM2B* inPrivate, // IN: input private structure UINT16 ivSize; // // Make sure that name is provided - pAssert(name != NULL && name->size != 0); + pAssert_RC(name != NULL && name->size != 0); // Find the hash algorithm for integrity computation // For Temporary Object (parent == NULL) use self name algorithm; @@ -1373,10 +1377,10 @@ DuplicateToSensitive( UINT16 dataSizeInput; // // Make sure that name is provided - pAssert(name != NULL && name->size != 0); + pAssert_RC(name != NULL && name->size != 0); // Make sure symDef and innerSymKey are not NULL - pAssert(symDef != NULL && innerSymKey != NULL); + pAssert_RC(symDef != NULL && innerSymKey != NULL); // Starting of sensitive data sensitiveData = inPrivate->buffer; @@ -1400,7 +1404,7 @@ DuplicateToSensitive( if(symDef->algorithm != TPM_ALG_NULL) { // assume the input key size matches the symmetric definition - pAssert(innerSymKey->size == (symDef->keyBits.sym + 7) / 8); + pAssert_RC(innerSymKey->size == (symDef->keyBits.sym + 7) / 8); // Decrypt inner buffer in place CryptSymmetricDecrypt(sensitiveData, diff --git a/src/tpm2/PCR.c b/src/tpm2/PCR.c index 152e748d5..9b8f9b551 100644 --- a/src/tpm2/PCR.c +++ b/src/tpm2/PCR.c @@ -914,7 +914,7 @@ PCRAllocate(TPML_PCR_SELECTION* allocate, // IN: required allocation } } // The j loop must exit with a match. - pAssert(j < newAllocate.count); + pAssert_RC(j < newAllocate.count); } // Max PCR in a bank is MIN(implemented PCR, PCR with attributes defined) @@ -1252,7 +1252,7 @@ PCRCapGetHandles(TPMI_DH_PCR handle, // IN: start handle TPMI_YES_NO more = NO; UINT32 i; - pAssert(HandleGetType(handle) == TPM_HT_PCR); + VERIFY(HandleGetType(handle) == TPM_HT_PCR, FATAL_ERROR_INTERNAL, NO); // Initialize output handle list handleList->count = 0; @@ -1286,7 +1286,7 @@ PCRCapGetHandles(TPMI_DH_PCR handle, // IN: start handle // This function is used to check whether a PCR handle exists. BOOL PCRCapGetOneHandle(TPMI_DH_PCR handle) // IN: handle { - pAssert(HandleGetType(handle) == TPM_HT_PCR); + pAssert_BOOL(HandleGetType(handle) == TPM_HT_PCR); if((handle & HR_HANDLE_MASK) <= PCR_LAST) { diff --git a/src/tpm2/PolicyTransportSPDM.c b/src/tpm2/PolicyTransportSPDM.c index c0733b2f8..e51aa48d0 100644 --- a/src/tpm2/PolicyTransportSPDM.c +++ b/src/tpm2/PolicyTransportSPDM.c @@ -27,7 +27,6 @@ TPM2_PolicyTransportSPDM(PolicyTransportSPDM_In* in // IN: input parameter list // Get pointer to the session structure session = SessionGet(in->policySession); - pAssert_RC(session); // Check that TPM2_PolicyTransportSPDM has not previously been executed if(session->attributes.checkSecureChannel == SET) diff --git a/src/tpm2/Session.c b/src/tpm2/Session.c index b3e7d47c4..1b45a3649 100644 --- a/src/tpm2/Session.c +++ b/src/tpm2/Session.c @@ -112,8 +112,8 @@ static void ContextIdSetOldest(void) CONTEXT_SLOT entry; CONTEXT_SLOT smallest = CONTEXT_SLOT_MASKED(~0); // libtpms changed UINT32 i; - pAssert(s_ContextSlotMask == 0xff || s_ContextSlotMask == 0xffff); // libtpms added + pAssert_VOID_OK(s_ContextSlotMask == 0xff || s_ContextSlotMask == 0xffff); // libtpms added // Set oldestSaveContext to a value indicating none assigned s_oldestSavedSession = MAX_ACTIVE_SESSIONS + 1; lowBits = CONTEXT_SLOT_MASKED(gr.contextCounter); // libtpms changed @@ -207,8 +207,8 @@ BOOL SessionStartup(STARTUP_TYPE type) BOOL SessionIsLoaded(TPM_HANDLE handle // IN: session handle ) { - pAssert(HandleGetType(handle) == TPM_HT_POLICY_SESSION - || HandleGetType(handle) == TPM_HT_HMAC_SESSION); + pAssert_BOOL(HandleGetType(handle) == TPM_HT_POLICY_SESSION + || HandleGetType(handle) == TPM_HT_HMAC_SESSION); handle = handle & HR_HANDLE_MASK; @@ -236,8 +236,8 @@ BOOL SessionIsLoaded(TPM_HANDLE handle // IN: session handle BOOL SessionIsSaved(TPM_HANDLE handle // IN: session handle ) { - pAssert(HandleGetType(handle) == TPM_HT_POLICY_SESSION - || HandleGetType(handle) == TPM_HT_HMAC_SESSION); + pAssert_BOOL(HandleGetType(handle) == TPM_HT_POLICY_SESSION + || HandleGetType(handle) == TPM_HT_HMAC_SESSION); handle = handle & HR_HANDLE_MASK; // if out of range of possible active session, or not assigned, or @@ -350,7 +350,7 @@ static TPM_RC ContextIdSessionCreate( // be occupied by the created session ) { - pAssert(sessionIndex < MAX_LOADED_SESSIONS); + pAssert_RC(sessionIndex < MAX_LOADED_SESSIONS); // check to see if creating the context is safe // Is this going to be an assignment for the last session context @@ -410,8 +410,8 @@ SessionCreate(TPM_SE sessionType, // IN: the session type CONTEXT_SLOT slotIndex; SESSION* session = NULL; - pAssert(sessionType == TPM_SE_HMAC || sessionType == TPM_SE_POLICY - || sessionType == TPM_SE_TRIAL); + pAssert_RC(sessionType == TPM_SE_HMAC || sessionType == TPM_SE_POLICY + || sessionType == TPM_SE_TRIAL); // If there are no open spots in the session array, then no point in searching if(s_freeSessionSlots == 0) @@ -496,7 +496,7 @@ SessionCreate(TPM_SE sessionType, // IN: the session type // Get authValue of associated entity EntityGetAuthValue(bind, (TPM2B_AUTH*)&key); - pAssert((size_t)key.t.size + seed->t.size <= sizeof(key.t.buffer)); + pAssert_RC((size_t)(key.t.size + seed->t.size) <= sizeof(key.t.buffer)); // Concatenate authValue and seed MemoryConcat2B(&key.b, &seed->b, sizeof(key.t.buffer)); @@ -552,7 +552,7 @@ SessionContextSave(TPM_HANDLE handle, // IN: session handle UINT32 contextIndex; CONTEXT_SLOT slotIndex; - pAssert(SessionIsLoaded(handle)); + pAssert_RC(SessionIsLoaded(handle)); pAssert(s_ContextSlotMask == 0xff || s_ContextSlotMask == 0xffff); // libtpms added // check to see if the gap is already maxed out @@ -568,7 +568,7 @@ SessionContextSave(TPM_HANDLE handle, // IN: session handle *contextID = gr.contextCounter; contextIndex = handle & HR_HANDLE_MASK; - pAssert(contextIndex < MAX_ACTIVE_SESSIONS); + pAssert_RC(contextIndex < MAX_ACTIVE_SESSIONS); // Extract the session slot number referenced by the contextArray // because we are going to overwrite this with the low order @@ -630,8 +630,8 @@ SessionContextLoad(SESSION_BUF* session, // IN: session structure from saved co CONTEXT_SLOT slotIndex; pAssert(s_ContextSlotMask == 0xff || s_ContextSlotMask == 0xffff); // libtpms added - pAssert(HandleGetType(*handle) == TPM_HT_POLICY_SESSION - || HandleGetType(*handle) == TPM_HT_HMAC_SESSION); + pAssert_RC(HandleGetType(*handle) == TPM_HT_POLICY_SESSION + || HandleGetType(*handle) == TPM_HT_HMAC_SESSION); // Don't bother looking if no openings if(s_freeSessionSlots == 0) @@ -660,7 +660,7 @@ SessionContextLoad(SESSION_BUF* session, // IN: session structure from saved co && contextIndex != s_oldestSavedSession) return TPM_RC_CONTEXT_GAP; - pAssert(contextIndex < MAX_ACTIVE_SESSIONS); + pAssert_RC(contextIndex < MAX_ACTIVE_SESSIONS); // set the contextArray value to point to the session slot where // the context is loaded @@ -695,15 +695,16 @@ void SessionFlush(TPM_HANDLE handle // IN: loaded or saved session handle CONTEXT_SLOT slotIndex; UINT32 contextIndex; // Index into contextArray - pAssert((HandleGetType(handle) == TPM_HT_POLICY_SESSION - || HandleGetType(handle) == TPM_HT_HMAC_SESSION) - && (SessionIsLoaded(handle) || SessionIsSaved(handle))); + pAssert_VOID_OK((HandleGetType(handle) == TPM_HT_POLICY_SESSION + || HandleGetType(handle) == TPM_HT_HMAC_SESSION) + && (SessionIsLoaded(handle) || SessionIsSaved(handle))); // Flush context ID of this session // Convert handle to an index into the contextArray contextIndex = handle & HR_HANDLE_MASK; - pAssert(contextIndex < sizeof(gr.contextArray) / sizeof(gr.contextArray[0])); + pAssert_VOID_OK( + contextIndex < sizeof(gr.contextArray) / sizeof(gr.contextArray[0])); // Get the current contents of the array slotIndex = gr.contextArray[contextIndex]; @@ -787,7 +788,7 @@ void SessionResetPolicyData(SESSION* session // IN: the session to reset ) { SESSION_ATTRIBUTES oldAttributes; - pAssert(session != NULL); + pAssert_VOID_OK(session != NULL); // Will need later oldAttributes = session->attributes; @@ -840,7 +841,7 @@ SessionCapGetLoaded(TPMI_SH_POLICY handle, // IN: start handle TPMI_YES_NO more = NO; UINT32 i; - pAssert(HandleGetType(handle) == TPM_HT_LOADED_SESSION); + VERIFY(HandleGetType(handle) == TPM_HT_LOADED_SESSION, FATAL_ERROR_ASSERT, NO); // Initialize output handle list handleList->count = 0; @@ -867,6 +868,7 @@ SessionCapGetLoaded(TPMI_SH_POLICY handle, // IN: start handle // assume that this is going to be an HMAC session handle = i + HMAC_SESSION_FIRST; session = SessionGet(handle); + VERIFY(session != NULL, FATAL_ERROR_ASSERT, NO); if(session->attributes.isPolicy) handle = i + POLICY_SESSION_FIRST; handleList->handle[handleList->count] = handle; @@ -890,7 +892,7 @@ SessionCapGetLoaded(TPMI_SH_POLICY handle, // IN: start handle // This function returns whether a session handle exists and is loaded. BOOL SessionCapGetOneLoaded(TPMI_SH_POLICY handle) // IN: handle { - pAssert(HandleGetType(handle) == TPM_HT_LOADED_SESSION); + pAssert_BOOL(HandleGetType(handle) == TPM_HT_LOADED_SESSION); if((handle & HR_HANDLE_MASK) < MAX_ACTIVE_SESSIONS && gr.contextArray[(handle & HR_HANDLE_MASK)]) @@ -963,7 +965,7 @@ SessionCapGetSaved(TPMI_SH_HMAC handle, // IN: start handle // This function returns whether a session handle exists and is saved. BOOL SessionCapGetOneSaved(TPMI_SH_HMAC handle) // IN: handle { - pAssert(HandleGetType(handle) == TPM_HT_SAVED_SESSION); + pAssert_BOOL(HandleGetType(handle) == TPM_HT_SAVED_SESSION); if((handle & HR_HANDLE_MASK) < MAX_ACTIVE_SESSIONS && gr.contextArray[(handle & HR_HANDLE_MASK)]) diff --git a/src/tpm2/SessionProcess.c b/src/tpm2/SessionProcess.c index 81e6e3ba0..bd44a2b1f 100644 --- a/src/tpm2/SessionProcess.c +++ b/src/tpm2/SessionProcess.c @@ -298,7 +298,7 @@ static BOOL IsAuthValueAvailable(TPM_HANDLE handle, // IN: handle of e OBJECT* object; TPMA_OBJECT attributes; // - object = HandleToObject(handle); + object = HandleToObject(handle); pAssert_BOOL(object != NULL); attributes = object->publicArea.objectAttributes; @@ -482,7 +482,6 @@ static BOOL IsAuthPolicyAvailable(TPM_HANDLE handle, // IN: handle of default: break; } - return result; } @@ -598,7 +597,7 @@ static TPM2B_DIGEST* GetCpHash(COMMAND* command, TPMI_ALG_HASH hashAlg) { TPM2B_DIGEST* cpHash = GetCpHashPointer(command, hashAlg); // - pAssert(cpHash->t.size != 0); + pAssert_NULL(cpHash && cpHash->t.size != 0); return cpHash; } @@ -1413,7 +1412,7 @@ static TPM_RC CheckAuthSession( TPM_HT sessionHandleType = HandleGetType(sessionHandle); BOOL authUsed; // - pAssert(sessionHandle != TPM_RH_UNASSIGNED); + pAssert_RC(sessionHandle != TPM_RH_UNASSIGNED); // Take care of physical presence if(associatedHandle == TPM_RH_PLATFORM) @@ -1503,7 +1502,7 @@ static TPM_RC CheckAuthSession( NV_PIN pinData; TPMA_NV nvAttributes; // - pAssert(nvIndex != NULL); + pAssert_RC(nvIndex != NULL); nvAttributes = nvIndex->publicArea.attributes; // If this is a PIN FAIL index and the value has been written // then we can update the counter (increment or clear) @@ -1708,7 +1707,8 @@ ParseSessionBuffer(COMMAND* command // IN: the structure that contains { extraKey.b.size = 0; } - size = DecryptSize(command->index); + size = DecryptSize(command->index); + pAssert_RC(command->parameterSize <= INT32_MAX); result = CryptParameterDecryption(s_sessionHandles[s_decryptSessionIndex], &s_nonceCaller[s_decryptSessionIndex].b, command->parameterSize, @@ -1825,7 +1825,7 @@ static void UpdateAuditDigest( TPM2B_DIGEST* cpHash = GetCpHash(command, hashAlg); TPM2B_DIGEST* rpHash = ComputeRpHash(command, hashAlg); // - pAssert(cpHash != NULL); + pAssert_VOID_OK(cpHash != NULL); // digestNew := hash (digestOld || cpHash || rpHash) // Start hash computation. @@ -2082,7 +2082,6 @@ static TPM2B_NONCE* BuildSingleResponseAuth( SESSION* session = SessionGet(s_sessionHandles[sessionIndex]); pAssert_NULL(session != NULL); - // // If the session is a policy session with isPasswordNeeded SET, the // authorization field is empty. if(HandleGetType(s_sessionHandles[sessionIndex]) == TPM_HT_POLICY_SESSION @@ -2133,7 +2132,7 @@ BuildResponseSession(COMMAND* command // IN: structure that has relevant comman { TPM_RC result = TPM_RC_SUCCESS; - pAssert(command->authSize == 0); + pAssert_RC(command->authSize == 0); // Reset the parameter buffer to point to the start of the parameters so that // there is a starting point for any rpHash that might be generated and so there @@ -2144,6 +2143,7 @@ BuildResponseSession(COMMAND* command // IN: structure that has relevant comman if(command->tag == TPM_ST_SESSIONS) { UpdateAllNonceTPM(command); + VERIFY_NOT_FAILED(); // Encrypt first parameter if applicable. Parameter encryption should // happen after nonce update and before any rpHash is computed. @@ -2166,6 +2166,7 @@ BuildResponseSession(COMMAND* command // IN: structure that has relevant comman &extraKey); } size = EncryptSize(command->index); + pAssert_RC(command->parameterSize <= INT32_MAX); // This function operates on internally-generated data that is // expected to be well-formed for parameter encryption. // In the event that there is a bug elsewhere in the code and the @@ -2188,6 +2189,7 @@ BuildResponseSession(COMMAND* command // IN: structure that has relevant comman // Audit sessions should be processed regardless of the tag because // a command with no session may cause a change of the exclusivity state. UpdateAuditSessionStatus(command); + VERIFY_NOT_FAILED(); #if CC_GetCommandAuditDigest // Command Audit if(CommandAuditIsRequired(command->index)) @@ -2198,7 +2200,7 @@ BuildResponseSession(COMMAND* command // IN: structure that has relevant comman { UINT32 i; // - pAssert(command->sessionNum > 0); + pAssert_RC(command->sessionNum > 0); // Iterate over each session in the command session area, and create // corresponding sessions for response. @@ -2229,7 +2231,10 @@ BuildResponseSession(COMMAND* command // IN: structure that has relevant comman command->authSize += TPM2B_DIGEST_Marshal(&responseAuth, &command->responseBuffer, NULL); if(!IS_ATTRIBUTE(s_attributes[i], TPMA_SESSION, continueSession)) + { SessionFlush(s_sessionHandles[i]); + VERIFY_NOT_FAILED(); + } } } diff --git a/src/tpm2/Time.c b/src/tpm2/Time.c index a80a85963..4061bb2d8 100644 --- a/src/tpm2/Time.c +++ b/src/tpm2/Time.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Functions relating to the TPM's time functions */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the functions relating to the TPM's time functions including @@ -133,7 +75,7 @@ void TimeClockUpdate(UINT64 newTime // IN: New time value in mS. // Check to see if the update will cause a need for an nvClock update if((newTime | CLOCK_UPDATE_MASK) > (go.clock | CLOCK_UPDATE_MASK)) { - pAssert(g_NvStatus == TPM_RC_SUCCESS); + pAssert_VOID_OK(g_NvStatus == TPM_RC_SUCCESS); // Going to update the NV time state so SET the safe flag go.clockSafe = YES; diff --git a/src/tpm2/TpmASN1.c b/src/tpm2/TpmASN1.c index bc1501386..aaa6e2da7 100644 --- a/src/tpm2/TpmASN1.c +++ b/src/tpm2/TpmASN1.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM ASN.1 */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes #include "Tpm.h" @@ -275,7 +217,7 @@ void ASN1InitialializeMarshalContext( // that was previously placed in the structure. void ASN1StartMarshalContext(ASN1MarshalContext* ctx) { - pAssert((ctx->depth + 1) < MAX_DEPTH); + pAssert_VOID_OK((ctx->depth + 1) < MAX_DEPTH); ctx->depth++; ctx->ends[ctx->depth] = ctx->end; ctx->end = ctx->offset; @@ -290,7 +232,7 @@ INT16 ASN1EndMarshalContext(ASN1MarshalContext* ctx) { INT16 length; - pAssert(ctx->depth >= 0); + pAssert_ZERO(ctx->depth >= 0); length = ctx->end - ctx->offset; ctx->end = ctx->ends[ctx->depth--]; return length; diff --git a/src/tpm2/TpmEcc_Signature_SM2.c b/src/tpm2/TpmEcc_Signature_SM2.c index d3ea93d77..1d6ddf1ae 100644 --- a/src/tpm2/TpmEcc_Signature_SM2.c +++ b/src/tpm2/TpmEcc_Signature_SM2.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #include "Tpm.h" #include "TpmEcc_Signature_SM2_fp.h" @@ -151,9 +93,9 @@ TPM_RC TpmEcc_SignEcSm2(Crypt_Int* bnR, // OUT: 'r' component of the signature ExtMath_Add(bnR, bnE, ExtEcc_PointX(Q1)); ExtMath_Mod(bnR, order); # ifdef _SM2_SIGN_DEBUG - pAssert(TpmEccDebug_HexEqual(bnR, - "40F1EC59F793D9F49E09DCEF49130D41" - "94F79FB1EED2CAA55BACDB49C4E755D1")); + pAssert_RC(TpmEccDebug_HexEqual(bnR, + "40F1EC59F793D9F49E09DCEF49130D41" + "94F79FB1EED2CAA55BACDB49C4E755D1")); # endif // if r=0 or r+k=n, return to A3; if(ExtMath_IsZero(bnR)) @@ -167,9 +109,9 @@ TPM_RC TpmEcc_SignEcSm2(Crypt_Int* bnR, // OUT: 'r' component of the signature ExtMath_AddWord(bnT, bnD, 1); ExtMath_ModInverse(bnT, bnT, order); # ifdef _SM2_SIGN_DEBUG - pAssert(TpmEccDebug_HexEqual(bnT, - "79BFCF3052C80DA7B939E0C6914A18CB" - "B2D96D8555256E83122743A7D4F5F956")); + pAssert_RC(TpmEccDebug_HexEqual(bnT, + "79BFCF3052C80DA7B939E0C6914A18CB" + "B2D96D8555256E83122743A7D4F5F956")); # endif // compute s = t * (k - r * dA) mod n ExtMath_ModMult(bnS, bnR, bnD, order); @@ -178,9 +120,9 @@ TPM_RC TpmEcc_SignEcSm2(Crypt_Int* bnR, // OUT: 'r' component of the signature ExtMath_Add(bnS, bnK, bnS); ExtMath_ModMult(bnS, bnS, bnT, order); # ifdef _SM2_SIGN_DEBUG - pAssert(TpmEccDebug_HexEqual(bnS, - "6FC6DAC32C5D5CF10C77DFB20F7C2EB6" - "67A457872FB09EC56327A67EC7DEEBE7")); + pAssert_RC(TpmEccDebug_HexEqual(bnS, + "6FC6DAC32C5D5CF10C77DFB20F7C2EB6" + "67A457872FB09EC56327A67EC7DEEBE7")); # endif if(ExtMath_IsZero(bnS)) goto loop; @@ -190,12 +132,12 @@ TPM_RC TpmEcc_SignEcSm2(Crypt_Int* bnR, // OUT: 'r' component of the signature // is (r, s). // This is handled by the common return code # ifdef _SM2_SIGN_DEBUG - pAssert(TpmEccDebug_HexEqual(bnR, - "40F1EC59F793D9F49E09DCEF49130D41" - "94F79FB1EED2CAA55BACDB49C4E755D1")); - pAssert(TpmEccDebug_HexEqual(bnS, - "6FC6DAC32C5D5CF10C77DFB20F7C2EB6" - "67A457872FB09EC56327A67EC7DEEBE7")); + pAssert_RC(TpmEccDebug_HexEqual(bnR, + "40F1EC59F793D9F49E09DCEF49130D41" + "94F79FB1EED2CAA55BACDB49C4E755D1")); + pAssert_RC(TpmEccDebug_HexEqual(bnS, + "6FC6DAC32C5D5CF10C77DFB20F7C2EB6" + "67A457872FB09EC56327A67EC7DEEBE7")); # endif return TPM_RC_SUCCESS; } @@ -227,20 +169,20 @@ TPM_RC TpmEcc_ValidateSignatureEcSm2( # ifdef _SM2_SIGN_DEBUG // Make sure that the input signature is the test signature - pAssert(TpmEccDebug_HexEqual(bnR, - "40F1EC59F793D9F49E09DCEF49130D41" - "94F79FB1EED2CAA55BACDB49C4E755D1")); - pAssert(TpmEccDebug_HexEqual(bnS, - "6FC6DAC32C5D5CF10C77DFB20F7C2EB6" - "67A457872FB09EC56327A67EC7DEEBE7")); + pAssert_RC(TpmEccDebug_HexEqual(bnR, + "40F1EC59F793D9F49E09DCEF49130D41" + "94F79FB1EED2CAA55BACDB49C4E755D1")); + pAssert_RC(TpmEccDebug_HexEqual(bnS, + "6FC6DAC32C5D5CF10C77DFB20F7C2EB6" + "67A457872FB09EC56327A67EC7DEEBE7")); # endif // b) compute t := (r + s) mod n ExtMath_Add(bnT, bnR, bnS); ExtMath_Mod(bnT, order); # ifdef _SM2_SIGN_DEBUG - pAssert(TpmEccDebug_HexEqual(bnT, - "2B75F07ED7ECE7CCC1C8986B991F441A" - "D324D6D619FE06DD63ED32E0C997C801")); + pAssert_RC(TpmEccDebug_HexEqual(bnT, + "2B75F07ED7ECE7CCC1C8986B991F441A" + "D324D6D619FE06DD63ED32E0C997C801")); # endif // c) verify that t > 0 OK = !ExtMath_IsZero(bnT); @@ -251,10 +193,10 @@ TPM_RC TpmEcc_ValidateSignatureEcSm2( // d) compute (x, y) := [s]G + [t]Q OK = ExtEcc_PointMultiplyAndAdd(P, NULL, bnS, ecQ, bnT, E); # ifdef _SM2_SIGN_DEBUG - pAssert(OK - && TpmEccDebug_HexEqual(ExtEcc_PointX(P), - "110FCDA57615705D5E7B9324AC4B856D" - "23E6D9188B2AE47759514657CE25D112")); + pAssert_RC(OK + && TpmEccDebug_HexEqual(ExtEcc_PointX(P), + "110FCDA57615705D5E7B9324AC4B856D" + "23E6D9188B2AE47759514657CE25D112")); # endif // e) compute r' := (e + x) mod n (the x coordinate is in bnT) OK = OK && ExtMath_Add(bnRp, bnE, ExtEcc_PointX(P)); diff --git a/src/tpm2/TpmEcc_Util.c b/src/tpm2/TpmEcc_Util.c index d60f3c7a5..6e51eb5df 100644 --- a/src/tpm2/TpmEcc_Util.c +++ b/src/tpm2/TpmEcc_Util.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains utility functions to help using the external Math library @@ -109,7 +51,7 @@ LIB_EXPORT BOOL TpmEcc_PointTo2B( const Crypt_EccCurve* E // IN: curve descriptor for the point ) { - pAssert(p && ecP && E); + pAssert_BOOL(p && ecP && E); TPM_ECC_CURVE curveId = ExtEcc_CurveGetCurveId(E); NUMBYTES size = CryptEccGetKeySizeForCurve(curveId); size = (UINT16)BITS_TO_BYTES(size); diff --git a/src/tpm2/X509_spt.c b/src/tpm2/X509_spt.c index 1db7eddd9..fe78af0ae 100644 --- a/src/tpm2/X509_spt.c +++ b/src/tpm2/X509_spt.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* X509 Support */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG rants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes #include "Tpm.h" @@ -93,7 +35,7 @@ BOOL X509FindExtensionByOID(ASN1UnmarshalContext* ctxIn, // IN: the context to { INT16 length; // - pAssert(ctxIn != NULL); + pAssert_BOOL(ctxIn != NULL); // Make the search non-destructive of the input if ctx provided. Otherwise, use // the provided context. if(ctx == NULL) diff --git a/src/tpm2/crypto/openssl/CryptCmac.c b/src/tpm2/crypto/openssl/CryptCmac.c index f60dbf151..ec87b5617 100644 --- a/src/tpm2/crypto/openssl/CryptCmac.c +++ b/src/tpm2/crypto/openssl/CryptCmac.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Message Authentication Codes Based on a Symmetric Block Cipher */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2018 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // @@ -124,7 +66,7 @@ void CryptCmacData(SMAC_STATES* state, UINT32 size, const BYTE* buffer) { FOR_EACH_SYM(ENCRYPT_CASE) default: - FAIL(FATAL_ERROR_INTERNAL); + FAIL_VOID(FATAL_ERROR_INTERNAL); } while(size > 0) { @@ -175,9 +117,10 @@ CryptCmacEnd(SMAC_STATES* state, UINT32 outSize, BYTE* outBuffer) xorVal = ((subkey.t.buffer[0] & 0x80) == 0) ? 0 : 0x87; ShiftLeft(&subkey.b); subkey.t.buffer[subkey.t.size - 1] ^= xorVal; + // this is a sanity check to make sure that the algorithm is working properly. - // remove this check when debug is done - pAssert(cState->bcount <= cState->iv.t.size); + pAssert_ZERO(cState->bcount <= cState->iv.t.size); + // If the buffer is full then no need to compute subkey 2. if(cState->bcount < cState->iv.t.size) { diff --git a/src/tpm2/crypto/openssl/CryptEccKeyExchange.c b/src/tpm2/crypto/openssl/CryptEccKeyExchange.c index 090e825e9..c25cba48d 100644 --- a/src/tpm2/crypto/openssl/CryptEccKeyExchange.c +++ b/src/tpm2/crypto/openssl/CryptEccKeyExchange.c @@ -74,7 +74,7 @@ static TPM_RC C_2_2_MQV(TPMS_ECC_POINT* outZ, // OUT: the computed point // Parameter checks if(E == NULL) ERROR_EXIT(TPM_RC_VALUE); - pAssert( + pAssert_RC( outZ != NULL && pQeB != NULL && pQsB != NULL && deA != NULL && dsA != NULL); // Process: // 1. implicitsigA = (de,A + avf(Qe,A)ds,A ) mod n. @@ -159,7 +159,7 @@ static TPM_RC C_2_2_ECDH(TPMS_ECC_POINT* outZs, // OUT: Zs // Parameter checks if(E == NULL) ERROR_EXIT(TPM_RC_CURVE); - pAssert( + pAssert_RC( outZs != NULL && dsA != NULL && deA != NULL && QsB != NULL && QeB != NULL); // Do the point multiply for the Zs value ([dsA]QsB) @@ -194,7 +194,7 @@ LIB_EXPORT TPM_RC CryptEcc2PhaseKeyExchange( TPMS_ECC_POINT* QeB // IN: ephemeral public party B key ) { - pAssert( + pAssert_RC( outZ1 != NULL && dsA != NULL && deA != NULL && QsB != NULL && QeB != NULL); // Initialize the output points so that they are empty until one of the @@ -300,7 +300,8 @@ LIB_EXPORT TPM_RC SM2KeyExchange( // Parameter checks if(E == NULL) ERROR_EXIT(TPM_RC_CURVE); - pAssert(outZ != NULL && dsA != NULL && deA != NULL && QsB != NULL && QeB != NULL); + pAssert_RC( + outZ != NULL && dsA != NULL && deA != NULL && QsB != NULL && QeB != NULL); // Compute the value for w w = ComputeWForSM2(curveId); diff --git a/src/tpm2/crypto/openssl/CryptEccMain.c b/src/tpm2/crypto/openssl/CryptEccMain.c index ef84d9357..f73f8afa8 100644 --- a/src/tpm2/crypto/openssl/CryptEccMain.c +++ b/src/tpm2/crypto/openssl/CryptEccMain.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* ECC Main */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes and Defines #include "Tpm.h" @@ -64,6 +6,7 @@ #include "TpmEcc_Util_fp.h" #include "TpmEcc_Signature_ECDSA_fp.h" // required for pairwise test in key generation #include "Helpers_fp.h" // libtpms added + #if ALG_ECC //** Functions @@ -588,6 +531,7 @@ BOOL TpmEcc_GenerateKeyPair(Crypt_Int* bnD, // OUT: private scalar // Do a point multiply OK = OK && ExtEcc_PointMultiply(ecQ, NULL, bnD, E); + return OK; } @@ -715,6 +659,7 @@ LIB_EXPORT TPM_RC CryptEccPointMultiply( TpmEcc_PointTo2B(Rout, ecR, E); else ClearPoint2B(Rout); + CRYPT_CURVE_FREE(E); return retVal; } @@ -736,7 +681,7 @@ LIB_EXPORT BOOL CryptEccIsPointOnCurve( CRYPT_POINT_INITIALIZED(ecQ, Qin); BOOL OK; // - pAssert(Qin != NULL); + pAssert_BOOL(Qin != NULL); OK = (E != NULL && (ExtEcc_IsPointOnCurve(ecQ, E))); CRYPT_CURVE_FREE(E); // libtpms added return OK; diff --git a/src/tpm2/crypto/openssl/CryptEccSignature.c b/src/tpm2/crypto/openssl/CryptEccSignature.c index 395099512..4d9da51a0 100644 --- a/src/tpm2/crypto/openssl/CryptEccSignature.c +++ b/src/tpm2/crypto/openssl/CryptEccSignature.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* ECC Signatures */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes and Defines #include "Tpm.h" @@ -227,7 +169,7 @@ LIB_EXPORT TPM_RC CryptEccValidateSignature( break; # endif default: - FAIL(FATAL_ERROR_INTERNAL); + FAIL_RC(FATAL_ERROR_INTERNAL); } Exit: CRYPT_CURVE_FREE(E); @@ -270,7 +212,7 @@ LIB_EXPORT TPM_RC CryptEccCommitCompute( // Validate that the required parameters are provided. // Note: E has to be provided if computing E := [r]Q or E := [r]M. Will do // E := [r]Q if both M and B are NULL. - pAssert(r != NULL && E != NULL); + pAssert_RC(r != NULL && E != NULL); // Initialize the output points in case they are not computed ClearPoint2B(K); @@ -278,7 +220,7 @@ LIB_EXPORT TPM_RC CryptEccCommitCompute( ClearPoint2B(E); // Sizes of the r parameter may not be zero - pAssert(r->t.size > 0); + pAssert_RC(r->t.size > 0); // If B is provided, compute K=[d]B and L=[r]B if(B != NULL) @@ -288,7 +230,7 @@ LIB_EXPORT TPM_RC CryptEccCommitCompute( CRYPT_POINT_VAR(pK); CRYPT_POINT_VAR(pL); // - pAssert(d != NULL && K != NULL && L != NULL); + pAssert_RC(d != NULL && K != NULL && L != NULL); if (!curve) // libtpms added ERROR_EXIT(TPM_RC_NO_RESULT); // libtpms added @@ -318,7 +260,7 @@ LIB_EXPORT TPM_RC CryptEccCommitCompute( CRYPT_POINT_VAR(pE); // // Make sure that a place was provided for the result - pAssert(E != NULL); + pAssert_RC(E != NULL); // if this is the third point multiply, check for cancel first if((B != NULL) && _plat__IsCanceled()) diff --git a/src/tpm2/crypto/openssl/CryptHash.c b/src/tpm2/crypto/openssl/CryptHash.c index 20f259cfc..952ed3a64 100644 --- a/src/tpm2/crypto/openssl/CryptHash.c +++ b/src/tpm2/crypto/openssl/CryptHash.c @@ -358,7 +358,14 @@ void CryptDigestUpdate(PHASH_STATE hashState, // IN: the hash context informati &hashState->state.smac.state, dataSize, data); #endif // SMAC_IMPLEMENTED else - FAIL(FATAL_ERROR_INTERNAL); + { + // this void assert is OK because these values only indicate the + // intention of the hash, but don't actually affect the hash + // calculation or buffer size calculations. IOW, the failure + // set here can safely percolate out and be checked at a higher + // level. + FAIL_VOID(FATAL_ERROR_INTERNAL); + } } return; } @@ -376,7 +383,7 @@ LIB_EXPORT UINT16 CryptHashEnd(PHASH_STATE hashState, // IN: the state of hash BYTE* dOut // OUT: hash digest ) { - pAssert(hashState->type == HASH_STATE_HASH); + pAssert_ZERO(hashState->type == HASH_STATE_HASH); return HashEnd(hashState, dOutSize, dOut); } @@ -414,7 +421,10 @@ LIB_EXPORT void CryptDigestUpdate2B(PHASH_STATE state, // IN: the digest state // In CryptDigestUpdate(), if size is zero or buffer is NULL, then no change // to the digest occurs. This function should not provide a buffer if bIn is // not provided. - pAssert(bIn != NULL); + // as indicated by the comment above CryptDigestUpdate is tolerant of null, but + // we don't expect a null pointer here, so simply return but trigger failure + // mode because this is an unexpected internal programming error. + pAssert_VOID_OK(bIn != NULL); CryptDigestUpdate(state, bIn->size, bIn->buffer); return; } @@ -537,7 +547,7 @@ LIB_EXPORT UINT16 CryptHmacEnd(PHMAC_STATE state, // IN: the hash state buff return (state->hashState.state.smac.smacMethods.end)( &state->hashState.state.smac.state, dOutSize, dOut); #endif - pAssert(hState->type == HASH_STATE_HMAC); + pAssert_ZERO(hState->type == HASH_STATE_HMAC); hState->def = CryptGetHashDef(hState->hashAlg); // Change the state type for completion processing hState->type = HASH_STATE_HASH; @@ -682,7 +692,7 @@ LIB_EXPORT UINT16 CryptKDFa( HMAC_STATE hState; UINT16 digestSize = CryptHashGetDigestSize(hashAlg); - pAssert(key != NULL && keyStream != NULL); + pAssert_ZERO(key != NULL && keyStream != NULL); TPM_DO_SELF_TEST(TPM_ALG_KDF1_SP800_108); @@ -694,7 +704,7 @@ LIB_EXPORT UINT16 CryptKDFa( // If the size of the request is larger than the numbers will handle, // it is a fatal error. - pAssert(((sizeInBits + 7) / 8) <= INT16_MAX); + pAssert_ZERO(((sizeInBits + 7) / 8) <= INT16_MAX); // The number of bytes to be generated is the smaller of the sizeInBits bytes or // the number of requested blocks. The number of blocks is the smaller of the @@ -776,7 +786,8 @@ LIB_EXPORT UINT16 CryptKDFe(TPM_ALG_ID hashAlg, // IN: hash algorithm used in BYTE* stream = keyStream; INT16 bytes; // number of bytes to generate - pAssert(keyStream != NULL && Z != NULL && ((sizeInBits + 7) / 8) < INT16_MAX); + pAssert_ZERO( + keyStream != NULL && Z != NULL && ((sizeInBits + 7) / 8) < INT16_MAX); // hLen = hashDef->digestSize; bytes = (INT16)((sizeInBits + 7) / 8); diff --git a/src/tpm2/crypto/openssl/CryptPrime.c b/src/tpm2/crypto/openssl/CryptPrime.c index e2087343e..1d68f5dbd 100644 --- a/src/tpm2/crypto/openssl/CryptPrime.c +++ b/src/tpm2/crypto/openssl/CryptPrime.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Code for prime validation. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the code for prime validation. @@ -470,9 +412,9 @@ TPM_RC TpmRsa_GeneratePrimeForRSA( BOOL found = FALSE; // // Make sure that the prime is large enough - pAssert(prime->allocated >= BITS_TO_CRYPT_WORDS(bits)); + pAssert_RC(prime->allocated >= BITS_TO_CRYPT_WORDS(bits)); // Only try to handle specific sizes of keys in order to save overhead - pAssert((bits % 32) == 0); + pAssert_RC((bits % 32) == 0); prime->size = BITS_TO_CRYPT_WORDS(bits); diff --git a/src/tpm2/crypto/openssl/CryptRand.c b/src/tpm2/crypto/openssl/CryptRand.c index 73a722d3d..d60460b89 100644 --- a/src/tpm2/crypto/openssl/CryptRand.c +++ b/src/tpm2/crypto/openssl/CryptRand.c @@ -179,7 +179,8 @@ static void DfUpdate(PDF_STATE dfState, int size, const BYTE* data) data += toFill; // increase the buffer contents count by the amount copied dfState->contents += toFill; - pAssert(dfState->contents <= DRBG_IV_SIZE_BYTES); + // error will eventually get handled + pAssert_VOID_OK(dfState->contents <= DRBG_IV_SIZE_BYTES); // If we have a full buffer, do a computation pass. if(dfState->contents == DRBG_IV_SIZE_BYTES) DfCompute(dfState); @@ -253,7 +254,7 @@ BOOL DRBG_GetEntropy(UINT32 requiredEntropy, // IN: requested number of bytes o { // In self-test, the caller should be asking for exactly the seed // size of entropy. - pAssert(requiredEntropy == sizeof(DRBG_NistTestVector_Entropy)); + pAssert_BOOL(requiredEntropy == sizeof(DRBG_NistTestVector_Entropy)); memcpy(entropy, DRBG_NistTestVector_Entropy, sizeof(DRBG_NistTestVector_Entropy)); @@ -388,7 +389,7 @@ static BOOL DRBG_Update( memset(&localKeySchedule, 0, sizeof(localKeySchedule)); /* libtpms added: coverity */ // - pAssert(drbgState->magic == DRBG_MAGIC); + pAssert_BOOL(drbgState->magic == DRBG_MAGIC); // If an key schedule was not provided, make one if(keySchedule == NULL) @@ -428,7 +429,7 @@ BOOL DRBG_Reseed(DRBG_STATE* drbgState, // IN: the state to update { DRBG_SEED seed; - pAssert((drbgState != NULL) && (drbgState->magic == DRBG_MAGIC)); + pAssert_BOOL((drbgState != NULL) && (drbgState->magic == DRBG_MAGIC)); if(providedEntropy == NULL) { @@ -465,7 +466,7 @@ BOOL DRBG_SelfTest(void) BYTE* p; DRBG_STATE testState; // - pAssert(!IsSelfTest()); + pAssert_BOOL(!IsSelfTest()); // no recursion SetSelfTest(); SetDrbgTested(); @@ -546,7 +547,7 @@ LIB_EXPORT TPM_RC CryptRandomStir(UINT16 additionalDataSize, BYTE* additionalDat &tmpBuf, DfBuffer(&dfResult, additionalDataSize, additionalData)); drbgDefault.reseedCounter = 1; - + VERIFY_NOT_FAILED(); return TPM_RC_SUCCESS; #else @@ -671,7 +672,7 @@ LIB_EXPORT TPM_RC DRBG_InstantiateSeeded( // Used the derivation function output as the "entropy" input. This is not // how it is described in SP800-90A but this is the equivalent function DRBG_Reseed(((DRBG_STATE*)drbgState), DfEnd(&dfState), NULL); - + VERIFY_NOT_FAILED(); return TPM_RC_SUCCESS; } @@ -901,7 +902,8 @@ LIB_EXPORT BOOL DRBG_Instantiate( DRBG_SEED seed; DRBG_SEED dfResult; // - pAssert((pSize == 0) || (pSize <= sizeof(seed)) || (personalization != NULL)); + pAssert_BOOL( + (pSize == 0) || (pSize <= sizeof(seed)) || (personalization != NULL)); // If the DRBG has not been tested, test when doing an instantiation. Since // Instantiation is called during self test, make sure we don't get stuck in a // loop. @@ -920,6 +922,7 @@ LIB_EXPORT BOOL DRBG_Instantiate( // and do a reseed. DRBG_Reseed(drbgState, &seed, DfBuffer(&dfResult, pSize, personalization)); + VERIFY(!g_inFailureMode, FATAL_ERROR_ENTROPY, TPM_RC_FAILURE); return TRUE; } diff --git a/src/tpm2/crypto/openssl/CryptSym.c b/src/tpm2/crypto/openssl/CryptSym.c index 70d52f286..9564627e6 100644 --- a/src/tpm2/crypto/openssl/CryptSym.c +++ b/src/tpm2/crypto/openssl/CryptSym.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Symmetric block cipher modes */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-clause //** Introduction // @@ -177,7 +119,7 @@ LIB_EXPORT TPM_RC CryptSymmetricEncrypt( BYTE* iv; BYTE defaultIv[MAX_SYM_BLOCK_SIZE] = {0}; // - pAssert(dOut != NULL && key != NULL && dIn != NULL); + pAssert_RC(dOut != NULL && key != NULL && dIn != NULL); memset((void *)&keySchedule, 0, sizeof(keySchedule)); /* silence false positive; coverity */ memset(tmp, 0, sizeof(tmp)); if(dSize == 0) @@ -342,7 +284,7 @@ LIB_EXPORT TPM_RC CryptSymmetricDecrypt( encrypt = NULL; decrypt = NULL; - pAssert(dOut != NULL && key != NULL && dIn != NULL); + pAssert_RC(dOut != NULL && key != NULL && dIn != NULL); if(dSize == 0) return TPM_RC_SUCCESS; @@ -565,7 +507,7 @@ CryptSymmetricEncrypt( UINT16 keyToUseLen = (UINT16)sizeof(keyToUse); TPM_RC retVal = TPM_RC_SUCCESS; - pAssert(dOut != NULL && key != NULL && dIn != NULL); + pAssert_RC(dOut != NULL && key != NULL && dIn != NULL); if(dSize == 0) return TPM_RC_SUCCESS; TPM_DO_SELF_TEST(algorithm); @@ -623,7 +565,7 @@ CryptSymmetricEncrypt( EVP_EncryptUpdate(ctx, pOut, &outlen1, dIn, dSize) != 1) ERROR_EXIT(TPM_RC_FAILURE); - pAssert(outlen1 <= dSize || dSize >= outlen1 + blockSize); + pAssert_RC(outlen1 <= dSize || dSize >= outlen1 + blockSize); if (EVP_EncryptFinal_ex(ctx, pOut + outlen1, &outlen2) != 1) ERROR_EXIT(TPM_RC_FAILURE); @@ -677,7 +619,7 @@ CryptSymmetricDecrypt( // in case statements and it can't tell if they are always initialized // when needed, so... Comment these out if the compiler can tell or doesn't // care that these are initialized before use. - pAssert(dOut != NULL && key != NULL && dIn != NULL); + pAssert_RC(dOut != NULL && key != NULL && dIn != NULL); if(dSize == 0) return TPM_RC_SUCCESS; TPM_DO_SELF_TEST(algorithm); @@ -736,20 +678,20 @@ CryptSymmetricDecrypt( EVP_DecryptUpdate(ctx, buffer, &outlen1, dIn, dSize) != 1) ERROR_EXIT(TPM_RC_FAILURE); - pAssert((int)buffersize >= outlen1); + pAssert_RC((int)buffersize >= outlen1); if ((int)buffersize <= outlen1 /* coverity */ || EVP_DecryptFinal(ctx, &buffer[outlen1], &outlen2) != 1) ERROR_EXIT(TPM_RC_FAILURE); - pAssert((int)buffersize >= outlen1 + outlen2); + pAssert_RC((int)buffersize >= outlen1 + outlen2); if (ivInOut) retVal = CryptSymmetricGetUpdatedIV(ctx, ivInOut); Exit: if (retVal == TPM_RC_SUCCESS) { - pAssert(dSize >= outlen1 + outlen2); + pAssert_RC(dSize >= outlen1 + outlen2); memcpy(dOut, buffer, outlen1 + outlen2); } From f0a2f661d5c3a320b20a4adb9094d216fc4e6c90 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 13:04:12 -0400 Subject: [PATCH 28/52] Sync: Rework failure handling and replace g_inFailureMode Signed-off-by: Stefan Berger --- src/Makefile.am | 3 + src/tpm2/BaseTypes.h | 7 + src/tpm2/BnMath.c | 61 +----- src/tpm2/CommandDispatcher.c | 3 +- src/tpm2/CryptSelfTest.c | 65 +----- src/tpm2/CryptUtil.c | 6 +- src/tpm2/ExecCommand.c | 81 ++++--- src/tpm2/ExecCommand_fp.h | 66 +----- src/tpm2/Failure.c | 156 ++++++++++++++ src/tpm2/Global.h | 21 -- src/tpm2/GpMacros.h | 102 +++++---- src/tpm2/MathLibraryInterface.h | 2 +- src/tpm2/NVMarshal.c | 29 ++- src/tpm2/Platform.h | 63 +----- src/tpm2/PlatformInternal.h | 11 + src/tpm2/RunCommand.c | 45 +--- src/tpm2/SessionProcess.c | 2 +- src/tpm2/TpmBuildSwitches.h | 8 +- src/tpm2/TpmFail.c | 249 ++++++++++------------ src/tpm2/TpmFail_fp.h | 98 ++------- src/tpm2/TpmMath_Util.c | 62 +----- src/tpm2/VerifyConfiguration.h | 1 + src/tpm2/Volatile.c | 2 +- src/tpm2/_TPM_Init.c | 22 +- src/tpm2/crypto/CryptEccMain_fp.h | 1 + src/tpm2/crypto/openssl/CryptEccMain.c | 8 +- src/tpm2/crypto/openssl/CryptPrime.c | 8 +- src/tpm2/crypto/openssl/CryptPrimeSieve.c | 64 +----- src/tpm2/crypto/openssl/CryptRand.c | 3 +- src/tpm2/crypto/openssl/CryptRsa.c | 6 +- src/tpm2/platform_failure_mode_fp.h | 56 +++++ src/tpm2/tpm_to_platform_interface.h | 7 +- src/tpm_tpm2_interface.c | 11 +- 33 files changed, 564 insertions(+), 765 deletions(-) create mode 100644 src/tpm2/Failure.c create mode 100644 src/tpm2/PlatformInternal.h create mode 100644 src/tpm2/platform_failure_mode_fp.h diff --git a/src/Makefile.am b/src/Makefile.am index 3bf0b5e77..83a5c158e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -226,6 +226,7 @@ libtpms_tpm2_la_SOURCES = \ tpm2/EphemeralCommands.c \ tpm2/ExecCommand.c \ tpm2/ExtraData.c \ + tpm2/Failure.c \ tpm2/Global.c \ tpm2/Handle.c \ tpm2/HashCommands.c \ @@ -481,6 +482,8 @@ noinst_HEADERS += \ tpm2/PlatformACT_fp.h \ tpm2/PlatformClock.h \ tpm2/PlatformData.h \ + tpm2/PlatformInternal.h \ + tpm2/platform_failure_mode_fp.h \ tpm2/platform_init_fp.h \ tpm2/platform_public_interface.h \ tpm2/platform_pcr_fp.h \ diff --git a/src/tpm2/BaseTypes.h b/src/tpm2/BaseTypes.h index 861c06bac..fff55b9b1 100644 --- a/src/tpm2/BaseTypes.h +++ b/src/tpm2/BaseTypes.h @@ -25,4 +25,11 @@ typedef int32_t INT32; typedef uint64_t UINT64; typedef int64_t INT64; +// declare function noreturn macro based on whether longjmp is enabled +#if LONGJMP_SUPPORTED +# define NORETURN_IF_LONGJMP NORETURN +#else +# define NORETURN_IF_LONGJMP +#endif + #endif // _TPM_INCLUDE_PUBLIC_BASETYPES_H_ diff --git a/src/tpm2/BnMath.c b/src/tpm2/BnMath.c index 34690c251..bfd917007 100644 --- a/src/tpm2/BnMath.c +++ b/src/tpm2/BnMath.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Simple Operations on Big Numbers */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // The simulator code uses the canonical form whenever possible in order to make @@ -89,7 +31,6 @@ #include "Tpm.h" // libtpms: for CryptRand.h #include "TpmMath_Util_fp.h" // libtpms: added #include "TpmBigNum.h" -extern BOOL g_inFailureMode; // can't use global.h because we can't use tpm.h // A constant value of zero as a stand in for NULL bigNum values const bignum_t BnConstZero = {1, 0, {0}}; diff --git a/src/tpm2/CommandDispatcher.c b/src/tpm2/CommandDispatcher.c index 8b0ea4c4f..18c503747 100644 --- a/src/tpm2/CommandDispatcher.c +++ b/src/tpm2/CommandDispatcher.c @@ -345,7 +345,8 @@ CommandDispatcher(COMMAND* command) // no pointers to data, all of the data being returned has to be in the // command action output buffer. If we try to marshal more bytes than // could fit into the output buffer, we need to fail. - for(; (dType = (type & 0x7F)) <= RESPONSE_PARAMETER_LAST_TYPE && !g_inFailureMode; + for(; (dType = (type & 0x7F)) <= RESPONSE_PARAMETER_LAST_TYPE + && !_plat__InFailureMode(); type = *types++) { #if TABLE_DRIVEN_MARSHAL diff --git a/src/tpm2/CryptSelfTest.c b/src/tpm2/CryptSelfTest.c index 525aadbff..87fe3d50a 100644 --- a/src/tpm2/CryptSelfTest.c +++ b/src/tpm2/CryptSelfTest.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Self-Test of Cryptographic Functions */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // The functions in this file are designed to support self-test of cryptographic @@ -116,10 +58,7 @@ TPM_RC CryptSelfTest(TPMI_YES_NO fullTest // IN: if full test is required ) { -#if ALLOW_FORCE_FAILURE_MODE - if(g_forceFailureMode) - FAIL(FATAL_ERROR_FORCED); -#endif + // If the caller requested a full test, then reset the to test vector so that // all the tests will be run diff --git a/src/tpm2/CryptUtil.c b/src/tpm2/CryptUtil.c index 7f52cdcdc..aea0076e4 100644 --- a/src/tpm2/CryptUtil.c +++ b/src/tpm2/CryptUtil.c @@ -226,7 +226,7 @@ static TPM_RC CryptGenerateKeyedHash( sensitive->sensitive.bits.t.size = DRBG_Generate(rand, sensitive->sensitive.bits.t.buffer, digestSize); if(sensitive->sensitive.bits.t.size == 0) - return (g_inFailureMode) ? TPM_RC_FAILURE : TPM_RC_NO_RESULT; + return (_plat__InFailureMode()) ? TPM_RC_FAILURE : TPM_RC_NO_RESULT; } return TPM_RC_SUCCESS; } @@ -409,7 +409,7 @@ static TPM_RC CryptGenerateKeySymmetric( { sensitive->sensitive.sym.t.size = DRBG_Generate( rand, sensitive->sensitive.sym.t.buffer, BITS_TO_BYTES(keyBits)); - if(g_inFailureMode) + if(_plat__InFailureMode()) result = TPM_RC_FAILURE; else if(sensitive->sensitive.sym.t.size == 0) result = TPM_RC_NO_RESULT; @@ -1229,7 +1229,7 @@ CryptCreateObject(OBJECT* object, // IN: new object structure po DRBG_Generate(rand, sensitive->seedValue.t.buffer, CryptHashGetDigestSize(publicArea->nameAlg)); - if(g_inFailureMode) + if(_plat__InFailureMode()) return TPM_RC_FAILURE; else if(sensitive->seedValue.t.size == 0) return TPM_RC_NO_RESULT; diff --git a/src/tpm2/ExecCommand.c b/src/tpm2/ExecCommand.c index 943425664..90487dfc2 100644 --- a/src/tpm2/ExecCommand.c +++ b/src/tpm2/ExecCommand.c @@ -97,7 +97,7 @@ LIB_EXPORT void ExecuteCommand( FAIL_NORET(FATAL_ERROR_NO_INIT); } - if(g_inFailureMode) + if(_plat__InFailureMode()) { // Do failure mode processing TpmFailureMode(requestSize, request, responseSize, response); @@ -272,45 +272,60 @@ LIB_EXPORT void ExecuteCommand( } Cleanup: - if(g_clearOrderly == TRUE && NV_IS_ORDERLY) + if(!_plat__InFailureMode()) { + if(g_clearOrderly == TRUE && NV_IS_ORDERLY) + { #if USE_DA_USED - gp.orderlyState = g_daUsed ? SU_DA_USED_VALUE : SU_NONE_VALUE; + gp.orderlyState = g_daUsed ? SU_DA_USED_VALUE : SU_NONE_VALUE; #else - gp.orderlyState = SU_NONE_VALUE; + gp.orderlyState = SU_NONE_VALUE; #endif - NV_SYNC_PERSISTENT(orderlyState); - } - // This implementation loads an "evict" object to a transient object slot in - // RAM whenever an "evict" object handle is used in a command so that the - // access to any object is the same. These temporary objects need to be - // cleared from RAM whether the command succeeds or fails. - ObjectCleanupEvict(); + NV_SYNC_PERSISTENT(orderlyState); + } + // This implementation loads an "evict" object to a transient object slot in + // RAM whenever an "evict" object handle is used in a command so that the + // access to any object is the same. These temporary objects need to be + // cleared from RAM whether the command succeeds or fails. + ObjectCleanupEvict(); - // The parameters and sessions have been marshaled. Now tack on the header and - // set the sizes - BuildResponseHeader(&command, *response, result); + // The parameters and sessions have been marshaled. Now tack on the header and + // set the sizes. This sets command.parameterSize to the size of the entire + // response. + BuildResponseHeader(&command, *response, result); - // Try to commit all the writes to NV if any NV write happened during this - // command execution. This check should be made for both succeeded and failed - // commands, because a failed one may trigger a NV write in DA logic as well. - // This is the only place in the command execution path that may call the NV - // commit. If the NV commit fails, the TPM should be put in failure mode. - if((g_updateNV != UT_NONE) && !g_inFailureMode) - { - if(g_updateNV == UT_ORDERLY) - NvUpdateIndexOrderlyData(); - if(!NvCommit()) - FAIL(FATAL_ERROR_INTERNAL); - g_updateNV = UT_NONE; - } - pAssert_NORET((UINT32)command.parameterSize <= maxResponse); + // Try to commit all the writes to NV if any NV write happened during this + // command execution. This check should be made for both succeeded and failed + // commands, because a failed one may trigger a NV write in DA logic as well. + // This is the only place in the command execution path that may call the NV + // commit. If the NV commit fails, the TPM should be put in failure mode. + // Don't write in failure mode because we can't trust what we are + // writing. + if((g_updateNV != UT_NONE) && !_plat__InFailureMode()) + { + if(g_updateNV == UT_ORDERLY) + { + NvUpdateIndexOrderlyData(); + } + if(!NvCommit()) + { + FAIL_NORET(FATAL_ERROR_INTERNAL); + } + g_updateNV = UT_NONE; + } + + pAssert_NORET((UINT32)command.parameterSize <= maxResponse); - // Clear unused bits in response buffer. - MemorySet(*response + *responseSize, 0, maxResponse - *responseSize); + // Clear unused bits in response buffer. + MemorySet(*response + *responseSize, 0, maxResponse - *responseSize); - // as a final act, and not before, update the response size. - *responseSize = (UINT32)command.parameterSize; + // as a final act, and not before, update the response size. + *responseSize = (UINT32)command.parameterSize; + } - return; + if(_plat__InFailureMode()) + { + // something in the command triggered failure mode - handle command as a failure instead + TpmFailureMode(requestSize, request, responseSize, response); + } } diff --git a/src/tpm2/ExecCommand_fp.h b/src/tpm2/ExecCommand_fp.h index c2d25d6eb..b858b0ddb 100644 --- a/src/tpm2/ExecCommand_fp.h +++ b/src/tpm2/ExecCommand_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ExecCommand_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -99,10 +40,9 @@ // // 'request' and 'response' may point to the same buffer // -// Note: As of February, 2016, the failure processing has been moved to the +// Note: The failure processing has been moved to the // platform-specific code. When the TPM code encounters an unrecoverable failure, it -// will SET g_inFailureMode and call _plat__Fail(). That function should not return -// but may call ExecuteCommand(). +// will call _plat__Fail() and call _plat__InFailureMode() to query failure mode. // LIB_EXPORT void ExecuteCommand( uint32_t requestSize, // IN: command buffer size diff --git a/src/tpm2/Failure.c b/src/tpm2/Failure.c new file mode 100644 index 000000000..78e62c594 --- /dev/null +++ b/src/tpm2/Failure.c @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: BSD-2-Clause + +//** Includes and locals +#include "Platform.h" +#include +#include +#include + +#if LONGJMP_SUPPORTED +// in RunCommand.c +extern jmp_buf s_FailureModeJumpBuffer; +#endif + +#if ALLOW_FORCE_FAILURE_MODE +static BOOL s_forceFailureMode; // flag to force failure mode during test +BOOL _plat_internal_IsForceFailureMode() +{ + return s_forceFailureMode; +} +LIB_EXPORT void _plat__SetForceFailureMode() +{ + s_forceFailureMode = TRUE; +} +#endif + +#if FAIL_TRACE +// The name of the function that triggered failure mode. +static const char* s_failFunctionName; +// The line in the file at which the error was signaled. +static uint32_t s_failLine; +#endif // FAIL_TRACE + +// A numeric indicator of the location that triggered failure mode. +static uint64_t s_failureLocation; +// the reason for the failure. +static uint32_t s_failCode; +static BOOL s_IsInFailureMode = FALSE; + +void _plat_internal_resetFailureData() +{ +#if ALLOW_FORCE_FAILURE_MODE + s_forceFailureMode = FALSE; +#endif + +#if FAIL_TRACE + // The name of the function that triggered failure mode. + s_failFunctionName = NULL; + // The line in the file at which the error was signaled. + s_failLine = 0; +#endif // FAIL_TRACE + + // A numeric indicator of the location that triggered failure mode. + s_failureLocation = 0; + // the reason for the failure. + s_failCode = 0; + s_IsInFailureMode = FALSE; +} + +// Indicates to the TPM Library that a failure has occurred. +// This is REQURIED to return true after any call to _plat__Fail. +// It MAY return true for any other reason the platform deems appropriate. +LIB_EXPORT BOOL _plat__InFailureMode() +{ + return s_IsInFailureMode; +} + +LIB_EXPORT void _plat__SetInFailureMode(BOOL inFailureMode) // libtpms added begin +{ + s_IsInFailureMode = inFailureMode; +} + +LIB_EXPORT void _plat__SetFailureModeParameters( +#if FAIL_TRACE + const char* function, + int line, +#endif + int failureCode) +{ + s_failCode = failureCode; + s_failureLocation = 0; +#if FAIL_TRACE + s_failFunctionName = function; + s_failLine = line; +#endif +} // libtpms added end + +//***_plat__Fail() +// A function for the TPM to call the platform to indicate the +// TPM code has detected a failure. +LIB_EXPORT NORETURN_IF_LONGJMP void _plat__Fail( +#if FAIL_TRACE + const char* function, + int line, +#endif + uint64_t locationCode, + int failureCode) +{ +#if ALLOW_FORCE_FAILURE_MODE + // The simulator asserts during unexpected (i.e. un-forced) failure mode + // to allow debugging. + if(!_plat_internal_IsForceFailureMode()) + { + fprintf(stderr, "Unexpected failure mode (code %d) in ", s_failCode); + uint32_t failureLocation_low = (uint32_t)(_plat__GetFailureLocation()); + uint32_t failureLocation_hi = (uint32_t)(_plat__GetFailureLocation() >> 32); + fprintf( + stderr, "Location: %08x:%08x", failureLocation_hi, failureLocation_low); + +# if FAIL_TRACE + fprintf(stderr, "function '%s' (line %d)\n", s_failFunctionName, s_failLine); +# endif // FAIL_TRACE + assert(FALSE); + } +#endif + + // don't update if we are already in failure mode. + if(!_plat__InFailureMode()) + { + s_IsInFailureMode = TRUE; + s_failCode = failureCode; + s_failureLocation = locationCode; +#if FAIL_TRACE + s_failFunctionName = function; + s_failLine = line; +#endif +#if ALLOW_FORCE_FAILURE_MODE + s_forceFailureMode = FALSE; +#endif + } + +#if LONGJMP_SUPPORTED + longjmp(&s_FailureModeJumpBuffer[0], 1); +#endif +} + +LIB_EXPORT UINT32 _plat__GetFailureCode() +{ + return s_failCode; +} + +LIB_EXPORT uint64_t _plat__GetFailureLocation() +{ + return s_failureLocation; +} + +#if FAIL_TRACE +LIB_EXPORT const char* _plat__GetFailureFunctionName() +{ + return s_failFunctionName; +} + +LIB_EXPORT uint32_t _plat__GetFailureLine() +{ + return s_failLine; +} +#endif diff --git a/src/tpm2/Global.h b/src/tpm2/Global.h index 6eebd4820..3faab678b 100644 --- a/src/tpm2/Global.h +++ b/src/tpm2/Global.h @@ -1478,27 +1478,6 @@ EXTERN UINT32 s_actionIoAllocation; // number of UIN64 allocated for the // action input structure # endif // IO_BUFFER_C -//***************************************************************************** -//*** From TPMFail.c -//***************************************************************************** -// This value holds the address of the string containing the name of the function -// in which the failure occurred. This address value is not useful for anything -// other than helping the vendor to know in which file the failure occurred. -EXTERN BOOL g_inFailureMode; // Indicates that the TPM is in failure mode -# if ALLOW_FORCE_FAILURE_MODE -EXTERN BOOL g_forceFailureMode; // flag to force failure mode during test -# endif - -typedef void(FailFunction)(const char *function, int line, int code); -#if defined TPM_FAIL_C || defined GLOBAL_C || 1 -EXTERN UINT32 s_failFunction; -// The line in the file at which the error was signaled. -EXTERN UINT32 s_failLine; -// the reason for the failure. -EXTERN UINT32 s_failCode; -EXTERN FailFunction *LibFailCallback; -#endif // TPM_FAIL_C - //***************************************************************************** //*** From ACT_spt.c //***************************************************************************** diff --git a/src/tpm2/GpMacros.h b/src/tpm2/GpMacros.h index 7bb981f22..001f3b6f0 100644 --- a/src/tpm2/GpMacros.h +++ b/src/tpm2/GpMacros.h @@ -12,6 +12,7 @@ #include "endian_swap.h" #include "VendorInfo.h" +#include "TpmFail_fp.h" //** For Self-test // These macros are used in CryptUtil to invoke the incremental self test. @@ -33,23 +34,28 @@ # define FUNCTION_NAME __FUNCTION__ #endif -#if defined(FAIL_TRACE) && FAIL_TRACE != 0 -# define CODELOCATOR() FUNCTION_NAME, __LINE__ +// CODELOCATOR, if defined, returns a 64-bit vendor-defined value that indicates where +// an event has occurred in the program. This is a placeholder in the +// case it is not defined. +#ifndef CODELOCATOR +# define CODELOCATOR() (0ull) +#endif + +// Use no Parens in this macro value because it is pasted into a function call below +#if defined(FAIL_TRACE) && FAIL_TRACE != NO +# define FAILLOCATOR() FUNCTION_NAME, __LINE__, CODELOCATOR() #else // !FAIL_TRACE -// if provided, use the definition of CODELOCATOR from TpmConfiguration so -// implementor can customize this. -# ifndef CODELOCATOR -# define CODELOCATOR() 0 -# endif +# define FAILLOCATOR() CODELOCATOR() #endif // FAIL_TRACE -// SETFAILED calls TpmFail. It may or may not return based on the NO_LONGJMP flag. -// CODELOCATOR is a macro that expands to either one 64-bit value that encodes the -// location, or two parameters: Function Name and Line Number. -#define SETFAILED(errorCode) (TpmFail(CODELOCATOR(), errorCode)) +// SETFAILED calls EnterFailureMode. It may or may not return based on the +// LONGJMP_SUPPORTED flag. FAILLOCATOR is a macro that expands to either one +// 64-bit value that encodes the location, or two parameters: Function Name and +// Line Number. +#define SETFAILED(errorCode) (EnterFailureMode(FAILLOCATOR(), errorCode)) -// If implementation is using longjmp, then calls to TpmFail() will never -// return. However, without longjmp facility, TpmFail will return while most of +// If implementation is using longjmp, then calls to EnterFailureMode() will never +// return. However, without longjmp facility, EnterFailureMode will return while most of // the code currently expects FAIL() calls to immediately abort the current // command. If they don't, some commands return success instead of failure. The // family of macros below are provided to allow the code to be modified to @@ -73,22 +79,19 @@ // // The TPM library was originally written with a lot of error checking omitted, // which means code occurring after a FAIL macro may not expect to be called -// when the TPM is in failure mode. When NO_LONGJMP is false (the system has a -// longjmp API), then none of that code is executed because the sample platform -// sets up longjmp before calling ExecuteCommand. However, in the NO_LONGJMP -// case, code following a FAIL or FAIL_NORET macro will get run. The -// conservative assumption is that code is untested and may be unsafe in such a -// situation. FAIL_NORET can replace FAIL when the code has been reviewed to -// ensure the post-FAIL code is safe. Of course, this is a point-in-time -// assertion that is only true when the FAIL_NORET macro is first inserted; -// hence it is better to use one of the early-exit macros to immediately return. -// However, the necessary return-code plumbing may be large and FAIL/FAIL_NORET -// are provided to support gradual improvement over time. - -#ifndef NO_LONGJMP -// has longjmp -// necesary to reference Exit, even though the code is no-return -# define TPM_FAIL_RETURN NORETURN void +// when the TPM is in failure mode. When LONGJMP_SUPPORTED is true (the system +// has a longjmp API), then none of that code is executed because the sample +// platform sets up longjmp before calling ExecuteCommand. However, in the +// !LONGJMP_SUPPORTED case, code following a FAIL or FAIL_NORET macro will get +// run. The conservative assumption is that code is untested and may be unsafe +// in such a situation. FAIL_NORET can replace FAIL when the code has been +// reviewed to ensure the post-FAIL code is safe. Of course, this is a +// point-in-time assertion that is only true when the FAIL_NORET macro is first +// inserted; hence it is better to use one of the early-exit macros to +// immediately return. However, the necessary return-code plumbing may be large +// and FAIL/FAIL_NORET are provided to support gradual improvement over time. + +#if LONGJMP_SUPPORTED // see discussion above about FAIL/FAIL_NORET # define FAIL(failCode) SETFAILED(failCode) @@ -105,9 +108,7 @@ goto Exit; \ } while(0) -#else // NO_LONGJMP -// no longjmp service is available -# define TPM_FAIL_RETURN void +#else // !LONGJMP_SUPPORTED // This macro is provided for existing code and should not be used in new code. // see discussion above. @@ -150,7 +151,7 @@ goto Exit; \ } while(0) -#endif +#endif // !LONGJMP_SUPPORTED // This macro tests that a condition is TRUE and puts the TPM into failure mode // if it is not. If longjmp is being used, then the macro makes a call from @@ -183,7 +184,7 @@ #define VERIFY_RC(rc) \ do \ { \ - if(g_inFailureMode) \ + if(_plat__InFailureMode()) \ { \ return TPM_RC_FAILURE; \ } \ @@ -197,7 +198,7 @@ #define VERIFY_NOT_FAILED() \ do \ { \ - if(g_inFailureMode) \ + if(_plat__InFailureMode()) \ { \ return TPM_RC_FAILURE; \ } \ @@ -207,7 +208,7 @@ #define VERIFY_RC_VOID(rc) \ do \ { \ - if(g_inFailureMode) \ + if(_plat__InFailureMode()) \ { \ return; \ } \ @@ -242,10 +243,10 @@ #define VERIFY_CRYPTO_OR_NULL(fn) VERIFY((fn), FATAL_ERROR_CRYPTO, NULL) // these VERIFY_CRYPTO macros all set a result value and goto Exit -#define VERIFY_CRYPTO_OR_EXIT(fn, returnVar, returnCode) \ +#define VERIFY_CRYPTO_OR_EXIT_GENERIC(fn, returnVar, returnCode) \ VERIFY_OR_EXIT(fn, FATAL_ERROR_CRYPTO, returnVar, returnCode); -// these VERIFY_CRYPTO_OR_EXIT functions assume the return value variable is +// these VERIFY_CRYPTO_OR_EXIT_* functions assume the return value variable is // named retVal #define VERIFY_CRYPTO_OR_EXIT_RC(fn) \ VERIFY_CRYPTO_OR_EXIT_GENERIC(fn, retVal, TPM_RC_FAILURE) @@ -263,14 +264,24 @@ } \ } while(0) +// pAsserts can assertions that can be compiled out. +// unlike VERIFY which is always run. +// The pAssert macros set failure mode and set the error code +// to FATAL_ERROR_ASSERT. #if (defined EMPTY_ASSERT) && (EMPTY_ASSERT != NO) # define pAssert(a) ((void)0) +# define pAssert_ZERO(a) +# define pAssert_RC(a) +# define pAssert_BOOL(a) +# define pAssert_NULL(a) +# define pAssert_NORET(a) +# define pAssert_VOID_OK(a) #else # define pAssert(a) \ do \ { \ if(!(a)) \ - FAIL(FATAL_ERROR_PARAMETER); \ + FAIL(FATAL_ERROR_ASSERT); \ } while(0) # define pAssert_ZERO(a) \ @@ -322,6 +333,11 @@ #endif +// pAssert_SKIPPED indicates a pAssert that was left as-is on purpose. +// because the code is dead/unsupported, or the work is left for a future +// review. +#define pAssert_SKIPPED(a) pAssert(a) + // These macros are commonly used in the "Crypt" code as a way to keep listings from // getting too long. This is not to save paper but to allow one to see more // useful stuff on the screen at any given time. Neither macro sets failure mode. @@ -332,13 +348,13 @@ goto Exit; \ } while(0) -// braces are necessary for this usage: +// The do loop is to prevent confusion in cases such as this: // if (y) // GOTO_ERROR_UNLESS(x) // else ... -// without braces the else would attach to the GOTO macro instead of the -// outer if statement; given the amount of TPM code that doesn't use braces on -// if statements, this is a live risk. +// without braces or the do statement, the else would attach to the GOTO macro +// instead of the outer if statement; given the amount of TPM code that doesn't +// use braces on if statements, this is a live risk. #define GOTO_ERROR_UNLESS(_X) \ do \ { \ diff --git a/src/tpm2/MathLibraryInterface.h b/src/tpm2/MathLibraryInterface.h index 87cb02973..b1544807f 100644 --- a/src/tpm2/MathLibraryInterface.h +++ b/src/tpm2/MathLibraryInterface.h @@ -354,7 +354,7 @@ LIB_EXPORT const Crypt_EccCurve* ExtEcc_CurveInitialize(Crypt_EccCurve* E, //*** ExtEcc_CurveFree() // This function will free the allocated components of the curve and end the // frame in which the curve data exists. -// WARNING: Not guaranteed to be called in presence of LONGJMP. +// WARNING: Not guaranteed to be called in presence of LONGJMP_SUPPORTED. LIB_EXPORT void ExtEcc_CurveFree(const Crypt_EccCurve* E); // ################# diff --git a/src/tpm2/NVMarshal.c b/src/tpm2/NVMarshal.c index 6e195b275..d57961c2b 100644 --- a/src/tpm2/NVMarshal.c +++ b/src/tpm2/NVMarshal.c @@ -56,6 +56,7 @@ #include "Simulator_fp.h" #include "BackwardsCompatibilityBitArray.h" #include "BackwardsCompatibilityObject.h" +#include "platform_failure_mode_fp.h" #define TPM_HAVE_TPM2_DECLARATIONS #include "tpm_library_intern.h" @@ -2928,6 +2929,8 @@ VolatileState_Marshal(BYTE **buffer, INT32 *size, struct RuntimeProfile *Runtime TPM2B_AUTH unused = { .b.size = 0, }; + BOOL inFailureMode; + UINT32 failFunction, failLine, failCode; written = NV_HEADER_Marshal(buffer, size, VOLATILE_STATE_VERSION, VOLATILE_STATE_MAGIC, @@ -3172,7 +3175,8 @@ VolatileState_Marshal(BYTE **buffer, INT32 *size, struct RuntimeProfile *Runtime /* s_actionInputBuffer: skip; only used during a single command */ /* s_actionOutputBuffer: skip; only used during a single command */ #endif - written += BOOL_Marshal(&g_inFailureMode, buffer, size); /* line 1078 */ + inFailureMode = _plat__InFailureMode(); + written += BOOL_Marshal(&inFailureMode, buffer, size); /* line 1078 */ /* TPM established bit */ tpmEst = _rpc__Signal_GetTPMEstablished(); @@ -3187,9 +3191,12 @@ VolatileState_Marshal(BYTE **buffer, INT32 *size, struct RuntimeProfile *Runtime written += BLOCK_SKIP_WRITE_PUSH(has_block, buffer, size); #if defined TPM_FAIL_C || defined GLOBAL_C || 1 - written += UINT32_Marshal(&s_failFunction, buffer, size); - written += UINT32_Marshal(&s_failLine, buffer, size); - written += UINT32_Marshal(&s_failCode, buffer, size); + failFunction = _plat__GetFailureLocation(); + written += UINT32_Marshal(&failFunction, buffer, size); + failLine = _plat__GetFailureLine(); + written += UINT32_Marshal(&failLine, buffer, size); + failCode = _plat__GetFailureCode(); + written += UINT32_Marshal(&failCode, buffer, size); #else # error Unsupport #define value(s) #endif // TPM_FAIL_C @@ -3347,6 +3354,7 @@ VolatileState_Unmarshal(BYTE **buffer, INT32 *size) TPM2B_AUTH unused = { .b.size = 0, }; + UINT32 failFunction, failLine, failCode; if (rc == TPM_RC_SUCCESS) { rc = NV_HEADER_Unmarshal(&hdr, buffer, size, @@ -3675,7 +3683,9 @@ VolatileState_Unmarshal(BYTE **buffer, INT32 *size) skip_session: if (rc == TPM_RC_SUCCESS) { - rc = BOOL_Unmarshal(&g_inFailureMode, buffer, size); /* line 1078 */ + BOOL inFailureMode = FALSE; + rc = BOOL_Unmarshal(&inFailureMode, buffer, size); /* line 1078 */ + _plat__SetInFailureMode(inFailureMode); } /* TPM established bit */ @@ -3704,13 +3714,16 @@ VolatileState_Unmarshal(BYTE **buffer, INT32 *size) #if defined TPM_FAIL_C || defined GLOBAL_C || 1 /* appended in v2 */ if (rc == TPM_RC_SUCCESS) { - rc = UINT32_Unmarshal(&s_failFunction, buffer, size); + rc = UINT32_Unmarshal(&failFunction, buffer, size); } if (rc == TPM_RC_SUCCESS) { - rc = UINT32_Unmarshal(&s_failLine, buffer, size); + rc = UINT32_Unmarshal(&failLine, buffer, size); } if (rc == TPM_RC_SUCCESS) { - rc = UINT32_Unmarshal(&s_failCode, buffer, size); + rc = UINT32_Unmarshal(&failCode, buffer, size); + } + if (rc == TPM_RC_SUCCESS) { + _plat__SetFailureModeParameters(NULL, failLine, failCode); } #else # error Unsupport #define value(s) diff --git a/src/tpm2/Platform.h b/src/tpm2/Platform.h index cffc4ff2e..e1c9f5996 100644 --- a/src/tpm2/Platform.h +++ b/src/tpm2/Platform.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _PLATFORM_H_ @@ -67,12 +9,15 @@ #include "BaseTypes.h" #include "TPMB.h" #include "MinMax.h" + #include "PlatformACT.h" #include "PlatformClock.h" #include "PlatformData.h" #include "platform_public_interface.h" #include "tpm_to_platform_interface.h" #include "platform_to_tpm_interface.h" +#include "PlatformInternal.h" + #define GLOBAL_C #define NV_C #include "pcrstruct.h" diff --git a/src/tpm2/PlatformInternal.h b/src/tpm2/PlatformInternal.h new file mode 100644 index 000000000..46744de51 --- /dev/null +++ b/src/tpm2/PlatformInternal.h @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. + +// Private platform internal functions + +#if ALLOW_FORCE_FAILURE_MODE +// From Failure.c +// allow simulator to force the TPM into failure mode. +BOOL _plat_internal_IsForceFailureMode(); +#endif + +void _plat_internal_resetFailureData(void); diff --git a/src/tpm2/RunCommand.c b/src/tpm2/RunCommand.c index 5bba6dca4..560a1ec63 100644 --- a/src/tpm2/RunCommand.c +++ b/src/tpm2/RunCommand.c @@ -20,21 +20,9 @@ #include #include -jmp_buf s_jumpBuffer; - -// The following extern globals are copied here from Global.h to avoid including all of Tpm.h here. -// TODO: Improve the interface by which these values are shared. -extern BOOL g_inFailureMode; // Indicates that the TPM is in failure mode -#if ALLOW_FORCE_FAILURE_MODE -extern BOOL g_forceFailureMode; // flag to force failure mode during test +#if LONGJMP_SUPPORTED +jmp_buf s_FailureModeJumpBuffer; #endif -#if FAIL_TRACE -// The name of the function that triggered failure mode. -extern const char* s_failFunctionName; -#endif // FAIL_TRACE -extern UINT32 s_failFunction; -extern UINT32 s_failLine; -extern UINT32 s_failCode; //** Functions @@ -52,31 +40,16 @@ LIB_EXPORT void _plat__RunCommand( unsigned char** response // IN/OUT: response buffer ) { - setjmp(s_jumpBuffer); - ExecuteCommand(requestSize, request, responseSize, response); -} - -//***_plat__Fail() -// This is the platform depended failure exit for the TPM. -LIB_EXPORT NORETURN void _plat__Fail(void) -{ +#if LONGJMP_SUPPORTED + setjmp(s_FailureModeJumpBuffer); +#endif #if ALLOW_FORCE_FAILURE_MODE - // The simulator asserts during unexpected (i.e., un-forced) failure modes. - if(!g_forceFailureMode) + if(_plat_internal_IsForceFailureMode()) { - fprintf(stderr, "Unexpected failure mode (code %d) in ", s_failCode); -# if FAIL_TRACE - fprintf(stderr, "function '%s' (line %d)\n", s_failFunctionName, s_failLine); -# else // FAIL_TRACE - fprintf(stderr, "location code 0x%0x\n", s_locationCode); -# endif // FAIL_TRACE - assert(FALSE); + _plat__Fail(__FUNCTION__, __LINE__, 0xFFFFFFFFFFFFFFFF, FATAL_ERROR_FORCED); } +#endif - // Clear the forced-failure mode flag for next time. - g_forceFailureMode = FALSE; -#endif // ALLOW_FORCE_FAILURE_MODE - - longjmp(&s_jumpBuffer[0], 1); + ExecuteCommand(requestSize, request, responseSize, response); } diff --git a/src/tpm2/SessionProcess.c b/src/tpm2/SessionProcess.c index bd44a2b1f..a1516a113 100644 --- a/src/tpm2/SessionProcess.c +++ b/src/tpm2/SessionProcess.c @@ -2179,7 +2179,7 @@ BuildResponseSession(COMMAND* command // IN: structure that has relevant comman (UINT16)size, &extraKey, command->parameterBuffer); - if(g_inFailureMode) + if(_plat__InFailureMode()) { result = TPM_RC_FAILURE; goto Cleanup; diff --git a/src/tpm2/TpmBuildSwitches.h b/src/tpm2/TpmBuildSwitches.h index 3680d50fc..fa9cb2e14 100644 --- a/src/tpm2/TpmBuildSwitches.h +++ b/src/tpm2/TpmBuildSwitches.h @@ -101,9 +101,9 @@ //////////////////////////////////////////////////////////////// // The SIMULATION flag can enable test crypto behaviors and caching that // significantly change the behavior of the code. This flag controls only the -// g_forceFailureMode flag in the TPM library while leaving the rest of the TPM -// behavior alone. Useful for testing when the full set of options controlled by -// SIMULATION may not be desired. +// ability of the platform library to force failure mode while leaving the rest +// of the TPM behavior alone. Useful for testing when the full set of options +// controlled by SIMULATION may not be desired. #define ALLOW_FORCE_FAILURE_MODE NO // libtpms: NO //////////////////////////////////////////////////////////////// @@ -156,6 +156,8 @@ //////////////////////////////////////////////////////////////// // Implementation alternatives - don't change external behavior //////////////////////////////////////////////////////////////// +// does the target system have longjmp support, AND we want to use it? +#define LONGJMP_SUPPORTED YES // libtpms: YES // This define is used to enable the new table-driven marshaling code. #define TABLE_DRIVEN_MARSHAL NO diff --git a/src/tpm2/TpmFail.c b/src/tpm2/TpmFail.c index 6cac35eae..b4094ae9c 100644 --- a/src/tpm2/TpmFail.c +++ b/src/tpm2/TpmFail.c @@ -76,9 +76,14 @@ typedef union // compelling reason to move all the typedefs to Global.h and this structure // to Global.c. #ifndef __IGNORE_STATE__ // Don't define this value -static BYTE response[sizeof(RESPONSES)]; +static BYTE failure_response_buffer[1000 + sizeof(RESPONSES)]; #endif +// the total size of the failure_response_buffer must be at least: +// 4 * sizeof(UINT32) + sizeof(UINT16) since that's what TPM_CC_GetTestResult +// returns +TPM_STATIC_ASSERT(sizeof(failure_response_buffer) > 100); + //** Local Functions //*** MarshalUint16() @@ -119,61 +124,69 @@ static BOOL Unmarshal16(UINT16* target, BYTE** buffer, INT32* size) return TRUE; } -//** Public Functions - -//*** SetForceFailureMode() -// This function is called by the simulator to enable failure mode testing. -#if ALLOW_FORCE_FAILURE_MODE -LIB_EXPORT void SetForceFailureMode(void) -{ - g_forceFailureMode = TRUE; - return; -} -#endif // ALLOW_FORCE_FAILURE_MODE - -/* libtpms added begin */ -static void -TpmSetFailureMode( +//*** EnterFailureMode() +// This function is called by TPM.lib when a failure occurs. It will set up the +// failure values to be returned on TPM2_GetTestResult(). +NORETURN_IF_LONGJMP void EnterFailureMode( #if FAIL_TRACE - const char *function, - int line, + const char* function, + int line, #endif - int code - ) + uint64_t locationCode, + int failureCode) { - // Save the values that indicate where the error occurred. - // On a 64-bit machine, this may truncate the address of the string - // of the function name where the error occurred. -#if FAIL_TRACE - s_failFunction = *(UINT32 *)function; - s_failLine = line; -#else - s_failFunction = (UINT32)0; - s_failLine = 0; -#endif - s_failCode = code; + TPM_DEBUG_TRACE(); + if(_plat__InFailureMode()) + { + TPM_DEBUG_PRINT("Fail On Fail, Original Failure:"); - TPMLIB_LogTPM2Error("Entering failure mode; code: %d" #if FAIL_TRACE - ", location: %s line %d" + TPM_DEBUG_PRINTF("Function:", _plat__GetFailureFunctionName()); + TPM_DEBUG_PRINTF(" Line:", _plat__GetFailureLine()); #endif - "\n", s_failCode + + TPM_DEBUG_PRINTF(" Code:", _plat__GetFailureCode()); + uint32_t failureLocation_low = (uint32_t)(_plat__GetFailureLocation()); + uint32_t failureLocation_hi = (uint32_t)(_plat__GetFailureLocation() >> 32); + // reference in case printing is disabled + NOT_REFERENCED(failureLocation_low); + NOT_REFERENCED(failureLocation_hi); + TPM_DEBUG_PRINTF( + "Location: %08x:%08x", failureLocation_hi, failureLocation_low); + TPM_DEBUG_PRINT("New Failure:"); #if FAIL_TRACE - , function, s_failLine + TPM_DEBUG_PRINTF("Function:", function); + TPM_DEBUG_PRINTF(" Line:", line); #endif - ); - // We are in failure mode - g_inFailureMode = TRUE; + TPM_DEBUG_PRINTF(" Code:", failureCode); + failureLocation_low = (uint32_t)(locationCode); + failureLocation_hi = (uint32_t)(locationCode >> 32); + // reference in case printing is disabled + NOT_REFERENCED(failureLocation_low); + NOT_REFERENCED(failureLocation_hi); + TPM_DEBUG_PRINTF( + "Location: %08x:%08x", failureLocation_hi, failureLocation_low); + } + + // Notify the platform that we hit a failure. + // + // In the LONGJMP_SUPPORTED case, the reference platform code is expected to + // long-jmp back to the ExecuteCommand call and output a failure response. + // + // In the !LONGJMP_SUPPORTED case, this is a notification to the platform, + // and the platform may take any (implementation-defined) behavior, + // including no-op, debugging, or whatever. The core library is expected to + // surface the failure back to ExecuteCommand through error propagation and + // return an appropriate failure reply. + // + // The general expectation is for the platform to ignore this and not update + // the failure data if the platform is already in failure + _plat__Fail(function, line, locationCode, failureCode); } -/* libtpms added end */ - -/* 9.17.4.2 TpmLogFailure() */ -/* This function saves the failure values when the code will continue to operate. It if similar to - TpmFail() but returns to the caller. The assumption is that the caller will propagate a failure - back up the stack. */ -void -TpmLogFailure( + + // libtpms added begin +void TpmLogFailure( #if FAIL_TRACE const char *function, int line, @@ -181,95 +194,29 @@ TpmLogFailure( int code ) { -#if 0 // libtpms added - // Save the values that indicate where the error occurred. - // On a 64-bit machine, this may truncate the address of the string - // of the function name where the error occurred. -#if FAIL_TRACE - memcpy(&s_failFunction, function, sizeof(uint32_t)); /* kgold */ - s_failLine = line; -#else - s_failFunction = 0; - s_failLine = 0; -#endif - s_failCode = code; - - // We are in failure mode - g_inFailureMode = TRUE; -#else // libtpms added begin - - TpmSetFailureMode( -#if FAIL_TRACE - function, line, -#endif - code); - -#endif // libtpms added end - return; -} - -//*** TpmFail() -// This function is called by TPM.lib when a failure occurs. It will set up the -// failure values to be returned on TPM2_GetTestResult(). -NORETURN void TpmFail( + TPMLIB_LogTPM2Error("Entering failure mode; code: %d" #if FAIL_TRACE - const char* function, - int line, -#else - uint64_t locationCode, + ", location: %s line %d" #endif - int failureCode) -{ -#if 0 /* libtpms added */ - // Save the values that indicate where the error occurred. - // On a 64-bit machine, this may truncate the address of the string - // of the function name where the error occurred. + "\n", code #if FAIL_TRACE - memcpy(&s_failFunction, function, sizeof(uint32_t)); // libtpms changed - s_failLine = line; -#else - s_failFunction = (UINT32)(locationCode >> 32); - s_failLine = (UINT32)(locationCode); + , function, line #endif - s_failCode = failureCode; - - // We are in failure mode - g_inFailureMode = TRUE; - // if asserts are enabled, then do an assert unless the failure mode code - // is being tested. -#if SIMULATION -# ifndef NDEBUG - assert(g_forceFailureMode); -# endif - // Clear this flag - g_forceFailureMode = FALSE; -#endif - -#else /* libtpms added begin */ + ); - TpmSetFailureMode( + _plat__SetFailureModeParameters( #if FAIL_TRACE - function, line, + function, + line, #endif - failureCode); - -#endif /* libtpms added end */ - // Notify the platform that we hit a failure. - // - // In the LONGJMP case, the reference platform code is expected to long-jmp - // back to the ExecuteCommand call and output a failure response. - // - // In the NO_LONGJMP case, this is a notification to the platform, and the - // platform may take any (implementation-defined) behavior, including no-op, - // debugging, or whatever. The core library is expected to surface the failure - // back to ExecuteCommand through error propagation and return an appropriate - // failure reply. - _plat__Fail(); -} + code + ); + _plat__SetInFailureMode(TRUE); +} // libtpms added end //*** TpmFailureMode( -// This function is called by the interface code when the platform is in failure -// mode. +// This function is called by ExecuteCommand code to construct failure responses +// when the platform is in failure mode. void TpmFailureMode(uint32_t inRequestSize, // IN: command buffer size unsigned char* inRequest, // IN: command buffer uint32_t* outResponseSize, // OUT: response buffer size @@ -289,31 +236,53 @@ void TpmFailureMode(uint32_t inRequestSize, // IN: command buffer size // If there is no command buffer, then just return TPM_RC_FAILURE if(inRequestSize == 0 || inRequest == NULL) + { goto FailureModeReturn; + } // If the header is not correct for TPM2_GetCapability() or // TPM2_GetTestResult() then just return the in failure mode response; if(!(Unmarshal16(&header.tag, &buffer, &size) && Unmarshal32(&header.size, &buffer, &size) && Unmarshal32(&header.code, &buffer, &size))) + { goto FailureModeReturn; + } if(header.tag != TPM_ST_NO_SESSIONS || header.size < 10) + { goto FailureModeReturn; + } + switch(header.code) { case TPM_CC_GetTestResult: + { // make sure that the command size is correct if(header.size != 10) + { goto FailureModeReturn; - buffer = &response[10]; - marshalSize = MarshalUint16(3 * sizeof(UINT32), &buffer); - marshalSize += MarshalUint32(s_failFunction, &buffer); - marshalSize += MarshalUint32(s_failLine, &buffer); - marshalSize += MarshalUint32(s_failCode, &buffer); - if(s_failCode == FATAL_ERROR_NV_UNRECOVERABLE) + } + buffer = &failure_response_buffer[10]; + + UINT16 sizeofTestResultData = 8 // size of Failure Location + + 4; // sizeof(_plat__GetFailureCode); + + marshalSize = MarshalUint16(sizeofTestResultData, &buffer); + UINT32 low = (UINT32)(_plat__GetFailureLocation() & 0xFFFFFFFF); + UINT32 high = (UINT32)((_plat__GetFailureLocation() >> 32) & 0xFFFFFFFF); + marshalSize += MarshalUint32(high, &buffer); + marshalSize += MarshalUint32(low, &buffer); + marshalSize += MarshalUint32(_plat__GetFailureCode(), &buffer); + // the final code isn't part of the TestResultData size and is always UINT32 + if(_plat__GetFailureCode() == FATAL_ERROR_NV_UNRECOVERABLE) + { marshalSize += MarshalUint32(TPM_RC_NV_UNINITIALIZED, &buffer); + } else + { marshalSize += MarshalUint32(TPM_RC_FAILURE, &buffer); - break; + } + } + break; case TPM_CC_GetCapability: // make sure that the size of the command is exactly the size // returned for the capability, property, and count @@ -332,7 +301,7 @@ void TpmFailureMode(uint32_t inRequestSize, // IN: command buffer size if(pt < TPM_PT_MANUFACTURER) pt = TPM_PT_MANUFACTURER; // set up for return - buffer = &response[10]; + buffer = &failure_response_buffer[10]; // if the request was for a PT less than the last one // then we indicate more, otherwise, not. if(pt < TPM_PT_FIRMWARE_VERSION_2) @@ -401,7 +370,7 @@ void TpmFailureMode(uint32_t inRequestSize, // IN: command buffer size goto FailureModeReturn; } // Now do the header - buffer = response; + buffer = failure_response_buffer; marshalSize = marshalSize + 10; // Add the header size to the // stuff already marshaled MarshalUint16(TPM_ST_NO_SESSIONS, &buffer); // structure tag @@ -409,17 +378,21 @@ void TpmFailureMode(uint32_t inRequestSize, // IN: command buffer size MarshalUint32(TPM_RC_SUCCESS, &buffer); // response code *outResponseSize = marshalSize; - *outResponse = (unsigned char*)&response; + *outResponse = (unsigned char*)&failure_response_buffer; return; + FailureModeReturn: - buffer = response; + TPM_DEBUG_TRACEX("returning."); + + buffer = failure_response_buffer; + //TPM_DEBUG_PRINT("FailureModeReturn:1"); marshalSize = MarshalUint16(TPM_ST_NO_SESSIONS, &buffer); //TPM_DEBUG_PRINT("FailureModeReturn:2"); marshalSize += MarshalUint32(10, &buffer); //TPM_DEBUG_PRINT("FailureModeReturn:3"); marshalSize += MarshalUint32(TPM_RC_FAILURE, &buffer); *outResponseSize = marshalSize; - *outResponse = (unsigned char*)response; + *outResponse = (unsigned char*)failure_response_buffer; return; } diff --git a/src/tpm2/TpmFail_fp.h b/src/tpm2/TpmFail_fp.h index eb73f3e87..4d66fe7f4 100644 --- a/src/tpm2/TpmFail_fp.h +++ b/src/tpm2/TpmFail_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Failure Mode Handling */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -66,34 +8,25 @@ #ifndef _TPM_FAIL_FP_H_ #define _TPM_FAIL_FP_H_ -#if 0 /* libtpms added */ -//*** SetForceFailureMode() -// This function is called by the simulator to enable failure mode testing. -#if SIMULATION -LIB_EXPORT void SetForceFailureMode(void); +//*** EnterFailureMode() +// This function is called by TPM.lib when a failure occurs. It will set up the +// failure values to be returned on TPM2_GetTestResult(). +NORETURN_IF_LONGJMP void EnterFailureMode( +#if FAIL_TRACE + const char* function, + int line, #endif -#endif /* libtpms added */ + uint64_t locationCode, + int failureCode); -void +void // libtpms added begin TpmLogFailure( #if FAIL_TRACE const char *function, int line, #endif int code - ); - -//*** TpmFail() -// This function is called by TPM.lib when a failure occurs. It will set up the -// failure values to be returned on TPM2_GetTestResult(). -NORETURN void TpmFail( -#if FAIL_TRACE - const char* function, - int line, -#else - uint64_t locationCode, -#endif - int failureCode); + ); // libtpms added end //*** TpmFailureMode( // This function is called by the interface code when the platform is in failure @@ -104,11 +37,4 @@ void TpmFailureMode(uint32_t inRequestSize, // IN: command buffer size unsigned char** outResponse // OUT: response buffer ); -#if 0 /* libtpms added */ -//*** UnmarshalFail() -// This is a stub that is used to catch an attempt to unmarshal an entry -// that is not defined. Don't ever expect this to be called but... -void UnmarshalFail(void* type, BYTE** buffer, INT32* size); -#endif /* libtpms added */ - #endif // _TPM_FAIL_FP_H_ diff --git a/src/tpm2/TpmMath_Util.c b/src/tpm2/TpmMath_Util.c index 6be39d2b9..8f7da092e 100644 --- a/src/tpm2/TpmMath_Util.c +++ b/src/tpm2/TpmMath_Util.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains utility functions to help using the external Math library @@ -230,5 +172,5 @@ LIB_EXPORT BOOL TpmMath_GetRandomInRange( && (ExtMath_IsZero(dest) || (ExtMath_UnsignedCmp(dest, limit) >= 0))) ; } - return !g_inFailureMode; + return !_plat__InFailureMode(); } diff --git a/src/tpm2/VerifyConfiguration.h b/src/tpm2/VerifyConfiguration.h index 9803d4d8b..e9f324a28 100644 --- a/src/tpm2/VerifyConfiguration.h +++ b/src/tpm2/VerifyConfiguration.h @@ -47,6 +47,7 @@ MUST_BE_0_OR_1(COMPRESSED_LISTS); // libtpms added MUST_BE_0_OR_1(RSA_KEY_SIEVE); // Implementation alternatives - changes external behavior +MUST_BE_0_OR_1(LONGJMP_SUPPORTED); MUST_BE_0_OR_1(_DRBG_STATE_SAVE); MUST_BE_0_OR_1(USE_DA_USED); MUST_BE_0_OR_1(ENABLE_SELF_TESTS); diff --git a/src/tpm2/Volatile.c b/src/tpm2/Volatile.c index cedeb4a6e..4a50d6b05 100644 --- a/src/tpm2/Volatile.c +++ b/src/tpm2/Volatile.c @@ -112,7 +112,7 @@ VolatileState_Load(BYTE **buffer, INT32 *size) rc = irc; if (rc != TPM_RC_SUCCESS) - g_inFailureMode = TRUE; + _plat__SetInFailureMode(TRUE); return rc; } diff --git a/src/tpm2/_TPM_Init.c b/src/tpm2/_TPM_Init.c index 53a12da90..35b3a740b 100644 --- a/src/tpm2/_TPM_Init.c +++ b/src/tpm2/_TPM_Init.c @@ -46,8 +46,24 @@ LIB_EXPORT void _TPM_Init(void) g_nvOk = NvPowerOn(); // Initialize cryptographic functions - g_inFailureMode |= (g_nvOk == FALSE) || (CryptInit() == FALSE); // libtpms changed - if(!g_inFailureMode) + +#if 0 // libtpms added + // libtpms: FAIL would do longjmp, but there was no setjmp + if(g_nvOk != TRUE) + { + FAIL(FATAL_ERROR_NV_INIT); + } + else if(!CryptInit()) + { + FAIL(FATAL_ERROR_CRYPTO_INIT); + } +#else // libtpms added begin + BOOL inFailureMode = (g_nvOk == FALSE) || (CryptInit() == FALSE); + if (inFailureMode) + _plat__SetInFailureMode(TRUE); +#endif // libtpms added end + + if(!_plat__InFailureMode()) { // Load the persistent data NvReadPersistent(); @@ -66,7 +82,7 @@ LIB_EXPORT void _TPM_Init(void) } g_initCompleted = TRUE; - if(!g_inFailureMode) + if(! _plat__InFailureMode()) { _plat__EndOkTpmInit(); } diff --git a/src/tpm2/crypto/CryptEccMain_fp.h b/src/tpm2/crypto/CryptEccMain_fp.h index fea3c4770..e24bc6b68 100644 --- a/src/tpm2/crypto/CryptEccMain_fp.h +++ b/src/tpm2/crypto/CryptEccMain_fp.h @@ -67,6 +67,7 @@ #define _CRYPT_ECC_MAIN_FP_H_ #if ALG_ECC +# include "CryptRand.h" //** Functions # if SIMULATION diff --git a/src/tpm2/crypto/openssl/CryptEccMain.c b/src/tpm2/crypto/openssl/CryptEccMain.c index f73f8afa8..e35484b63 100644 --- a/src/tpm2/crypto/openssl/CryptEccMain.c +++ b/src/tpm2/crypto/openssl/CryptEccMain.c @@ -477,7 +477,8 @@ BOOL TpmEcc_GenPrivateScalar( OK = OK && ExtMath_SubtractWord(nMinus1, order, 1); OK = OK && ExtMath_Mod(bnExtraBits, nMinus1); OK = OK && ExtMath_AddWord(dOut, bnExtraBits, 1); - return OK && !g_inFailureMode; + + return OK && !_plat__InFailureMode(); } #else // libtpms added begin BOOL TpmEcc_GenPrivateScalar( @@ -511,7 +512,8 @@ BOOL TpmEcc_GenPrivateScalar( OK = OK && ExtMath_SubtractWord(nMinus1, order, 1); OK = OK && ExtMath_Mod(bnExtraBits, nMinus1); OK = OK && ExtMath_AddWord(dOut, bnExtraBits, 1); - return OK && !g_inFailureMode; + + return OK && !_plat__InFailureMode(); } #endif // USE_OPENSSL_FUNCTIONS_EC libtpms added end @@ -751,7 +753,7 @@ LIB_EXPORT TPM_RC CryptEccGenerateKey( digest.t.size = MIN(sensitive->sensitive.ecc.t.size, sizeof(digest.t.buffer)); // Get a random value to sign using the built in DRBG state DRBG_Generate(NULL, digest.t.buffer, digest.t.size); - if(g_inFailureMode) + if(_plat__InFailureMode()) return TPM_RC_FAILURE; TpmEcc_SignEcdsa(bnT, bnS, E, bnD, &digest, NULL); // and make sure that we can validate the signature diff --git a/src/tpm2/crypto/openssl/CryptPrime.c b/src/tpm2/crypto/openssl/CryptPrime.c index 1d68f5dbd..f1304ff6d 100644 --- a/src/tpm2/crypto/openssl/CryptPrime.c +++ b/src/tpm2/crypto/openssl/CryptPrime.c @@ -180,7 +180,7 @@ BOOL MillerRabin(Crypt_Int* bnW, RAND_STATE* rand) && ((ExtMath_UnsignedCmpWord(bnB, 1) <= 0) || (ExtMath_UnsignedCmp(bnB, bnWm1) >= 0))) ; - if(g_inFailureMode) + if( _plat__InFailureMode()) return FALSE; // 4.3 z = b^m mod w. @@ -252,7 +252,7 @@ RsaCheckPrime(Crypt_Int* prime, UINT32 exponent, RAND_STATE* rand) ExtMath_SubtractWord(prime, prime, 2); if(TpmMath_IsProbablyPrime(prime, rand) == 0) - ERROR_EXIT(g_inFailureMode ? TPM_RC_FAILURE : TPM_RC_VALUE); + ERROR_EXIT( _plat__InFailureMode() ? TPM_RC_FAILURE : TPM_RC_VALUE); Exit: return retVal; # else @@ -423,12 +423,12 @@ TPM_RC TpmRsa_GeneratePrimeForRSA( // The change below is to make sure that all keys that are generated from the same // seed value will be the same regardless of the endianess or word size of the CPU. // DRBG_Generate(rand, (BYTE *)prime->d, (UINT16)BITS_TO_BYTES(bits));// old - // if(g_inFailureMode) // old + // if(_plat_InFailureMode()) // old // libtpms changed begin switch (DRBG_GetSeedCompatLevel(rand)) { case SEED_COMPAT_LEVEL_ORIGINAL: DRBG_Generate(rand, (BYTE *)prime->d, (UINT16)BITS_TO_BYTES(bits)); - if (g_inFailureMode) + if (_plat__InFailureMode()) return TPM_RC_FAILURE; RsaAdjustPrimeCandidate_PreRev155(prime); break; diff --git a/src/tpm2/crypto/openssl/CryptPrimeSieve.c b/src/tpm2/crypto/openssl/CryptPrimeSieve.c index 9bfeccca4..e1ccb5010 100644 --- a/src/tpm2/crypto/openssl/CryptPrimeSieve.c +++ b/src/tpm2/crypto/openssl/CryptPrimeSieve.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* CryptPrimeSieve */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes and defines @@ -477,7 +419,7 @@ LIB_EXPORT TPM_RC PrimeSelectWithSieve( ones = PrimeSieve(candidate, fieldSize, field); // PrimeSieve shouldn't fail, but does call functions that may. - if(!g_inFailureMode) + if(! _plat__InFailureMode()) { pAssert(ones > 0 && ones < (fieldSize * 8)); for(; ones > 0; ones--) @@ -506,7 +448,7 @@ LIB_EXPORT TPM_RC PrimeSelectWithSieve( // Ran out of bits and couldn't find a prime in this field INSTRUMENT_INC(noPrimeFields[PrimeIndex]); } - return (g_inFailureMode ? TPM_RC_FAILURE : TPM_RC_NO_RESULT); + return ( _plat__InFailureMode() ? TPM_RC_FAILURE : TPM_RC_NO_RESULT); } # if RSA_INSTRUMENT diff --git a/src/tpm2/crypto/openssl/CryptRand.c b/src/tpm2/crypto/openssl/CryptRand.c index d60460b89..da02fde7e 100644 --- a/src/tpm2/crypto/openssl/CryptRand.c +++ b/src/tpm2/crypto/openssl/CryptRand.c @@ -921,8 +921,7 @@ LIB_EXPORT BOOL DRBG_Instantiate( // reseeding does. So, do a reduction on the personalization value (if any) // and do a reseed. DRBG_Reseed(drbgState, &seed, DfBuffer(&dfResult, pSize, personalization)); - - VERIFY(!g_inFailureMode, FATAL_ERROR_ENTROPY, TPM_RC_FAILURE); + VERIFY(!_plat__InFailureMode(), FATAL_ERROR_ENTROPY, TPM_RC_FAILURE); return TRUE; } diff --git a/src/tpm2/crypto/openssl/CryptRsa.c b/src/tpm2/crypto/openssl/CryptRsa.c index 630d6029f..93884e176 100644 --- a/src/tpm2/crypto/openssl/CryptRsa.c +++ b/src/tpm2/crypto/openssl/CryptRsa.c @@ -332,7 +332,7 @@ static TPM_RC OaepEncode( dbSize = hLen + padLen + message->size; DRBG_Generate(rand, mySeed, (UINT16)hLen); - if(g_inFailureMode) + if( _plat__InFailureMode()) ERROR_EXIT(TPM_RC_FAILURE); // mask = MGF1 (seed, nSize hLen 1) CryptMGF_KDF(dbSize, mask, hashAlg, hLen, seed, 0); @@ -477,7 +477,7 @@ static TPM_RC RSAES_PKCS1v1_5Encode(TPM2B* padded, // OUT: the pad data // Fill with random bytes DRBG_Generate(rand, &padded->buffer[2], (UINT16)ps); - if(g_inFailureMode) + if( _plat__InFailureMode()) return TPM_RC_FAILURE; // Set the delimiter for the random field to 0 @@ -587,7 +587,7 @@ static TPM_RC PssEncode(TPM2B* out, // OUT: the encoded buffer // Get set the salt DRBG_Generate(rand, salt, saltSize); - if(g_inFailureMode) + if( _plat__InFailureMode()) return TPM_RC_FAILURE; // Create the hash of the pad || input hash || salt diff --git a/src/tpm2/platform_failure_mode_fp.h b/src/tpm2/platform_failure_mode_fp.h new file mode 100644 index 000000000..0e1eb7166 --- /dev/null +++ b/src/tpm2/platform_failure_mode_fp.h @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: BSD-2-Clause + +// Failure mode platform functions +// The platform is responsible for tracking and handling failure +// mode, and for returning the data for GetTestResult when in +// failure mode. This allows the Core TPM library to implement +// the basic command handling while making minimal assumptions +// about the data the platform will track, and also, critically, +// allows the platform to put the TPM into failure mode due to +// it's own internal failures without forcing a dependency on the +// tpm library's internal error handling macros and functions +// throughout unrelated platform code + +#ifndef _PLATFORM_FAILURE_MODE_FP_H_ +#define _PLATFORM_FAILURE_MODE_FP_H_ + +//***_plat__Fail() +// A function for the TPM to call the platform to indicate the +// TPM code has detected a failure. +LIB_EXPORT NORETURN_IF_LONGJMP void _plat__Fail( +#if FAIL_TRACE + const char* function, + int line, +#endif + uint64_t locationCode, + int failureCode); + +// Indicates to the TPM Library that a failure has occurred. +// This is REQUIRED to return true after any call to _plat__Fail. +// It MAY return true for any other reason the platform deems appropriate. +LIB_EXPORT BOOL _plat__InFailureMode(void); + +LIB_EXPORT void _plat__SetInFailureMode(BOOL inFailureMode); // libtpms added begin +LIB_EXPORT void _plat__SetFailureModeParameters( +#if FAIL_TRACE + const char* function, + int line, +#endif + int failureCode); // libtpms added end + +// The failure reason. Values are vendor defined by the TpmConfiguration +// project in the TpmProfile_ErrorCodes.h header +LIB_EXPORT UINT32 _plat__GetFailureCode(void); + +// A vendor defined 64-bit code indicating where the failure occured. +// this is defined by the return of the CODELOCATION() macro which may be +// defined in TpmConfiguration. If not defined, returns zero. +LIB_EXPORT uint64_t _plat__GetFailureLocation(void); + +// Provides human readable failure information. Not necessarily suitable for production. +#if FAIL_TRACE +LIB_EXPORT const char* _plat__GetFailureFunctionName(void); +LIB_EXPORT uint32_t _plat__GetFailureLine(void); +#endif + +#endif // _PLATFORM_FAILURE_MODE_FP_H_ diff --git a/src/tpm2/tpm_to_platform_interface.h b/src/tpm2/tpm_to_platform_interface.h index 13481abe9..d8666f27d 100644 --- a/src/tpm2/tpm_to_platform_interface.h +++ b/src/tpm2/tpm_to_platform_interface.h @@ -308,10 +308,6 @@ LIB_EXPORT int _plat__WasPowerLost(void); // FALSE(0) if physical presence is not signaled LIB_EXPORT int _plat__PhysicalPresenceAsserted(void); -//***_plat__Fail() -// This is the platform depended failure exit for the TPM. -LIB_EXPORT NORETURN void _plat__Fail(void); - //** From Unique.c #if VENDOR_PERMANENT_AUTH_ENABLED == YES @@ -416,4 +412,7 @@ LIB_EXPORT size_t _plat_debug_snprintf( // platform initialization functions #include "platform_init_fp.h" +// platform failure mode functions +#include "platform_failure_mode_fp.h" + #endif // _TPM_TO_PLATFORM_INTERFACE_H_ diff --git a/src/tpm_tpm2_interface.c b/src/tpm_tpm2_interface.c index 7bebbc9e1..24712c032 100644 --- a/src/tpm_tpm2_interface.c +++ b/src/tpm_tpm2_interface.c @@ -55,8 +55,10 @@ #include "tpm2/StateMarshal.h" #include "tpm2/PlatformACT.h" #include "tpm2/PlatformData.h" +#include "tpm2/PlatformInternal.h" #include "tpm2/Volatile.h" #include "tpm2/crypto/openssl/ExpDCache_fp.h" +#include "tpm2/platform_failure_mode_fp.h" #define TPM_HAVE_TPM2_DECLARATIONS #include "tpm_nvfile.h" // TPM_NVRAM_Loaddata() @@ -64,7 +66,6 @@ #include "tpm_library_intern.h" #include "tpm_nvfilename.h" -extern BOOL g_inFailureMode; static BOOL reportedFailureCommand; static char *g_profile; static TPM_BOOL g_wasManufactured; @@ -104,7 +105,7 @@ static TPM_RESULT TPM2_MainInit(void) bool has_nvram_file; bool has_nvram_loaddata_callback; - g_inFailureMode = FALSE; + _plat_internal_resetFailureData(); reportedFailureCommand = FALSE; g_wasManufactured = FALSE; @@ -136,7 +137,7 @@ static TPM_RESULT TPM2_MainInit(void) TPMLIB_LogTPM2Error( "%s: _plat__NVEnable(NULL) failed: %d\n", __func__, ret); - if (TPM_Manufacture(TRUE, g_profile) < 0 || g_inFailureMode) { + if (TPM_Manufacture(TRUE, g_profile) < 0 || _plat__InFailureMode()) { TPMLIB_LogTPM2Error("%s: TPM_Manufacture(TRUE) failed or TPM in " "failure mode\n", __func__); reportedFailureCommand = TRUE; @@ -156,7 +157,7 @@ static TPM_RESULT TPM2_MainInit(void) _rpc__Signal_NvOn(); if (ret == TPM_SUCCESS) { - if (g_inFailureMode) + if (_plat__InFailureMode()) ret = TPM_RC_FAILURE; } @@ -233,7 +234,7 @@ static TPM_RESULT TPM2_Process(unsigned char **respbuffer, uint32_t *resp_size, *resp_size = resp.BufferSize; - if (g_inFailureMode && !reportedFailureCommand) { + if (_plat__InFailureMode() && !reportedFailureCommand) { reportedFailureCommand = TRUE; TPMLIB_LogTPM2Error("%s: Entered failure mode through command:\n", __func__); From 38f17a7ca7c3e50e5f64f6d6b6ab9e5116de5f16 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 15:34:29 -0400 Subject: [PATCH 29/52] Sync: Fix code comments and function descriptions and trivial changes Signed-off-by: Stefan Berger --- src/tpm2/EncryptDecrypt_spt.c | 1 + src/tpm2/IoBuffers_fp.h | 65 ++-------------------------- src/tpm2/TPMB.h | 2 + src/tpm2/TpmEcc_Signature_ECDSA_fp.h | 62 ++------------------------ src/tpm2/_TPM_Hash_Data_fp.h | 3 ++ src/tpm2/_TPM_Hash_Start_fp.h | 1 + 6 files changed, 13 insertions(+), 121 deletions(-) diff --git a/src/tpm2/EncryptDecrypt_spt.c b/src/tpm2/EncryptDecrypt_spt.c index 4bd287bad..151bcaecc 100644 --- a/src/tpm2/EncryptDecrypt_spt.c +++ b/src/tpm2/EncryptDecrypt_spt.c @@ -37,6 +37,7 @@ EncryptDecryptShared(TPMI_DH_OBJECT keyHandleIn, symKey = HandleToObject(keyHandleIn); pAssert_RC(symKey != NULL); mode = symKey->publicArea.parameters.symDetail.sym.mode.sym; + // The input key should be a symmetric key if(symKey->publicArea.type != TPM_ALG_SYMCIPHER) return TPM_RCS_KEY + RC_EncryptDecrypt_keyHandle; diff --git a/src/tpm2/IoBuffers_fp.h b/src/tpm2/IoBuffers_fp.h index 90e26b852..c123f92cf 100644 --- a/src/tpm2/IoBuffers_fp.h +++ b/src/tpm2/IoBuffers_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* I/O Buffers */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: IoBuffers_fp.h 1259 2018-07-10 19:11:09Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -79,14 +20,14 @@ void MemoryIoBufferZero(void); //*** MemoryGetInBuffer() // This function returns the address of the buffer into which the // command parameters will be unmarshaled in preparation for calling -// the command actions. +// the command actions. Returns NULL if not possible. BYTE* MemoryGetInBuffer(UINT32 size // Size, in bytes, required for the input // unmarshaling ); //*** MemoryGetOutBuffer() // This function returns the address of the buffer into which the command -// action code places its output values. +// action code places its output values. Returns NULL if not possible. BYTE* MemoryGetOutBuffer(UINT32 size // required size of the buffer ); diff --git a/src/tpm2/TPMB.h b/src/tpm2/TPMB.h index 95c95104d..037108850 100644 --- a/src/tpm2/TPMB.h +++ b/src/tpm2/TPMB.h @@ -7,6 +7,8 @@ #ifndef _TPMB_H #define _TPMB_H +#include "BaseTypes.h" + //*** Size Types // These types are used to differentiate the two different size values used. // diff --git a/src/tpm2/TpmEcc_Signature_ECDSA_fp.h b/src/tpm2/TpmEcc_Signature_ECDSA_fp.h index 3283bb89b..ff1f01153 100644 --- a/src/tpm2/TpmEcc_Signature_ECDSA_fp.h +++ b/src/tpm2/TpmEcc_Signature_ECDSA_fp.h @@ -1,66 +1,10 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _TPMECC_SIGNATURE_ECDSA_FP_H_ #define _TPMECC_SIGNATURE_ECDSA_FP_H_ + #if ALG_ECC && ALG_ECDSA +# include "CryptRand.h" //*** TpmEcc_SignEcdsa() // This function implements the ECDSA signing algorithm. The method is described diff --git a/src/tpm2/_TPM_Hash_Data_fp.h b/src/tpm2/_TPM_Hash_Data_fp.h index 8062223ca..f8ee63fcf 100644 --- a/src/tpm2/_TPM_Hash_Data_fp.h +++ b/src/tpm2/_TPM_Hash_Data_fp.h @@ -8,6 +8,9 @@ #ifndef __TPM_HASH_DATA_FP_H_ #define __TPM_HASH_DATA_FP_H_ +// This function is called to process a _TPM_Hash_Data indication. Returns FALSE +//on failure. If FALSE is returned caller should check for failure mode, (not +//all failures are fatal) LIB_EXPORT BOOL _TPM_Hash_Data(uint32_t dataSize, // IN: size of data to be extend unsigned char* data // IN: data buffer ); diff --git a/src/tpm2/_TPM_Hash_Start_fp.h b/src/tpm2/_TPM_Hash_Start_fp.h index 6c868e981..d84d55c39 100644 --- a/src/tpm2/_TPM_Hash_Start_fp.h +++ b/src/tpm2/_TPM_Hash_Start_fp.h @@ -8,6 +8,7 @@ #ifndef __TPM_HASH_START_FP_H_ #define __TPM_HASH_START_FP_H_ +// This function is called to process a _TPM_Hash_Start indication. // It returns FALSE if the indication cannot be handled, and the TPM // will be in FailureMode. LIB_EXPORT BOOL _TPM_Hash_Start(void); From 7bdbee5918a520b7eafc484d853b1f7a599b2c8f Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Fri, 8 Aug 2025 15:32:35 -0400 Subject: [PATCH 30/52] Sync: Add checks for locator == (NV_REF)0 Signed-off-by: Stefan Berger --- src/tpm2/SessionProcess.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tpm2/SessionProcess.c b/src/tpm2/SessionProcess.c index a1516a113..4f61b633f 100644 --- a/src/tpm2/SessionProcess.c +++ b/src/tpm2/SessionProcess.c @@ -351,6 +351,10 @@ static BOOL IsAuthValueAvailable(TPM_HANDLE handle, // IN: handle of e NV_PIN pin; if(!IS_ATTRIBUTE(nvAttributes, TPMA_NV, WRITTEN)) break; // return false + + if(locator == (NV_REF)0) + break; // return false + // get the index values pin.intVal = NvGetUINT64Data(nvIndex, locator); if(pin.pin.pinCount < pin.pin.pinLimit) @@ -1509,6 +1513,8 @@ static TPM_RC CheckAuthSession( if(IsNvPinFailIndex(nvAttributes) && IS_ATTRIBUTE(nvAttributes, TPMA_NV, WRITTEN)) { + if(locator == (NV_REF)0) + return TPM_RC_AUTH_UNAVAILABLE; pinData.intVal = NvGetUINT64Data(nvIndex, locator); if(result != TPM_RC_SUCCESS) pinData.pin.pinCount++; @@ -1525,6 +1531,8 @@ static TPM_RC CheckAuthSession( && IS_ATTRIBUTE(nvAttributes, TPMA_NV, WRITTEN) && result == TPM_RC_SUCCESS) { + if(locator == (NV_REF)0) + return TPM_RC_AUTH_UNAVAILABLE; // If the access is valid, then increment the use counter pinData.intVal = NvGetUINT64Data(nvIndex, locator); pinData.pin.pinCount++; From 7ac4062c7dbcabddc5323b2daaee678cb585008a Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Fri, 8 Aug 2025 15:27:24 -0400 Subject: [PATCH 31/52] Sync: Check for NULL pointers in CommandDispatcher Signed-off-by: Stefan Berger --- src/tpm2/CommandDispatcher.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tpm2/CommandDispatcher.c b/src/tpm2/CommandDispatcher.c index 18c503747..993fdf932 100644 --- a/src/tpm2/CommandDispatcher.c +++ b/src/tpm2/CommandDispatcher.c @@ -223,6 +223,11 @@ CommandDispatcher(COMMAND* command) // And the output parameters commandOut = (BYTE*)MemoryGetOutBuffer((UINT32)maxOutSize); + if(commandIn == NULL || commandOut == NULL) + { + return TPM_RC_FAILURE; + } + // Get the address of the action code dispatch cmd = desc->command; From cf8eefc490790fb6dfe714a8e84731f8aba34967 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 17:04:46 -0400 Subject: [PATCH 32/52] Sync: Report versioning information using a structe passed to a function Signed-off-by: Stefan Berger --- src/Makefile.am | 1 - src/tpm2/GpMacros.h | 1 - src/tpm2/PropertyCap.c | 37 ++++++++----- src/tpm2/TpmFail.c | 2 +- src/tpm2/TpmProfile.h | 61 +-------------------- src/tpm2/TpmProfile_Common.h | 2 + src/tpm2/VendorInfo.c | 25 ++++++++- src/tpm2/VendorInfo.h | 82 ---------------------------- src/tpm2/_TPM_Init.c | 18 ++++++ src/tpm2/tpm_to_platform_interface.h | 37 ++++++++++--- src/tpm_tpm2_interface.c | 15 ++++- 11 files changed, 110 insertions(+), 171 deletions(-) delete mode 100644 src/tpm2/VendorInfo.h diff --git a/src/Makefile.am b/src/Makefile.am index 83a5c158e..085555ee3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -588,7 +588,6 @@ noinst_HEADERS += \ tpm2/TpmTypes.h \ tpm2/Unmarshal_fp.h \ tpm2/Unseal_fp.h \ - tpm2/VendorInfo.h \ tpm2/VerifyConfiguration.h \ tpm2/VerifySignature_fp.h \ tpm2/X509.h \ diff --git a/src/tpm2/GpMacros.h b/src/tpm2/GpMacros.h index 001f3b6f0..c721fc31d 100644 --- a/src/tpm2/GpMacros.h +++ b/src/tpm2/GpMacros.h @@ -11,7 +11,6 @@ #endif #include "endian_swap.h" -#include "VendorInfo.h" #include "TpmFail_fp.h" //** For Self-test diff --git a/src/tpm2/PropertyCap.c b/src/tpm2/PropertyCap.c index d16bdb6c5..2febd5fdb 100644 --- a/src/tpm2/PropertyCap.c +++ b/src/tpm2/PropertyCap.c @@ -12,6 +12,9 @@ #include "tpm_library_intern.h" // libtpms added //** Functions +const char TPM_PT_FAMILY_INDICATOR_VALUE[] = "2.0"; +TPM_STATIC_ASSERT(sizeof(TPM_PT_FAMILY_INDICATOR_VALUE) == sizeof(UINT32)); + //*** TPMPropertyIsDefined() // This function accepts a property selection and, if so, sets 'value' // to the value of the property. @@ -26,28 +29,30 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property UINT32* value // OUT: property value ) { + SPEC_CAPABILITY_VALUE spec_capability_value = {0}; + _plat_GetSpecCapabilityValue(&spec_capability_value); switch(property) { case TPM_PT_FAMILY_INDICATOR: // from the title page of the specification // For this specification, the value is "2.0". - *value = TPM_SPEC_FAMILY; + *value = BYTE_ARRAY_TO_UINT32(TPM_PT_FAMILY_INDICATOR_VALUE); break; case TPM_PT_LEVEL: // from the title page of the specification - *value = TPM_SPEC_LEVEL; + *value = spec_capability_value.tpmSpecLevel; break; case TPM_PT_REVISION: // from the title page of the specification - *value = TPM_SPEC_VERSION; + *value = spec_capability_value.tpmSpecVersion; break; case TPM_PT_DAY_OF_YEAR: // computed from the date value on the title page of the specification - *value = TPM_SPEC_DAY_OF_YEAR; + *value = spec_capability_value.tpmSpecDayOfYear; break; case TPM_PT_YEAR: // from the title page of the specification - *value = TPM_SPEC_YEAR; + *value = spec_capability_value.tpmSpecYear; break; case TPM_PT_MANUFACTURER: @@ -78,15 +83,19 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property case TPM_PT_VENDOR_TPM_TYPE: // vendor-defined value indicating the TPM model // We just make up a number here - *value = _plat__GetTpmType(); + *value = _plat__GetVendorTpmType(); break; case TPM_PT_FIRMWARE_VERSION_1: // more significant 32-bits of a vendor-specific value + // note this value originates in the platform, and is set into gp + // during TPM_Manufacture. *value = gp.firmwareV1; break; case TPM_PT_FIRMWARE_VERSION_2: // less significant 32-bits of a vendor-specific value + // note this value originates in the platform, and is set into gp + // during TPM_Manufacture. *value = gp.firmwareV2; break; case TPM_PT_INPUT_BUFFER: @@ -252,24 +261,26 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property // platform specific values for the TPM_PT_PS parameters from // the relevant platform-specific specification // In this reference implementation, all of these values are 0. - *value = PLATFORM_FAMILY; + *value = spec_capability_value.platformFamily; break; case TPM_PT_PS_LEVEL: // level of the platform-specific specification - *value = PLATFORM_LEVEL; + *value = spec_capability_value.platfromLevel; break; case TPM_PT_PS_REVISION: - // specification Revision times 100 for the platform-specific - // specification - *value = PLATFORM_VERSION; + // The platform spec version is recorded such that 0x00000101 means version 1.01 + // Note this differs from some TPM/TCG specifications, but matches the behavior of Windows. + // more recent TCG specs have discontinued using this field, but Windows displays it, so we + // retain it using the historical encoding. + *value = spec_capability_value.platformRevision; break; case TPM_PT_PS_DAY_OF_YEAR: // platform-specific specification day of year using TCG calendar - *value = PLATFORM_DAY_OF_YEAR; + *value = spec_capability_value.platformDayOfYear; break; case TPM_PT_PS_YEAR: // platform-specific specification year using the CE - *value = PLATFORM_YEAR; + *value = spec_capability_value.platformYear; break; case TPM_PT_SPLIT_MAX: // number of split signing operations supported by the TPM diff --git a/src/tpm2/TpmFail.c b/src/tpm2/TpmFail.c index b4094ae9c..89a5a813f 100644 --- a/src/tpm2/TpmFail.c +++ b/src/tpm2/TpmFail.c @@ -348,7 +348,7 @@ void TpmFailureMode(uint32_t inRequestSize, // IN: command buffer size case TPM_PT_VENDOR_TPM_TYPE: // vendor-defined value indicating the TPM model // We just make up a number here - pt = _plat__GetTpmType(); + pt = _plat__GetVendorTpmType(); break; case TPM_PT_FIRMWARE_VERSION_1: diff --git a/src/tpm2/TpmProfile.h b/src/tpm2/TpmProfile.h index 9e7a6bbd5..0acc9a87b 100644 --- a/src/tpm2/TpmProfile.h +++ b/src/tpm2/TpmProfile.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Constants Reflecting a Particular TPM Implementation (e.g. PC Client) */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FOR LIBTPMS: DO NOT EDIT THIS or INCLUDED FILES! // ANY MODIFICATION WILL LEAD TO AN UNSUPPORTED CONFIGURATION @@ -71,7 +13,6 @@ #include "TpmProfile_CommandList.h" #include "TpmProfile_Misc.h" #include "TpmProfile_ErrorCodes.h" -#include "VendorInfo.h" // libtpms: added begin #ifndef HASH_LIB diff --git a/src/tpm2/TpmProfile_Common.h b/src/tpm2/TpmProfile_Common.h index e6cc36528..289a65c0c 100644 --- a/src/tpm2/TpmProfile_Common.h +++ b/src/tpm2/TpmProfile_Common.h @@ -216,6 +216,8 @@ #endif // libtpms added end +// number of vendor properties, must currently be 1. +#define MAX_VENDOR_PROPERTY (1) //*********************************************** // Enable VENDOR_PERMANENT_AUTH_HANDLE? diff --git a/src/tpm2/VendorInfo.c b/src/tpm2/VendorInfo.c index b73722b91..e37c2a14c 100644 --- a/src/tpm2/VendorInfo.c +++ b/src/tpm2/VendorInfo.c @@ -207,7 +207,30 @@ LIB_EXPORT int _plat__GetTpmFirmwareSecret( #endif // FW_LIMITED_SUPPORT // return the TPM Type returned by TPM_PT_VENDOR_TPM_TYPE -LIB_EXPORT uint32_t _plat__GetTpmType() +LIB_EXPORT uint32_t _plat__GetVendorTpmType() { return 1; // just the value the reference code has returned in the past. } + +LIB_EXPORT void _plat_GetSpecCapabilityValue(SPEC_CAPABILITY_VALUE* returnData) +{ + // clang-format off + // this is on the title page of part1 of the TPM spec + returnData->tpmSpecLevel = 0; + // these come from part2 of the TPM spec + returnData->tpmSpecVersion = 183; // libtpms changed + returnData->tpmSpecYear = 2024; // libtpms changed + returnData->tpmSpecDayOfYear = 25; // libtpms changed + // these come from the PC CLient Platform TPM Profile Specification + returnData->platformFamily = 1; + returnData->platfromLevel = 0; + // The platform spec version is recorded such that 0x00000101 means version 1.01 + // Note this differs from some TPM/TCG specifications, but matches the behavior of Windows. + // more recent TCG specs have discontinued using this field, but Windows displays it, so we + // retain it using the historical encoding. + returnData->platformRevision = 0x106; // libtpms changed + returnData->platformYear = 2024; // libtpms changed + returnData->platformDayOfYear = 25; // libtpms changed + // clang-format on + return; +} diff --git a/src/tpm2/VendorInfo.h b/src/tpm2/VendorInfo.h deleted file mode 100644 index 67f4323d0..000000000 --- a/src/tpm2/VendorInfo.h +++ /dev/null @@ -1,82 +0,0 @@ -/********************************************************************************/ -/* */ -/* Vendor Info */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023-2024 */ -/* */ -/********************************************************************************/ - - -#ifndef _VENDORINFO_H -#define _VENDORINFO_H - -// Define the TPM specification-specific capability values. -#define TPM_SPEC_FAMILY (0x322E3000) -#define TPM_SPEC_LEVEL_NUM 0 // libtpms added: TPM_SPEC_LEVEL without leading zeros and '()' -#define TPM_SPEC_LEVEL (00) -#define TPM_SPEC_VERSION 183 // libtpms changed: removed '()' -#define TPM_SPEC_YEAR (2024) -#define TPM_SPEC_DAY_OF_YEAR (25) -#define MAX_VENDOR_PROPERTY (1) - -// Define the platform specification-specific capability values. -#define PLATFORM_FAMILY (1) /* kgold changed for PC Client */ -#define PLATFORM_LEVEL TPM_SPEC_LEVEL_NUM // libtpms: changed -#define PLATFORM_VERSION (0x00000106) -#define PLATFORM_YEAR TPM_SPEC_YEAR // libtpms: changed -#define PLATFORM_DAY_OF_YEAR TPM_SPEC_DAY_OF_YEAR // libtpms: changed - -#endif - diff --git a/src/tpm2/_TPM_Init.c b/src/tpm2/_TPM_Init.c index 35b3a740b..3a9ab399b 100644 --- a/src/tpm2/_TPM_Init.c +++ b/src/tpm2/_TPM_Init.c @@ -4,6 +4,21 @@ #include "_TPM_Init_fp.h" #include "StateMarshal.h" // libtpms added +// Move this to a future _plat_NvUpdateData() API and perform this in +// platform code. +static void UpgradeNvData() // libtpms changed: static +{ + // only update when required to avoid unnecessary flash defragmentation + if(gp.firmwareV1 != _plat__GetTpmFirmwareVersionHigh() + || gp.firmwareV2 != _plat__GetTpmFirmwareVersionLow()) + { + gp.firmwareV1 = _plat__GetTpmFirmwareVersionHigh(); + gp.firmwareV2 = _plat__GetTpmFirmwareVersionLow(); + NV_SYNC_PERSISTENT(firmwareV1); + NV_SYNC_PERSISTENT(firmwareV2); + } +} + // This function is used to process a _TPM_Init indication. LIB_EXPORT void _TPM_Init(void) { @@ -72,6 +87,9 @@ LIB_EXPORT void _TPM_Init(void) // If this is not done here, things break NvRead(&go, NV_ORDERLY_DATA, sizeof(go)); + // Update and fix up any NV variables + UpgradeNvData(); + // Start clock. Need to do this after NV has been restored. TimePowerOn(); /* libtpms added begin */ diff --git a/src/tpm2/tpm_to_platform_interface.h b/src/tpm2/tpm_to_platform_interface.h index d8666f27d..350a5832f 100644 --- a/src/tpm2/tpm_to_platform_interface.h +++ b/src/tpm2/tpm_to_platform_interface.h @@ -338,23 +338,44 @@ LIB_EXPORT uint32_t _plat__GetUnique(uint32_t which, LIB_EXPORT void _plat__GetPlatformManufactureData(uint8_t* pPlatformPersistentData, uint32_t bufferSize); -// return the 4 character Manufacturer Capability code. This +// return the 4 character Manufacturer Capability code (TPM_PT_MANUFACTURER). This // should come from the platform library since that is provided by the manufacturer -LIB_EXPORT uint32_t _plat__GetManufacturerCapabilityCode(void); // libtpms changed +LIB_EXPORT uint32_t _plat__GetManufacturerCapabilityCode(void); -// return the 4 character VendorStrings for Capabilities. +// return the 4 character VendorStrings for GetCapability (TPM_PT_VENDOR_STRING_1-4) // Index is ONE-BASED, and may be in the range [1,4] inclusive. // Any other index returns all zeros. The return value will be interpreted // as an array of 4 ASCII characters (with no null terminator) LIB_EXPORT uint32_t _plat__GetVendorCapabilityCode(int index); // return the most-significant 32-bits of the TPM Firmware Version reported by -// getCapability. -LIB_EXPORT uint32_t _plat__GetTpmFirmwareVersionHigh(void); // libtpms changed +// getCapability (TPM_PT_FIRMWARE_VERSION_1) +LIB_EXPORT uint32_t _plat__GetTpmFirmwareVersionHigh(void); // return the least-significant 32-bits of the TPM Firmware Version reported by -// getCapability. -LIB_EXPORT uint32_t _plat__GetTpmFirmwareVersionLow(void); // libtpms changed +// getCapability (TPM_PT_FIRMWARE_VERSION_2) +LIB_EXPORT uint32_t _plat__GetTpmFirmwareVersionLow(void); + +// return the Vendor TPM Type returned by TPM_PT_VENDOR_TPM_TYPE +LIB_EXPORT uint32_t _plat__GetVendorTpmType(void); + +// Struct to define TPM and platform specific capability value +typedef struct _spec_capability_value +{ + uint32_t tpmSpecLevel; + uint32_t tpmSpecVersion; + uint32_t tpmSpecYear; + uint32_t tpmSpecDayOfYear; + + uint32_t platformFamily; + uint32_t platfromLevel; + uint32_t platformRevision; + uint32_t platformYear; + uint32_t platformDayOfYear; +} SPEC_CAPABILITY_VALUE; + +// return info on TPM and Platform Specific capability values. +LIB_EXPORT void _plat_GetSpecCapabilityValue(SPEC_CAPABILITY_VALUE* returnData); // return the TPM Firmware's current SVN. LIB_EXPORT uint16_t _plat__GetTpmFirmwareSvn(void); @@ -391,8 +412,6 @@ LIB_EXPORT int _plat__GetTpmFirmwareSecret( ); #endif // FW_LIMITED_SUPPORT -// return the TPM Type returned by TPM_PT_VENDOR_TPM_TYPE -LIB_EXPORT uint32_t _plat__GetTpmType(void); // libtpms changed #if ENABLE_TPM_DEBUG_PRINT diff --git a/src/tpm_tpm2_interface.c b/src/tpm_tpm2_interface.c index 24712c032..89c181159 100644 --- a/src/tpm_tpm2_interface.c +++ b/src/tpm_tpm2_interface.c @@ -361,11 +361,11 @@ static TPM_RESULT TPM2_GetTPMProperty(enum TPMLIB_TPMProperty prop, */ static char *TPM2_GetInfo(enum TPMLIB_InfoFlags flags) { - const char *tpmspec = + const char *tpmspec_temp = "\"TPMSpecification\":{" "\"family\":\"2.0\"," - "\"level\":" STRINGIFY(TPM_SPEC_LEVEL_NUM) "," - "\"revision\":" STRINGIFY(TPM_SPEC_VERSION) + "\"level\": %u," + "\"revision\": %u" "}"; const char *tpmattrs_temp = "\"TPMAttributes\":{" @@ -409,10 +409,12 @@ static char *TPM2_GetInfo(enum TPMLIB_InfoFlags flags) "]"; char *fmt = NULL, *buffer; bool printed = false; + char *tpmspec = NULL; char *tpmattrs = NULL; char *tpmfeatures = NULL; char rsakeys[32]; char camelliakeys[16]; + SPEC_CAPABILITY_VALUE spec_capability_value = {0}; char *runtimeAlgos[RUNTIME_ALGO_NUM] = { NULL, }; char *runtimeCmds[RUNTIME_CMD_NUM] = { NULL, }; char *runtimeAttrs[RUNTIME_ATTR_NUM] = { NULL, }; @@ -432,8 +434,14 @@ static char *TPM2_GetInfo(enum TPMLIB_InfoFlags flags) return NULL; if ((flags & TPMLIB_INFO_TPMSPECIFICATION)) { + _plat_GetSpecCapabilityValue(&spec_capability_value); + fmt = buffer; buffer = NULL; + if (TPMLIB_asprintf(&tpmspec, tpmspec_temp, + spec_capability_value.tpmSpecLevel, + spec_capability_value.tpmSpecVersion) < 0) + goto error; if (TPMLIB_asprintf(&buffer, fmt, "", tpmspec, "%s%s%s") < 0) goto error; free(fmt); @@ -598,6 +606,7 @@ static char *TPM2_GetInfo(enum TPMLIB_InfoFlags flags) exit: free(fmt); + free(tpmspec); free(tpmattrs); free(tpmfeatures); free(profile); From 2d42189008e78c3e7ccb8db1d5afefa242efe184 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 17:29:22 -0400 Subject: [PATCH 33/52] Sync: Format TpmProfile_CommandList.h Signed-off-by: Stefan Berger --- src/tpm2/TpmProfile_CommandList.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/tpm2/TpmProfile_CommandList.h b/src/tpm2/TpmProfile_CommandList.h index e7dc2d33f..11392c0c8 100644 --- a/src/tpm2/TpmProfile_CommandList.h +++ b/src/tpm2/TpmProfile_CommandList.h @@ -19,28 +19,29 @@ #define CC_YES YES #define CC_NO NO -// +// do not format automatically - the comments confuse clang-format. +// clang-format off + // Defines for Implemented Commands -// // Commands that are defined in the spec, but not implemented for various // reasons: // The TPM reference implementation does not implement attached-component // features, and the Compliance test suite has no test cases. -#define CC_AC_GetCapability CC_NO -#define CC_AC_Send CC_NO +#define CC_AC_GetCapability CC_NO +#define CC_AC_Send CC_NO // The TPM reference implementation does not implement firmware upgrade. -#define CC_FieldUpgradeData CC_NO -#define CC_FieldUpgradeStart CC_NO -#define CC_FirmwareRead CC_NO +#define CC_FieldUpgradeData CC_NO +#define CC_FieldUpgradeStart CC_NO +#define CC_FirmwareRead CC_NO // A prototype of CertifyX509 is provided here for informative purposes only. // While all of the TPM reference implementation is provided "AS IS" without any // warranty, the current design and implementation of CertifyX509 are considered // to be especially unsuitable for product use. -#define CC_CertifyX509 CC_YES +#define CC_CertifyX509 CC_YES // Normal commands: From ce8fad96e083abaa2031ffcea775537f6e1e32a3 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 17:33:32 -0400 Subject: [PATCH 34/52] Sync: Reformat comments in Global.h Signed-off-by: Stefan Berger --- src/tpm2/Global.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/tpm2/Global.h b/src/tpm2/Global.h index 3faab678b..456e6a51b 100644 --- a/src/tpm2/Global.h +++ b/src/tpm2/Global.h @@ -1082,19 +1082,17 @@ typedef struct state_reset_data // the TPM will return TPM_RC_RANGE and the TPM will only accept Shutdown(CLEAR). UINT32 clearCount; // The default reset value is 0. - UINT64 objectContextID; // This is the context ID for a saved - // object context. The default reset - // value is 0. - CONTEXT_SLOT contextArray[MAX_ACTIVE_SESSIONS]; // This array contains - // contains the values used to track - // the version numbers of saved - // contexts (see - // Session.c in for details). The - // default reset value is {0}. - - CONTEXT_COUNTER contextCounter; // This is the value from which the - // 'contextID' is derived. The - // default reset value is {0}. + // This is the context ID for a saved object context. The default reset + // value is 0. + UINT64 objectContextID; + + // This array contains the values used to track the version numbers of saved + // contexts (see Session.c in for details). The default reset value is {0}. + CONTEXT_SLOT contextArray[MAX_ACTIVE_SESSIONS]; + + // This is the value from which the 'contextID' is derived. The default + // reset value is {0}. + CONTEXT_COUNTER contextCounter; //***************************************************************************** // Command Audit From 10ea432f35ec59739c9ac59f1e9ef15d17832bcc Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 17:36:48 -0400 Subject: [PATCH 35/52] Sync: Throw a build error if CC_AC_GetCapability is enabled Signed-off-by: Stefan Berger --- src/tpm2/CommandDispatchData.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tpm2/CommandDispatchData.h b/src/tpm2/CommandDispatchData.h index cd2adb854..b79c6e03b 100644 --- a/src/tpm2/CommandDispatchData.h +++ b/src/tpm2/CommandDispatchData.h @@ -5563,7 +5563,8 @@ COMMAND_DESCRIPTOR_t* s_CommandDataArray[] = { (COMMAND_DESCRIPTOR_t*)_EncryptDecrypt2DataAddress, #endif // CC_EncryptDecrypt2 #if (PAD_LIST || CC_AC_GetCapability) - (COMMAND_DESCRIPTOR_t*)_GetCapabilityDataAddress, +//#error "Not Implemented the Dispatch structure needs to be created" // libtpms changed begin + (COMMAND_DESCRIPTOR_t*)_GetCapabilityDataAddress, // libtpms changed end #endif // CC_AC_GetCapability #if (PAD_LIST || CC_AC_Send) (COMMAND_DESCRIPTOR_t*)_AC_SendDataAddress, @@ -5598,7 +5599,7 @@ COMMAND_DESCRIPTOR_t* s_CommandDataArray[] = { #if (PAD_LIST || CC_SetCapability) (COMMAND_DESCRIPTOR_t*)_SetCapabilityDataAddress, #endif // CC_SetCapability -#if (PAD_LIST || CC_ReadControl) +#if (PAD_LIST || CC_ReadOnlyControl) (COMMAND_DESCRIPTOR_t*)_ReadOnlyControlDataAddress, #endif // CC_ReadOnlyControl #if (PAD_LIST || CC_PolicyTransportSPDM) From 8fe2c574285512d36bfbb7e99ae5c0d36d1a3b5e Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 17:40:28 -0400 Subject: [PATCH 36/52] Sync: Add NOT_REFERENCED to avoid build error Signed-off-by: Stefan Berger --- src/tpm2/Object_spt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tpm2/Object_spt.c b/src/tpm2/Object_spt.c index f267758a2..6fc2928b1 100644 --- a/src/tpm2/Object_spt.c +++ b/src/tpm2/Object_spt.c @@ -1034,6 +1034,10 @@ static UINT16 MarshalSensitive( MemoryPad2B(&sensitive->authValue.b, CryptHashGetDigestSize(nameAlg)); buffer += 2; +#if !ALG_RSA + NOT_REFERENCED(parent); +#endif + // Marshal the structure #if 0 /* ALG_RSA */ // libtpms changed: We never set the RSA_prime_flag! // If the sensitive size is the special case for a prime in the type From 5d5b61e28f6760c0cb2a4091ede220ae994838f9 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 17:42:46 -0400 Subject: [PATCH 37/52] Sync: Add more buffer size checks to CryptParameterDecryption Signed-off-by: Stefan Berger --- src/tpm2/CryptUtil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tpm2/CryptUtil.c b/src/tpm2/CryptUtil.c index aea0076e4..a88e9882b 100644 --- a/src/tpm2/CryptUtil.c +++ b/src/tpm2/CryptUtil.c @@ -68,6 +68,8 @@ #include "Tpm.h" #include "Marshal.h" +#include "tpm_library_intern.h" // libtpms added + //****************************************************************************/ //** Hash/HMAC Functions //****************************************************************************/ @@ -1052,7 +1054,8 @@ CryptParameterDecryption( return TPM_RC_INSUFFICIENT; } - if(cipherSize > bufferSize) + if(cipherSize > MAX_COMMAND_SIZE || bufferSize <= 0 + || (UINT32)cipherSize > (UINT32)bufferSize) { return TPM_RC_SIZE; } From dd0efdf0c5e3f124c4696a75df1cf4d5808d97fb Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 17:46:52 -0400 Subject: [PATCH 38/52] Sync: Only build x509 related functions if CC_CertifyX509 is '1' Signed-off-by: Stefan Berger --- src/tpm2/X509_ECC.c | 64 ++++----------------------------------------- src/tpm2/X509_RSA.c | 64 +++------------------------------------------ 2 files changed, 8 insertions(+), 120 deletions(-) diff --git a/src/tpm2/X509_ECC.c b/src/tpm2/X509_ECC.c index 2d73f9db8..70b30624e 100644 --- a/src/tpm2/X509_ECC.c +++ b/src/tpm2/X509_ECC.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM X509 ECC */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes #include "Tpm.h" @@ -67,6 +9,8 @@ #include "X509_spt_fp.h" #include "CryptHash_fp.h" +#if ALG_ECC && CC_CertifyX509 + //** Functions //*** X509PushPoint() @@ -163,3 +107,5 @@ X509AddPublicECC(OBJECT* object, ASN1MarshalContext* ctx) } return ASN1EndEncapsulation(ctx, ASN1_CONSTRUCTED_SEQUENCE); // Ends SEQUENCE 1st } + +#endif // #if ALG_ECC && CC_CertifyX509 diff --git a/src/tpm2/X509_RSA.c b/src/tpm2/X509_RSA.c index 651e90688..385b2c2a6 100644 --- a/src/tpm2/X509_RSA.c +++ b/src/tpm2/X509_RSA.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM X509 RSA */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes #include "Tpm.h" @@ -69,7 +11,7 @@ //** Functions -#if ALG_RSA +#if ALG_RSA && CC_CertifyX509 //*** X509AddSigningAlgorithmRSA() // This creates the singing algorithm data. @@ -253,4 +195,4 @@ X509AddPublicRSA(OBJECT* object, ASN1MarshalContext* ctx) return ASN1EndEncapsulation(ctx, ASN1_CONSTRUCTED_SEQUENCE); } -#endif // ALG_RSA +#endif // ALG_RSA && CC_CertifyX509 From f9e215490e1b209dbb52e77675dddb1eb51475f2 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 17:48:32 -0400 Subject: [PATCH 39/52] Sync: Fix comments Signed-off-by: Stefan Berger --- src/tpm2/Context_spt.c | 2 +- src/tpm2/ExecCommand.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/tpm2/Context_spt.c b/src/tpm2/Context_spt.c index 9107a25eb..db29319bb 100644 --- a/src/tpm2/Context_spt.c +++ b/src/tpm2/Context_spt.c @@ -152,7 +152,7 @@ TPM_RC ComputeContextIntegrity(TPMS_CONTEXT* contextBlob, // IN: context blob &hmacState.hashState, sizeof(gp.totalResetCount), gp.totalResetCount); // If this is a ST_CLEAR object, add the clear count - // so that this contest cannot be loaded after a TPM Restart + // so that this context cannot be loaded after a TPM Restart if(contextBlob->savedHandle == 0x80000002) CryptDigestUpdateInt( &hmacState.hashState, sizeof(gr.clearCount), gr.clearCount); diff --git a/src/tpm2/ExecCommand.c b/src/tpm2/ExecCommand.c index 90487dfc2..0d580296e 100644 --- a/src/tpm2/ExecCommand.c +++ b/src/tpm2/ExecCommand.c @@ -111,11 +111,9 @@ LIB_EXPORT void ExecuteCommand( // will go into failure mode. NvCheckState(); - // Due to the limitations of the simulation, TPM clock must be explicitly - // synchronized with the system clock whenever a command is received. - // This function call is not necessary in a hardware TPM. However, taking - // a snapshot of the hardware timer at the beginning of the command allows - // the time value to be consistent for the duration of the command execution. + // Taking a snapshot of the hardware timer at the beginning of the command + // allows the time value to be consistent for the duration of the command + // execution. This will also update the NV time state if appropriate. TimeUpdateToCurrent(); // Any command through this function will unceremoniously end the From 22902e44486048dcd01ecee3ab28d8b7f3c8cb15 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 17:52:42 -0400 Subject: [PATCH 40/52] Sync: Add another fallthrough hint for static analysis tools Signed-off-by: Stefan Berger --- src/tpm2/Object_spt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tpm2/Object_spt.c b/src/tpm2/Object_spt.c index 6fc2928b1..9dc6915b4 100644 --- a/src/tpm2/Object_spt.c +++ b/src/tpm2/Object_spt.c @@ -365,9 +365,8 @@ CreateChecks(OBJECT* parentObject, && !IS_ATTRIBUTE(attributes, TPMA_OBJECT, decrypt) && IS_ATTRIBUTE(attributes, TPMA_OBJECT, sensitiveDataOrigin)) result = TPM_RC_ATTRIBUTES; - // comment out the next line in order to prevent a fixedTPM derivation - // parent - // break; + // fall through to prevent a fixedTPM derivation parent + // [[fallthrough]]; /* fallthrough */ // libtpms added case TPM_ALG_SYMCIPHER: // A restricted key symmetric key (SYMCIPHER and KEYEDHASH) From 9b149b1bfa7b9b5f2c040df5f5efc19faa556381 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 7 Aug 2025 18:52:44 -0400 Subject: [PATCH 41/52] Sync: Replace a printf with DEBUG_PRINT in BnToOsslMath.c Signed-off-by: Stefan Berger --- src/tpm2/crypto/openssl/BnToOsslMath.c | 91 +++++++------------------- 1 file changed, 23 insertions(+), 68 deletions(-) diff --git a/src/tpm2/crypto/openssl/BnToOsslMath.c b/src/tpm2/crypto/openssl/BnToOsslMath.c index d305f3063..685b21341 100644 --- a/src/tpm2/crypto/openssl/BnToOsslMath.c +++ b/src/tpm2/crypto/openssl/BnToOsslMath.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // The functions in this file provide the low-level interface between the TPM code @@ -163,7 +105,7 @@ BIGNUM* BigInitialized(BIGNUM* toInit, bigConst initializer) # define BIGNUM_PRINT(label, bn, eol) # define DEBUG_PRINT(x) # else -# define DEBUG_PRINT(x) printf("%s", x) +# define DEBUG_PRINT(x) TPM_DEBUG_PRINTF("%s", x) # define BIGNUM_PRINT(label, bn, eol) BIGNUM_print((label), (bn), (eol)) //*** BIGNUM_print() @@ -174,14 +116,19 @@ static void BIGNUM_print(const char* label, const BIGNUM* a, BOOL eol) int notZero = FALSE; if(label != NULL) - printf("%s", label); + { + DEBUG_PRINT("%s", label); + } + if(a == NULL) { - printf("NULL"); + DEBUG_PRINT("NULL"); goto done; } if(a->neg) - printf("-"); + { + DEBUG_PRINT("-"); + } for(i = a->top, d = &a->d[i - 1]; i > 0; i--) { int j; @@ -191,14 +138,20 @@ static void BIGNUM_print(const char* label, const BIGNUM* a, BOOL eol) BYTE b = (BYTE)((l >> j) & 0xFF); notZero = notZero || (b != 0); if(notZero) - printf("%02x", b); + { + DEBUG_PRINT("%02x", b); + } } if(!notZero) - printf("0"); + { + DEBUG_PRINT("0"); + } } done: if(eol) - printf("\n"); + { + DEBUG_PRINT("\n"); + } return; } # endif @@ -213,7 +166,9 @@ static BIGNUM* BnNewVariable(BN_CTX* CTX) // This check is intended to protect against calling this function without // having initialized the CTX. if((CTX == NULL) || ((new = BN_CTX_get(CTX)) == NULL)) - FAIL(FATAL_ERROR_ALLOCATION); + { + FAIL_NULL(FATAL_ERROR_ALLOCATION); + } return new; } @@ -406,7 +361,6 @@ LIB_EXPORT BOOL BnModExp(bigNum result, // OUT: the result OSSL_LEAVE(); return OK; } -# endif // ALG_RSA //*** BnModInverse() // Modular multiplicative inverse @@ -433,6 +387,7 @@ LIB_EXPORT BOOL BnModInverse(bigNum result, bigConst number, bigConst modulus) OSSL_LEAVE(); return OK; } +# endif // ALG_RSA # if ALG_ECC From a446639d9bb295f47aa97f0e0ac56a2191482085 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Fri, 8 Aug 2025 06:24:12 -0400 Subject: [PATCH 42/52] Sync: Introduce platform functions for accessing NV indices Signed-off-by: Stefan Berger --- src/Makefile.am | 5 ++ src/tpm2/Entity.c | 71 +++++++++++++++++--- src/tpm2/NVCommands.c | 98 ---------------------------- src/tpm2/NVVirtual.c | 70 ++++++++++++++++++++ src/tpm2/NV_Read.c | 71 ++++++++++++++++++++ src/tpm2/NV_ReadPublic.c | 42 ++++++++++++ src/tpm2/NV_ReadPublic2.c | 48 ++++++++++++++ src/tpm2/NvDynamic.c | 49 ++++++++++++-- src/tpm2/NvDynamic_fp.h | 64 +----------------- src/tpm2/SessionProcess.c | 49 ++++++++++++-- src/tpm2/platform_virtual_nv_fp.h | 50 ++++++++++++++ src/tpm2/tpm_to_platform_interface.h | 3 + 12 files changed, 440 insertions(+), 180 deletions(-) create mode 100644 src/tpm2/NVVirtual.c create mode 100644 src/tpm2/NV_Read.c create mode 100644 src/tpm2/NV_ReadPublic.c create mode 100644 src/tpm2/NV_ReadPublic2.c create mode 100644 src/tpm2/platform_virtual_nv_fp.h diff --git a/src/Makefile.am b/src/Makefile.am index 085555ee3..2c64640e3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -248,6 +248,10 @@ libtpms_tpm2_la_SOURCES = \ tpm2/NvDynamic.c \ tpm2/NVMem.c \ tpm2/NvReserved.c \ + tpm2/NVVirtual.c \ + tpm2/NV_Read.c \ + tpm2/NV_ReadPublic.c \ + tpm2/NV_ReadPublic2.c \ tpm2/NV_spt.c \ tpm2/Object.c \ tpm2/ObjectChangeAuth.c \ @@ -485,6 +489,7 @@ noinst_HEADERS += \ tpm2/PlatformInternal.h \ tpm2/platform_failure_mode_fp.h \ tpm2/platform_init_fp.h \ + tpm2/platform_virtual_nv_fp.h \ tpm2/platform_public_interface.h \ tpm2/platform_pcr_fp.h \ tpm2/platform_to_tpm_interface.h \ diff --git a/src/tpm2/Entity.c b/src/tpm2/Entity.c index e06606923..bdc058436 100644 --- a/src/tpm2/Entity.c +++ b/src/tpm2/Entity.c @@ -8,6 +8,7 @@ //** Includes #include "Tpm.h" +#include "platform_virtual_nv_fp.h" //** Functions //*** EntityGetLoadStatus() @@ -116,10 +117,14 @@ EntityGetLoadStatus(COMMAND* command // IN/OUT: command parsing structure result = TPM_RC_REFERENCE_H0; break; case TPM_HT_NV_INDEX: - // For an NV Index, use the TPM-specific routine + { + // For an NV Index, use the platform-specific routine // to search the IN Index space. - result = NvIndexIsAccessible(handle); + BOOL commandAcceptsVirtualHandles = + _plat__NvOperationAcceptsVirtualHandles(command->index); + result = NvIndexIsAccessible(handle, commandAcceptsVirtualHandles); break; + } case TPM_HT_PCR: // Any PCR handle that is unmarshaled successfully referenced // a PCR that is defined. @@ -167,9 +172,11 @@ EntityGetAuthValue(TPMI_DH_ENTITY handle, // IN: handle of entity TPM2B_AUTH* auth // OUT: authValue of the entity ) { - TPM2B_AUTH* pAuth = NULL; + TPM2B_AUTH* pAuth = NULL; + NV_INDEX* nvIndex = NULL; + NV_INDEX tempIndex = {0}; - auth->t.size = 0; + auth->t.size = 0; switch(HandleGetType(handle)) { @@ -240,8 +247,18 @@ EntityGetAuthValue(TPMI_DH_ENTITY handle, // IN: handle of entity case TPM_HT_NV_INDEX: // authValue for an NV index { - NV_INDEX* nvIndex = NvGetIndexInfo(handle, NULL); - pAssert(nvIndex != NULL); + if(_plat__IsNvVirtualIndex(handle)) + { + _plat__NvVirtual_PopulateNvIndexInfo( + handle, &tempIndex.publicArea, &tempIndex.authValue); + nvIndex = &tempIndex; + } + else + { + nvIndex = NvGetIndexInfo(handle, NULL); + } + pAssert_ZERO(nvIndex != NULL); + pAuth = &nvIndex->authValue; } break; @@ -328,8 +345,23 @@ EntityGetAuthPolicy(TPMI_DH_ENTITY handle, // IN: handle of entity case TPM_HT_NV_INDEX: // authPolicy for a NV index { - NV_INDEX* nvIndex = NvGetIndexInfo(handle, NULL); - pAssert(nvIndex != 0); + NV_INDEX* nvIndex = NvGetIndexInfo(handle, NULL); + NV_INDEX tempNvIndex = {0}; + if(nvIndex == NULL) + { + if(!_plat__IsNvVirtualIndex(handle)) + { + FAIL_IMMEDIATE(FATAL_ERROR_INTERNAL, TPM_ALG_NULL); + } + else + { + _plat__NvVirtual_PopulateNvIndexInfo( + handle, &tempNvIndex.publicArea, &tempNvIndex.authValue); + nvIndex = &tempNvIndex; + } + } + // nvIndex guaranteed non-null at this point. + *authPolicy = nvIndex->publicArea.authPolicy; hashAlg = nvIndex->publicArea.nameAlg; } @@ -429,16 +461,35 @@ EntityGetHierarchy(TPMI_DH_ENTITY handle // IN :handle of entity // hierarchy for NV index { NV_INDEX* nvIndex = NvGetIndexInfo(handle, NULL); - pAssert(nvIndex != NULL); + if(nvIndex == NULL) + { + if(!_plat__IsNvVirtualIndex(handle)) + { + FAIL_IMMEDIATE(FATAL_ERROR_INTERNAL, TPM_RH_NULL); + } + else + { + NV_INDEX tempNvIndex = {0}; + _plat__NvVirtual_PopulateNvIndexInfo( + handle, &tempNvIndex.publicArea, &tempNvIndex.authValue); + nvIndex = &tempNvIndex; + } + } + // nvIndex guaranteed non-null at this point. // If only the platform can delete the index, then it is // considered to be in the platform hierarchy, otherwise it // is in the owner hierarchy. - if(IS_ATTRIBUTE( + if(nvIndex != NULL + && IS_ATTRIBUTE( nvIndex->publicArea.attributes, TPMA_NV, PLATFORMCREATE)) + { hierarchy = TPM_RH_PLATFORM; + } else + { hierarchy = TPM_RH_OWNER; + } } break; case TPM_HT_TRANSIENT: diff --git a/src/tpm2/NVCommands.c b/src/tpm2/NVCommands.c index bd5690b88..720c4852e 100644 --- a/src/tpm2/NVCommands.c +++ b/src/tpm2/NVCommands.c @@ -152,24 +152,6 @@ TPM2_NV_UndefineSpaceSpecial( } #endif // CC_NV_UndefineSpaceSpecial #include "Tpm.h" -#include "NV_ReadPublic_fp.h" -#if CC_NV_ReadPublic // Conditional expansion of this file -TPM_RC -TPM2_NV_ReadPublic( - NV_ReadPublic_In *in, // IN: input parameter list - NV_ReadPublic_Out *out // OUT: output parameter list - ) -{ - NV_INDEX *nvIndex = NvGetIndexInfo(in->nvIndex, NULL); - // Command Output - // Copy index public data to output - out->nvPublic.nvPublic = nvIndex->publicArea; - // Compute NV name - NvGetIndexName(nvIndex, &out->nvName); - return TPM_RC_SUCCESS; -} -#endif // CC_NV_ReadPublic -#include "Tpm.h" #include "NV_Write_fp.h" #if CC_NV_Write // Conditional expansion of this file TPM_RC @@ -431,49 +413,6 @@ TPM2_NV_GlobalWriteLock( } #endif // CC_NV_GlobalWriteLock #include "Tpm.h" -#include "NV_Read_fp.h" -#if CC_NV_Read // Conditional expansion of this file -/* TPM_RC_NV_AUTHORIZATION the authorization was valid but the authorizing entity (authHandle) is - not allowed to read from the Index referenced by nvIndex */ -/* TPM_RC_NV_LOCKED the Index referenced by nvIndex is read locked */ -/* TPM_RC_NV_RANGE read range defined by size and offset is outside the range of the Index - referenced by nvIndex */ -/* TPM_RC_NV_UNINITIALIZED the Index referenced by nvIndex has not been initialized (written) */ -/* TPM_RC_VALUE the read size is larger than the MAX_NV_BUFFER_SIZE */ -TPM_RC -TPM2_NV_Read( - NV_Read_In *in, // IN: input parameter list - NV_Read_Out *out // OUT: output parameter list - ) -{ - NV_REF locator; - NV_INDEX *nvIndex = NvGetIndexInfo(in->nvIndex, &locator); - TPM_RC result; - // Input Validation - // Common read access checks. NvReadAccessChecks() may return - // TPM_RC_NV_AUTHORIZATION, TPM_RC_NV_LOCKED, or TPM_RC_NV_UNINITIALIZED - result = NvReadAccessChecks(in->authHandle, in->nvIndex, - nvIndex->publicArea.attributes); - if(result != TPM_RC_SUCCESS) - return result; - // Make sure the data will fit the return buffer - if(in->size > MAX_NV_BUFFER_SIZE) - return TPM_RCS_VALUE + RC_NV_Read_size; - // Verify that the offset is not too large - if(in->offset > nvIndex->publicArea.dataSize) - return TPM_RCS_VALUE + RC_NV_Read_offset; - // Make sure that the selection is within the range of the Index - if(in->size > (nvIndex->publicArea.dataSize - in->offset)) - return TPM_RC_NV_RANGE; - // Command Output - // Set the return size - out->data.t.size = in->size; - // Perform the read - NvGetIndexData(nvIndex, locator, in->offset, in->size, out->data.t.buffer); - return TPM_RC_SUCCESS; -} -#endif // CC_NV_Read -#include "Tpm.h" #include "NV_ReadLock_fp.h" #if CC_NV_ReadLock // Conditional expansion of this file TPM_RC @@ -622,43 +561,6 @@ TPM2_NV_Certify( } #endif // CC_NV_Certify -#include "Tpm.h" -#include "NV_ReadPublic2_fp.h" - -#if CC_NV_ReadPublic2 // Conditional expansion of this file - -/*(See part 3 specification) -// Read the public information of a NV index -*/ -TPM_RC -TPM2_NV_ReadPublic2(NV_ReadPublic2_In* in, // IN: input parameter list - NV_ReadPublic2_Out* out // OUT: output parameter list - ) -{ - TPM_RC result; - NV_INDEX* nvIndex; - - nvIndex = NvGetIndexInfo(in->nvIndex, NULL); - - // Command Output - - // The reference code stores its NV indices in the legacy form, because - // it doesn't support any extended attributes. - // Translate the legacy form to the general form. - result = NvPublic2FromNvPublic(&nvIndex->publicArea, &out->nvPublic.nvPublic2); - if(result != TPM_RC_SUCCESS) - { - return RcSafeAddToResult(result, RC_NV_ReadPublic2_nvIndex); - } - - // Compute NV name - NvGetIndexName(nvIndex, &out->nvName); - - return TPM_RC_SUCCESS; -} - -#endif // CC_NV_ReadPublic2 - #include "Tpm.h" #include "NV_DefineSpace2_fp.h" diff --git a/src/tpm2/NVVirtual.c b/src/tpm2/NVVirtual.c new file mode 100644 index 000000000..cde23aaf2 --- /dev/null +++ b/src/tpm2/NVVirtual.c @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Platform.h" +#include "TpmAlgorithmDefines.h" +#include "TpmTypes.h" +#include "platform_virtual_nv_fp.h" + +// NV Index handles for EKICA and EK Certificates. +#define RSA_2048_EK_CERT_HANDLE (0x01c00002) +#define ECC_P256_EK_CERT_HANDLE (0x01c0000a) +#define ECC_EK_ICA_HANDLE (0x01c00100) + +LIB_EXPORT TPM_RC _plat__NvVirtual_PopulateNvIndexInfo( + TPM_HANDLE handle, // IN: handle for the index + TPMS_NV_PUBLIC* publicArea, // INOUT: The public area structure to be modified. + TPM2B_AUTH* authValue // INOUT: The auth value structure to be modified. +) +{ + NOT_REFERENCED(handle); + NOT_REFERENCED(publicArea); + NOT_REFERENCED(authValue); + return TPM_RC_NO_RESULT; +} + +LIB_EXPORT TPM_RC _plat__NvVirtual_Read( + NV_Read_In* in, // IN: input parameter list + NV_Read_Out* out // OUT: output parameter list +) +{ + NOT_REFERENCED(in); + NOT_REFERENCED(out); + return TPM_RC_NO_RESULT; +} + +LIB_EXPORT TPM_RC _plat__NvVirtual_ReadPublic( + NV_ReadPublic_In* in, // IN: input parameter list + NV_ReadPublic_Out* out // OUT: output parameter list +) +{ + NOT_REFERENCED(in); + NOT_REFERENCED(out); + return TPM_RC_NO_RESULT; +} + +LIB_EXPORT TPMI_YES_NO _plat__NvVirtual_CapGetIndex( + TPMI_DH_OBJECT handle, // IN: start handle + UINT32 count, // IN: max number of returned handles + TPML_HANDLE* handleList // OUT: list of handle +) +{ + NOT_REFERENCED(handle); + NOT_REFERENCED(count); + NOT_REFERENCED(handleList); + return NO; +} + +LIB_EXPORT BOOL _plat__NvOperationAcceptsVirtualHandles(TPM_CC commandCode) +{ + NOT_REFERENCED(commandCode); + return FALSE; +} + +LIB_EXPORT BOOL _plat__IsNvVirtualIndex(TPM_HANDLE handle) +{ + NOT_REFERENCED(handle); + // might be something like this: + // (handle == ECC_P256_EK_CERT_HANDLE || handle == RSA_2048_EK_CERT_HANDLE + // || handle == ECC_EK_ICA_HANDLE); + return FALSE; +} diff --git a/src/tpm2/NV_Read.c b/src/tpm2/NV_Read.c new file mode 100644 index 000000000..e72c8ea8b --- /dev/null +++ b/src/tpm2/NV_Read.c @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "NV_Read_fp.h" +#include "platform_virtual_nv_fp.h" + +#if CC_NV_Read // Conditional expansion of this file + +/*(See part 3 specification) +// Read of an NV index +*/ +// Return Type: TPM_RC +// TPM_RC_NV_AUTHORIZATION the authorization was valid but the +// authorizing entity ('authHandle') +// is not allowed to read from the Index +// referenced by 'nvIndex' +// TPM_RC_NV_LOCKED the Index referenced by 'nvIndex' is +// read locked +// TPM_RC_NV_RANGE read range defined by 'size' and 'offset' +// is outside the range of the Index referenced +// by 'nvIndex' +// TPM_RC_NV_UNINITIALIZED the Index referenced by 'nvIndex' has +// not been initialized (written) +// TPM_RC_VALUE the read size is larger than the +// MAX_NV_BUFFER_SIZE +TPM_RC +TPM2_NV_Read(NV_Read_In* in, // IN: input parameter list + NV_Read_Out* out // OUT: output parameter list +) +{ + // Handle special cases for EK cert and EKICA cert. + if(_plat__IsNvVirtualIndex(in->nvIndex)) + { + return _plat__NvVirtual_Read(in, out); + } + + NV_REF locator; + NV_INDEX* nvIndex = NvGetIndexInfo(in->nvIndex, &locator); + TPM_RC result; + + // Input Validation + // Common read access checks. NvReadAccessChecks() may return + // TPM_RC_NV_AUTHORIZATION, TPM_RC_NV_LOCKED, or TPM_RC_NV_UNINITIALIZED + result = NvReadAccessChecks( + in->authHandle, in->nvIndex, nvIndex->publicArea.attributes); + if(result != TPM_RC_SUCCESS) + return result; + + // Make sure the data will fit the return buffer + if(in->size > MAX_NV_BUFFER_SIZE) + return TPM_RCS_VALUE + RC_NV_Read_size; + + // Verify that the offset is not too large + if(in->offset > nvIndex->publicArea.dataSize) + return TPM_RCS_VALUE + RC_NV_Read_offset; + + // Make sure that the selection is within the range of the Index + if(in->size > (nvIndex->publicArea.dataSize - in->offset)) + return TPM_RC_NV_RANGE; + + // Command Output + // Set the return size + out->data.t.size = in->size; + + // Perform the read + NvGetIndexData(nvIndex, locator, in->offset, in->size, out->data.t.buffer); + + return TPM_RC_SUCCESS; +} + +#endif // CC_NV_Read diff --git a/src/tpm2/NV_ReadPublic.c b/src/tpm2/NV_ReadPublic.c new file mode 100644 index 000000000..48e15e9a9 --- /dev/null +++ b/src/tpm2/NV_ReadPublic.c @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "NV_ReadPublic_fp.h" +#include "platform_virtual_nv_fp.h" + +#if CC_NV_ReadPublic // Conditional expansion of this file + +/*(See part 3 specification) +// Read the public information of a NV index +*/ +TPM_RC +TPM2_NV_ReadPublic(NV_ReadPublic_In* in, // IN: input parameter list + NV_ReadPublic_Out* out // OUT: output parameter list +) +{ + // This command only supports TPM_HT_NV_INDEX-typed NV indices. + if(HandleGetType(in->nvIndex) != TPM_HT_NV_INDEX) + { + return TPM_RCS_HANDLE + RC_NV_ReadPublic_nvIndex; + } + + // Handle special cases for EK cert and special indexes + if(_plat__IsNvVirtualIndex(in->nvIndex)) + { + return _plat__NvVirtual_ReadPublic(in, out); + } + + NV_INDEX* nvIndex = NvGetIndexInfo(in->nvIndex, NULL); + + // Command Output + + // Copy index public data to output + out->nvPublic.nvPublic = nvIndex->publicArea; + + // Compute NV name + NvGetIndexName(nvIndex, &out->nvName); + + return TPM_RC_SUCCESS; +} + +#endif // CC_NV_ReadPublic diff --git a/src/tpm2/NV_ReadPublic2.c b/src/tpm2/NV_ReadPublic2.c new file mode 100644 index 000000000..b6de7efd7 --- /dev/null +++ b/src/tpm2/NV_ReadPublic2.c @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Tpm.h" +#include "NV_ReadPublic2_fp.h" +#include "NV_DefineSpace_fp.h" // for the RC modifiers +#include "platform_virtual_nv_fp.h" + +#if CC_NV_ReadPublic2 // Conditional expansion of this file + +/*(See part 3 specification) +// Read the public information of a NV index +*/ +TPM_RC +TPM2_NV_ReadPublic2(NV_ReadPublic2_In* in, // IN: input parameter list + NV_ReadPublic2_Out* out // OUT: output parameter list +) +{ + TPM_RC result; + NV_INDEX* nvIndex; + + // Handle special cases for EK cert and special indexes + if(_plat__IsNvVirtualIndex(in->nvIndex)) + { + // currently NV_ReadPublic2 doesn't know how to handle virtual indexes. + return TPM_RCS_HANDLE + RC_NV_DefineSpace_publicInfo; + } + + nvIndex = NvGetIndexInfo(in->nvIndex, NULL); + + // Command Output + + // The reference code stores its NV indices in the legacy form, because + // it doesn't support any extended attributes. + // Translate the legacy form to the general form. + result = NvPublic2FromNvPublic(&nvIndex->publicArea, &out->nvPublic.nvPublic2); + if(result != TPM_RC_SUCCESS) + { + return RcSafeAddToResult(result, RC_NV_ReadPublic2_nvIndex); + } + + // Compute NV name + NvGetIndexName(nvIndex, &out->nvName); + + return TPM_RC_SUCCESS; +} + +#endif // CC_NV_ReadPublic2 + diff --git a/src/tpm2/NvDynamic.c b/src/tpm2/NvDynamic.c index a73513b6d..0b851a922 100644 --- a/src/tpm2/NvDynamic.c +++ b/src/tpm2/NvDynamic.c @@ -41,6 +41,7 @@ #define NV_C #include "Tpm.h" #include "Marshal.h" +#include "platform_virtual_nv_fp.h" // libtpms changed #include "tpm_library_intern.h" // libtpms added #include "BackwardsCompatibilityObject.h" // libtpms added @@ -795,9 +796,17 @@ BOOL NvIsOwnerPersistentHandle(TPM_HANDLE handle // IN: handle // TPM_RC_NV_WRITELOCKED Index is present but locked for writing and command // writes to the index TPM_RC -NvIndexIsAccessible(TPMI_RH_NV_INDEX handle // IN: handle -) +NvIndexIsAccessible(TPMI_RH_NV_INDEX handle, // IN: handle + BOOL commandAcceptsVirtualHandles) { + // For virtual indexes nothing is actually stored in the NV + // so if it exists, it's considered "accessible", though the relevant + // virtual API may return a locked result later. + if(_plat__IsNvVirtualIndex(handle)) + { + return commandAcceptsVirtualHandles ? TPM_RC_SUCCESS : TPM_RC_NV_LOCKED; + } + NV_INDEX* nvIndex = NvGetIndexInfo(handle, NULL); // if(nvIndex == NULL) @@ -908,9 +917,14 @@ void NvGetIndexData(NV_INDEX* nvIndex, // IN: the in RAM index descriptor { // Get data from RAM buffer NV_RAM_REF ramAddr = NvRamGetIndex(nvIndex->publicArea.nvIndex); - pAssert(ramAddr != 0 - && (size <= ((NV_RAM_HEADER*)ramAddr)->size - sizeof(NV_RAM_HEADER) - - offset)); + + // Copy the contents of ramAddr into a local NV_RAM_HEADER variable before + // performing the boundary check to avoid potential alignment issues + NV_RAM_HEADER nvRamHeader; + MemoryCopy(&nvRamHeader, ramAddr, sizeof(NV_RAM_HEADER)); + pAssert_VOID_OK( + ramAddr != 0 + && (size <= (nvRamHeader.size - sizeof(NV_RAM_HEADER) - offset))); MemoryCopy(data, ramAddr + sizeof(NV_RAM_HEADER) + offset, size); } else @@ -1191,8 +1205,25 @@ TPM2B_NAME* NvGetNameByIndexHandle( TPM2B_NAME* name // OUT: name of the index ) { - NV_INDEX* nvIndex = NvGetIndexInfo(handle, NULL); - // + NV_INDEX* nvIndex = NULL; + NV_INDEX tempIndex = {0}; + + if(_plat__IsNvVirtualIndex(handle)) + { + _plat__NvVirtual_PopulateNvIndexInfo( + handle, &tempIndex.publicArea, &tempIndex.authValue); + nvIndex = &tempIndex; + } + else + { + nvIndex = NvGetIndexInfo(handle, NULL); + if(nvIndex == NULL) + { + name->b.size = 0; // set to empty reply. + return name; + } + } + return NvGetIndexName(nvIndex, name); } @@ -1624,6 +1655,10 @@ NvCapGetIndex(TPMI_DH_OBJECT handle, // IN: start handle // used here. InsertSort(handleList, count, nvHandle); } + + // Check virtual indices as well. + more |= _plat__NvVirtual_CapGetIndex(handle, count, handleList); + return more; } diff --git a/src/tpm2/NvDynamic_fp.h b/src/tpm2/NvDynamic_fp.h index e960f515c..d679bd139 100644 --- a/src/tpm2/NvDynamic_fp.h +++ b/src/tpm2/NvDynamic_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Dynamic space for user defined NV */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 @@ -136,8 +78,8 @@ BOOL NvIsOwnerPersistentHandle(TPM_HANDLE handle // IN: handle // TPM_RC_NV_WRITELOCKED Index is present but locked for writing and command // writes to the index TPM_RC -NvIndexIsAccessible(TPMI_RH_NV_INDEX handle // IN: handle -); +NvIndexIsAccessible(TPMI_RH_NV_INDEX handle, // IN: handle + BOOL commandAcceptsVirtualHandles); //*** NvGetEvictObject() // This function is used to dereference an evict object handle and get a pointer diff --git a/src/tpm2/SessionProcess.c b/src/tpm2/SessionProcess.c index 4f61b633f..a90891c44 100644 --- a/src/tpm2/SessionProcess.c +++ b/src/tpm2/SessionProcess.c @@ -13,6 +13,7 @@ #include "Tpm.h" #include "ACT.h" #include "Marshal.h" +#include "platform_virtual_nv_fp.h" #if SEC_CHANNEL_SUPPORT # include "SecChannel_fp.h" #endif // SEC_CHANNEL_SUPPORT @@ -54,7 +55,18 @@ BOOL IsDAExempted(TPM_HANDLE handle // IN: entity handle } case TPM_HT_NV_INDEX: { - NV_INDEX* nvIndex = NvGetIndexInfo(handle, NULL); + NV_INDEX* nvIndex = NULL; + NV_INDEX ekIndex = {0}; + if(_plat__IsNvVirtualIndex(handle)) + { + _plat__NvVirtual_PopulateNvIndexInfo( + handle, &ekIndex.publicArea, &ekIndex.authValue); + nvIndex = &ekIndex; + } + else + { + nvIndex = NvGetIndexInfo(handle, NULL); + } result = IS_ATTRIBUTE(nvIndex->publicArea.attributes, TPMA_NV, NO_DA); break; } @@ -327,10 +339,24 @@ static BOOL IsAuthValueAvailable(TPM_HANDLE handle, // IN: handle of e // NV Index. { NV_REF locator; - NV_INDEX* nvIndex = NvGetIndexInfo(handle, &locator); + NV_INDEX* nvIndex = NULL; TPMA_NV nvAttributes; // - pAssert(nvIndex != 0); + + if(_plat__IsNvVirtualIndex(handle)) + { + NV_INDEX tempIndex = {0}; + _plat__NvVirtual_PopulateNvIndexInfo( + handle, &tempIndex.publicArea, &tempIndex.authValue); + nvIndex = &tempIndex; + + locator = (NV_REF)0; + } + else + { + nvIndex = NvGetIndexInfo(handle, &locator); + } + pAssert_BOOL(nvIndex != 0); nvAttributes = nvIndex->publicArea.attributes; @@ -1502,9 +1528,24 @@ static TPM_RC CheckAuthSession( if((TPM_HT_NV_INDEX == HandleGetType(associatedHandle)) && authUsed) { NV_REF locator; - NV_INDEX* nvIndex = NvGetIndexInfo(associatedHandle, &locator); + NV_INDEX* nvIndex = NULL; NV_PIN pinData; TPMA_NV nvAttributes; + NV_INDEX tempIndex = {0}; + + if(_plat__IsNvVirtualIndex(associatedHandle)) + { + _plat__NvVirtual_PopulateNvIndexInfo( + associatedHandle, &tempIndex.publicArea, &tempIndex.authValue); + nvIndex = &tempIndex; + + locator = (NV_REF)0; + } + else + { + nvIndex = NvGetIndexInfo(associatedHandle, &locator); + } + // pAssert_RC(nvIndex != NULL); nvAttributes = nvIndex->publicArea.attributes; diff --git a/src/tpm2/platform_virtual_nv_fp.h b/src/tpm2/platform_virtual_nv_fp.h new file mode 100644 index 000000000..e16388b4f --- /dev/null +++ b/src/tpm2/platform_virtual_nv_fp.h @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#ifndef _PLATFORM_VIRTUAL_FP_H_ +#define _PLATFORM_VIRTUAL_FP_H_ + +#include "NV_Read_fp.h" +#include "NV_ReadPublic_fp.h" + +// The ECC EK Cert and EK ICA Cert NV indexes are not populated like normal. +// Data is generated on the fly and returned when NV_Read or NV_ReadPublic is +// called for them. This function populates the given NV_VIRTUAL_INDEX structure with +// attributes for the EK cert and EKICA cert scenarios. If the NV index is not virtual, +// the function should return TPM_RC_NO_RESULT. +LIB_EXPORT TPM_RC _plat__NvVirtual_PopulateNvIndexInfo( + TPM_HANDLE handle, // IN: handle for the index + TPMS_NV_PUBLIC* publicArea, // INOUT: The public area structure to be modified. + TPM2B_AUTH* authValue // INOUT: The auth value structure to be modified. +); + +// Performs NV Read call to handle EK/EKICA cert scenarios. +LIB_EXPORT TPM_RC _plat__NvVirtual_Read( + NV_Read_In* dataIn, // IN: input parameter list + NV_Read_Out* dataOut // OUT: output parameter list +); + +// Performs NV Read Public call to handle EK/EKICA cert scenarios. +LIB_EXPORT TPM_RC _plat__NvVirtual_ReadPublic( + NV_ReadPublic_In* dataIn, // IN: input parameter list + NV_ReadPublic_Out* dataOut // OUT: output parameter list +); + +// Returns a list of handles of virtual NV indices, starting from 'handle'. +// 'Handle' must be in the range of NV indices, but does not have to reference +// an existing virtual NV Index. +LIB_EXPORT TPMI_YES_NO _plat__NvVirtual_CapGetIndex( + TPMI_DH_OBJECT handle, // IN: start handle + UINT32 count, // IN: max number of returned handles + TPML_HANDLE* handleList // OUT: list of handle +); + +// Does this NV operation accept virtual NV handles? +// If the operation is not an NV operation, returns false. +LIB_EXPORT BOOL _plat__NvOperationAcceptsVirtualHandles(TPM_CC commandCode); + +// Checks if the given handle belongs to one of the virtual indices. +// Currently only used with the ECC EK Certificate and EKICA Certificate +// indices. +LIB_EXPORT BOOL _plat__IsNvVirtualIndex(TPM_HANDLE handle); + +#endif // _PLATFORM_VIRTUAL_FP_H_ diff --git a/src/tpm2/tpm_to_platform_interface.h b/src/tpm2/tpm_to_platform_interface.h index 350a5832f..e97fcbffb 100644 --- a/src/tpm2/tpm_to_platform_interface.h +++ b/src/tpm2/tpm_to_platform_interface.h @@ -434,4 +434,7 @@ LIB_EXPORT size_t _plat_debug_snprintf( // platform failure mode functions #include "platform_failure_mode_fp.h" +// platform virtual NV functions +#include "platform_virtual_nv_fp.h" + #endif // _TPM_TO_PLATFORM_INTERFACE_H_ From a1d42dd59060097614f0650e0db892d4eb99e27e Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Fri, 8 Aug 2025 07:27:13 -0400 Subject: [PATCH 43/52] Sync: Implement platform function to determine enabled self tests Signed-off-by: Stefan Berger --- src/Makefile.am | 1 + src/tpm2/AlgorithmTests.c | 4 ++-- src/tpm2/CryptSelfTest.c | 18 ++++++++++++++++-- src/tpm2/SelfTest.c | 16 ++++++++++++++++ src/tpm2/tpm_to_platform_interface.h | 16 ++++++++++++++++ 5 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 src/tpm2/SelfTest.c diff --git a/src/Makefile.am b/src/Makefile.am index 2c64640e3..14f219670 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -283,6 +283,7 @@ libtpms_tpm2_la_SOURCES = \ tpm2/ResponseCodeProcessing.c \ tpm2/RunCommand.c \ tpm2/SecChannel.c \ + tpm2/SelfTest.c \ tpm2/Session.c \ tpm2/SessionCommands.c \ tpm2/SessionProcess.c \ diff --git a/src/tpm2/AlgorithmTests.c b/src/tpm2/AlgorithmTests.c index a5814506b..33a74a1af 100644 --- a/src/tpm2/AlgorithmTests.c +++ b/src/tpm2/AlgorithmTests.c @@ -800,7 +800,7 @@ TestAlgorithm(TPM_ALG_ID alg, ALGORITHM_VECTOR* toTest) // silently CLEAR it. Decided to just clear. if(!TEST_BIT(alg, g_implementedAlgorithms)) { - CLEAR_BIT(alg, *toTest); + CLEAR_BOTH(alg); continue; } // Process whatever is left. @@ -934,7 +934,7 @@ TestAlgorithm(TPM_ALG_ID alg, ALGORITHM_VECTOR* toTest) break; # endif // ALG_ECC default: - CLEAR_BIT(alg, *toTest); + CLEAR_BOTH(alg); break; } if(result != TPM_RC_SUCCESS) diff --git a/src/tpm2/CryptSelfTest.c b/src/tpm2/CryptSelfTest.c index 87fe3d50a..0aa50ce56 100644 --- a/src/tpm2/CryptSelfTest.c +++ b/src/tpm2/CryptSelfTest.c @@ -58,7 +58,7 @@ TPM_RC CryptSelfTest(TPMI_YES_NO fullTest // IN: if full test is required ) { - + ALGORITHM_VECTOR toTestVector = {0}; // If the caller requested a full test, then reset the to test vector so that // all the tests will be run @@ -66,7 +66,21 @@ CryptSelfTest(TPMI_YES_NO fullTest // IN: if full test is required { MemoryCopy(g_toTest, g_implementedAlgorithms, sizeof(g_toTest)); } - return CryptRunSelfTests(&g_toTest); + + // Some platforms may have alternative crypto libraries and self-test capabilities, + // so allow the platform to return the list of tests it wants the TPM code to run + // directly. We assume the platform will make alternative arrangements for any + // tests it does not return here, consistent with that platform's compliance goals. + // + // A platform may provide different lists at different times and we leave the + // g_toTest flags set for any tests that are not requested by the platform. + // + // Note that a crypto library may also perform additional self-tests through other + // means and/or in response to g_toTest at other points in the code. + MemoryCopy(toTestVector, g_toTest, sizeof(toTestVector)); + _plat_GetEnabledSelfTest(fullTest, toTestVector, sizeof(toTestVector)); + + return CryptRunSelfTests(&toTestVector); } //*** CryptIncrementalSelfTest() diff --git a/src/tpm2/SelfTest.c b/src/tpm2/SelfTest.c new file mode 100644 index 000000000..7d3a1c83b --- /dev/null +++ b/src/tpm2/SelfTest.c @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include "Platform.h" +#include "TpmAlgorithmDefines.h" +#include "TpmTypes.h" + +LIB_EXPORT void _plat_GetEnabledSelfTest( + uint8_t fullTest, // IN: full test or not + uint8_t* pToTestVector, // INOUT: initialized byte array of tracked tests + size_t toTestVectorSize // IN: size of the byte array in bytes +) +{ + (void)fullTest; + (void)pToTestVector; + (void)toTestVectorSize; +} diff --git a/src/tpm2/tpm_to_platform_interface.h b/src/tpm2/tpm_to_platform_interface.h index e97fcbffb..7910d2f0f 100644 --- a/src/tpm2/tpm_to_platform_interface.h +++ b/src/tpm2/tpm_to_platform_interface.h @@ -377,6 +377,22 @@ typedef struct _spec_capability_value // return info on TPM and Platform Specific capability values. LIB_EXPORT void _plat_GetSpecCapabilityValue(SPEC_CAPABILITY_VALUE* returnData); +// Return enabled self-tests on the platform when TPM SelfTest is called. +// +// pToTestVector is a byte array allocated by the TPM library, each bit in the array +// represents a TPM_ALG_ID to be tested. The bit length of the vector is +// (8 * toTestVectorSize), which is larger than or equal to TPM_ALG_LAST + 1. +// +// Initially the vector have bits set for all implemented algorithms or remaining +// algorithms to test, based on fullTest option, and platform should update the vector +// to indicate which tests are actually enabled on the platform based on the its +// capabilities at the time of the call. +LIB_EXPORT void _plat_GetEnabledSelfTest( + uint8_t fullTest, // IN: full test or not + uint8_t* pToTestVector, // INOUT: initialized byte array of tracked tests + size_t toTestVectorSize // IN: size of the byte array in bytes +); + // return the TPM Firmware's current SVN. LIB_EXPORT uint16_t _plat__GetTpmFirmwareSvn(void); From e1bf687f22480ae476d4b4dbfd484e954f3d778c Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Mon, 11 Aug 2025 15:54:22 -0400 Subject: [PATCH 44/52] tpm2: Adopt the directory structure of upstream code repo Signed-off-by: Stefan Berger --- configure.ac | 2 +- scripts/meld-all | 4 +- src/Makefile.am | 839 +++++++++--------- src/tpm2/BackwardsCompatibilityBitArray.h | 2 +- src/tpm2/{crypto => }/CryptDes_fp.h | 0 src/tpm2/NVMarshal.c | 2 +- src/tpm2/NVMarshal.h | 2 +- src/tpm2/Platform.h | 26 - src/tpm2/Platform_fp.h | 3 +- src/tpm2/RuntimeAlgorithm.c | 2 +- src/tpm2/StateMarshal.h | 2 +- src/tpm2/TPMCmd/Platform/include/Platform.h | 28 + .../Platform/include}/PlatformACT.h | 0 .../Platform/include}/PlatformClock.h | 0 .../Platform/include}/PlatformData.h | 0 .../Platform/include}/PlatformInternal.h | 0 .../prototypes}/platform_public_interface.h | 0 src/tpm2/{ => TPMCmd/Platform/src}/Cancel.c | 0 src/tpm2/{ => TPMCmd/Platform/src}/Clock.c | 0 .../{ => TPMCmd/Platform/src}/DebugHelpers.c | 0 src/tpm2/{ => TPMCmd/Platform/src}/Entropy.c | 0 .../{ => TPMCmd/Platform/src}/ExtraData.c | 0 src/tpm2/{ => TPMCmd/Platform/src}/Failure.c | 0 src/tpm2/{ => TPMCmd/Platform/src}/Init.c | 0 .../{ => TPMCmd/Platform/src}/LocalityPlat.c | 0 src/tpm2/{ => TPMCmd/Platform/src}/NVMem.c | 0 .../{ => TPMCmd/Platform/src}/NVVirtual.c | 6 +- src/tpm2/{ => TPMCmd/Platform/src}/PPPlat.c | 0 .../{ => TPMCmd/Platform/src}/PlatformACT.c | 0 .../{ => TPMCmd/Platform/src}/PlatformData.c | 0 .../{ => TPMCmd/Platform/src}/PlatformPcr.c | 2 +- .../{ => TPMCmd/Platform/src}/PowerPlat.c | 0 .../{ => TPMCmd/Platform/src}/RunCommand.c | 0 src/tpm2/{ => TPMCmd/Platform/src}/SelfTest.c | 4 +- src/tpm2/{ => TPMCmd/Platform/src}/Unique.c | 0 .../{ => TPMCmd/Platform/src}/VendorInfo.c | 0 .../Simulator/include}/TpmTcpProtocol.h | 0 .../include/prototypes}/Simulator_fp.h | 0 src/tpm2/{ => TPMCmd/Simulator/src}/TPMCmdp.c | 0 .../Simulator/src}/simulatorPrivate.h | 37 +- .../Simulator/src}/simulator_sysheaders.h | 0 .../TpmConfiguration}/TpmBuildSwitches.h | 2 +- .../TpmConfiguration}/TpmProfile.h | 10 +- .../TpmProfile_CommandList.h | 2 +- .../TpmConfiguration}/TpmProfile_Common.h | 0 .../TpmConfiguration}/TpmProfile_ErrorCodes.h | 0 .../TpmConfiguration}/TpmProfile_Misc.h | 0 .../CommandAttributeData_s_ccAttr.inl | 0 ...mmandAttributeData_s_commandAttributes.inl | 0 .../CommandDispatchData_CommandStructures.inl | 2 +- ...CommandDispatchData_s_CommandDataArray.inl | 0 .../VendorCommands/VendorCommandList.h | 0 .../prototypes}/Vendor_TCG_Test_fp.h | 0 .../Vendor_TCG_Test.c | 7 +- .../EccRef}/TpmEcc_Signature_ECDSA.c | 0 .../tpm/cryptolibs/Ossl}/BnToOsslMath.c | 2 +- .../tpm/cryptolibs/Ossl}/ExpDCache.c | 0 .../tpm/cryptolibs/Ossl}/Helpers.c | 0 .../cryptolibs/Ossl}/TpmToOsslDesSupport.c | 0 .../tpm/cryptolibs/Ossl}/TpmToOsslSupport.c | 6 +- .../tpm/cryptolibs/Ossl/include}/BnOssl.h | 16 +- .../Ossl/include/Ossl}/BnToOsslMath.h | 4 +- .../Ossl/include/Ossl}/BnToOsslMath_fp.h | 0 .../Ossl/include/Ossl}/ExpDCache_fp.h | 0 .../Ossl/include/Ossl}/Helpers_fp.h | 2 +- .../include/Ossl}/TpmToOsslDesSupport_fp.h | 0 .../Ossl/include/Ossl}/TpmToOsslHash.h | 0 .../Ossl/include/Ossl}/TpmToOsslSupport_fp.h | 0 .../Ossl/include/Ossl}/TpmToOsslSym.h | 0 .../tpm/cryptolibs/RsaRef}/PrimeData.c | 0 .../tpm/cryptolibs/TpmBigNum}/BnConvert.c | 0 .../cryptolibs/TpmBigNum}/BnEccConstants.c | 4 +- .../tpm/cryptolibs/TpmBigNum}/BnMath.c | 0 .../tpm/cryptolibs/TpmBigNum}/BnMemory.c | 0 .../tpm/cryptolibs/TpmBigNum}/TpmBigNum.h | 16 +- .../cryptolibs/TpmBigNum}/TpmBigNumThunks.c | 0 .../TpmBigNum/include}/BnConvert_fp.h | 0 .../cryptolibs/TpmBigNum/include}/BnMath_fp.h | 0 .../TpmBigNum/include}/BnMemory_fp.h | 0 .../TpmBigNum/include}/BnSupport_Interface.h | 4 +- .../cryptolibs/TpmBigNum/include}/BnUtil_fp.h | 0 .../cryptolibs/TpmBigNum/include}/BnValues.h | 8 +- .../include/TpmBigNum}/TpmToTpmBigNumMath.h | 8 +- .../common/include}/CryptoInterface.h | 2 +- .../common/include}/EccConstantData.inl | 0 .../common/include}/MathLibraryInterface.h | 0 .../include}/MathLibraryInterfaceTypes.h | 0 .../include/platform_interface}/pcrstruct.h | 6 +- .../platform_to_tpm_interface.h | 10 + .../prototypes}/ExecCommand_fp.h | 0 .../prototypes}/Manufacture_fp.h | 0 .../prototypes}/_TPM_Hash_Data_fp.h | 0 .../prototypes}/_TPM_Hash_End_fp.h | 0 .../prototypes}/_TPM_Hash_Start_fp.h | 0 .../prototypes}/_TPM_Init_fp.h | 0 .../prototypes}/platform_failure_mode_fp.h | 0 .../prototypes}/platform_init_fp.h | 0 .../prototypes}/platform_pcr_fp.h | 6 +- .../prototypes}/platform_virtual_nv_fp.h | 4 +- .../tpm_to_platform_interface.h | 12 +- .../include/private}/CommandAttributeData.h | 4 +- .../tpm/include/private}/CommandAttributes.h | 0 .../include/private}/CommandDispatchData.h | 4 +- .../tpm/include/private}/CryptEcc.h | 0 .../tpm/include/private}/CryptHash.h | 0 .../tpm/include/private}/CryptRand.h | 0 .../tpm/include/private}/CryptRsa.h | 0 .../tpm/include/private}/CryptSym.h | 0 .../tpm/include/private}/CryptTest.h | 0 .../tpm/include/private}/EccTestData.h | 0 .../{ => TPMCmd/tpm/include/private}/Global.h | 10 +- .../tpm/include/private}/HashTestData.h | 0 .../tpm/include/private}/InternalRoutines.h | 33 +- .../tpm/include/private}/KdfTestData.h | 0 .../tpm/include/private}/LibSupport.h | 2 +- .../tpm/include/private}/Marshal.h | 0 .../{ => TPMCmd/tpm/include/private}/NV.h | 0 .../{ => TPMCmd/tpm/include/private}/OIDs.h | 0 .../tpm/include/private}/PRNG_TestVectors.h | 0 .../tpm/include/private}/RsaTestData.h | 0 .../tpm/include/private}/SelfTest.h | 0 .../tpm/include/private}/SymmetricTest.h | 0 .../tpm/include/private}/SymmetricTestData.h | 0 .../{ => TPMCmd/tpm/include/private}/Tpm.h | 6 +- .../tpm/include/private}/TpmASN1.h | 0 .../{ => TPMCmd/tpm/include/private}/X509.h | 0 .../private/prototypes}/ACT_SetTimeout_fp.h | 0 .../include/private/prototypes}/ACT_spt_fp.h | 0 .../prototypes}/ActivateCredential_fp.h | 0 .../private/prototypes}/AlgorithmCap_fp.h | 0 .../private/prototypes}/AlgorithmTests_fp.h | 0 .../private/prototypes}/Attest_spt_fp.h | 0 .../tpm/include/private/prototypes}/Bits_fp.h | 0 .../private/prototypes}/CertifyCreation_fp.h | 0 .../private/prototypes}/CertifyX509_fp.h | 0 .../include/private/prototypes}/Certify_fp.h | 0 .../private/prototypes}/ChangeEPS_fp.h | 0 .../private/prototypes}/ChangePPS_fp.h | 0 .../private/prototypes}/ClearControl_fp.h | 0 .../include/private/prototypes}/Clear_fp.h | 0 .../private/prototypes}/ClockRateAdjust_fp.h | 0 .../include/private/prototypes}/ClockSet_fp.h | 0 .../private/prototypes}/CommandAudit_fp.h | 0 .../prototypes}/CommandCodeAttributes_fp.h | 0 .../prototypes}/CommandDispatcher_fp.h | 0 .../include/private/prototypes}/Commit_fp.h | 0 .../private/prototypes}/ContextLoad_fp.h | 0 .../private/prototypes}/ContextSave_fp.h | 0 .../private/prototypes}/Context_spt_fp.h | 0 .../private/prototypes}/CreateLoaded_fp.h | 0 .../private/prototypes}/CreatePrimary_fp.h | 0 .../include/private/prototypes}/Create_fp.h | 0 .../private/prototypes}/CryptCmac_fp.h | 0 .../private/prototypes}/CryptEccCrypt_fp.h | 0 .../prototypes}/CryptEccKeyExchange_fp.h | 0 .../private/prototypes}/CryptEccMain_fp.h | 2 +- .../prototypes}/CryptEccSignature_fp.h | 0 .../private/prototypes}/CryptHash_fp.h | 0 .../private/prototypes}/CryptPrimeSieve_fp.h | 0 .../private/prototypes}/CryptPrime_fp.h | 0 .../private/prototypes}/CryptRand_fp.h | 0 .../include/private/prototypes}/CryptRsa_fp.h | 0 .../private/prototypes}/CryptSelfTest_fp.h | 0 .../private/prototypes}/CryptSmac_fp.h | 0 .../include/private/prototypes}/CryptSym_fp.h | 0 .../private/prototypes}/CryptUtil_fp.h | 0 .../tpm/include/private/prototypes}/DA_fp.h | 0 .../DictionaryAttackLockReset_fp.h | 0 .../DictionaryAttackParameters_fp.h | 0 .../private/prototypes}/Duplicate_fp.h | 0 .../private/prototypes}/ECC_Decrypt_fp.h | 0 .../private/prototypes}/ECC_Encrypt_fp.h | 0 .../private/prototypes}/ECC_Parameters_fp.h | 0 .../private/prototypes}/ECDH_KeyGen_fp.h | 0 .../private/prototypes}/ECDH_ZGen_fp.h | 0 .../private/prototypes}/EC_Ephemeral_fp.h | 0 .../private/prototypes}/EncryptDecrypt2_fp.h | 0 .../private/prototypes}/EncryptDecrypt_fp.h | 0 .../prototypes}/EncryptDecrypt_spt_fp.h | 0 .../include/private/prototypes}/Entity_fp.h | 0 .../prototypes}/EventSequenceComplete_fp.h | 0 .../private/prototypes}/EvictControl_fp.h | 0 .../private/prototypes}/FlushContext_fp.h | 0 .../private/prototypes}/GetCapability_fp.h | 0 .../prototypes}/GetCommandAuditDigest_fp.h | 0 .../private/prototypes}/GetRandom_fp.h | 0 .../prototypes}/GetSessionAuditDigest_fp.h | 0 .../private/prototypes}/GetTestResult_fp.h | 0 .../include/private/prototypes}/GetTime_fp.h | 0 .../private/prototypes}/HMAC_Start_fp.h | 0 .../tpm/include/private/prototypes}/HMAC_fp.h | 0 .../include/private/prototypes}/Handle_fp.h | 0 .../prototypes}/HashSequenceStart_fp.h | 0 .../tpm/include/private/prototypes}/Hash_fp.h | 0 .../prototypes}/HierarchyChangeAuth_fp.h | 0 .../private/prototypes}/HierarchyControl_fp.h | 0 .../private/prototypes}/Hierarchy_fp.h | 0 .../include/private/prototypes}/Import_fp.h | 0 .../prototypes}/IncrementalSelfTest_fp.h | 0 .../private/prototypes}/IoBuffers_fp.h | 0 .../private/prototypes}/LoadExternal_fp.h | 0 .../tpm/include/private/prototypes}/Load_fp.h | 0 .../include/private/prototypes}/Locality_fp.h | 0 .../private/prototypes}/MAC_Start_fp.h | 0 .../tpm/include/private/prototypes}/MAC_fp.h | 0 .../private/prototypes}/MakeCredential_fp.h | 0 .../include/private/prototypes}/Marshal_fp.h | 2 +- .../prototypes}/MathOnByteBuffers_fp.h | 0 .../include/private/prototypes}/Memory_fp.h | 0 .../private/prototypes}/NV_Certify_fp.h | 0 .../private/prototypes}/NV_ChangeAuth_fp.h | 0 .../private/prototypes}/NV_DefineSpace2_fp.h | 0 .../private/prototypes}/NV_DefineSpace_fp.h | 0 .../private/prototypes}/NV_Extend_fp.h | 0 .../prototypes}/NV_GlobalWriteLock_fp.h | 0 .../private/prototypes}/NV_Increment_fp.h | 0 .../private/prototypes}/NV_ReadLock_fp.h | 0 .../private/prototypes}/NV_ReadPublic2_fp.h | 0 .../private/prototypes}/NV_ReadPublic_fp.h | 0 .../include/private/prototypes}/NV_Read_fp.h | 0 .../private/prototypes}/NV_SetBits_fp.h | 0 .../prototypes}/NV_UndefineSpaceSpecial_fp.h | 0 .../private/prototypes}/NV_UndefineSpace_fp.h | 0 .../private/prototypes}/NV_WriteLock_fp.h | 0 .../include/private/prototypes}/NV_Write_fp.h | 0 .../include/private/prototypes}/NV_spt_fp.h | 0 .../private/prototypes}/NvDynamic_fp.h | 0 .../private/prototypes}/NvReserved_fp.h | 0 .../private/prototypes}/ObjectChangeAuth_fp.h | 0 .../include/private/prototypes}/Object_fp.h | 0 .../private/prototypes}/Object_spt_fp.h | 0 .../private/prototypes}/PCR_Allocate_fp.h | 0 .../private/prototypes}/PCR_Event_fp.h | 0 .../private/prototypes}/PCR_Extend_fp.h | 0 .../include/private/prototypes}/PCR_Read_fp.h | 0 .../private/prototypes}/PCR_Reset_fp.h | 0 .../prototypes}/PCR_SetAuthPolicy_fp.h | 0 .../private/prototypes}/PCR_SetAuthValue_fp.h | 0 .../tpm/include/private/prototypes}/PCR_fp.h | 0 .../private/prototypes}/PP_Commands_fp.h | 0 .../tpm/include/private/prototypes}/PP_fp.h | 0 .../private/prototypes}/PolicyAuthValue_fp.h | 0 .../prototypes}/PolicyAuthorizeNV_fp.h | 0 .../private/prototypes}/PolicyAuthorize_fp.h | 0 .../private/prototypes}/PolicyCapability_fp.h | 0 .../prototypes}/PolicyCommandCode_fp.h | 0 .../prototypes}/PolicyCounterTimer_fp.h | 0 .../private/prototypes}/PolicyCpHash_fp.h | 0 .../prototypes}/PolicyDuplicationSelect_fp.h | 0 .../private/prototypes}/PolicyGetDigest_fp.h | 0 .../private/prototypes}/PolicyLocality_fp.h | 0 .../include/private/prototypes}/PolicyNV_fp.h | 0 .../private/prototypes}/PolicyNameHash_fp.h | 0 .../private/prototypes}/PolicyNvWritten_fp.h | 0 .../include/private/prototypes}/PolicyOR_fp.h | 0 .../private/prototypes}/PolicyPCR_fp.h | 0 .../private/prototypes}/PolicyParameters_fp.h | 0 .../private/prototypes}/PolicyPassword_fp.h | 0 .../prototypes}/PolicyPhysicalPresence_fp.h | 0 .../private/prototypes}/PolicyRestart_fp.h | 0 .../private/prototypes}/PolicySecret_fp.h | 0 .../private/prototypes}/PolicySigned_fp.h | 0 .../private/prototypes}/PolicyTemplate_fp.h | 0 .../private/prototypes}/PolicyTicket_fp.h | 0 .../prototypes}/PolicyTransportSPDM_fp.h | 0 .../private/prototypes}/Policy_spt_fp.h | 0 .../include/private/prototypes}/Power_fp.h | 0 .../private/prototypes}/PropertyCap_fp.h | 0 .../include/private/prototypes}/Quote_fp.h | 0 .../private/prototypes}/RSA_Decrypt_fp.h | 0 .../private/prototypes}/RSA_Encrypt_fp.h | 0 .../private/prototypes}/ReadClock_fp.h | 0 .../private/prototypes}/ReadOnlyControl_fp.h | 0 .../private/prototypes}/ReadPublic_fp.h | 0 .../prototypes}/ResponseCodeProcessing_fp.h | 0 .../include/private/prototypes}/Response_fp.h | 0 .../include/private/prototypes}/Rewrap_fp.h | 0 .../private/prototypes}/SecChannel_fp.h | 0 .../include/private/prototypes}/SelfTest_fp.h | 0 .../private/prototypes}/SequenceComplete_fp.h | 0 .../private/prototypes}/SequenceUpdate_fp.h | 0 .../private/prototypes}/SessionProcess_fp.h | 0 .../include/private/prototypes}/Session_fp.h | 0 .../private/prototypes}/SetAlgorithmSet_fp.h | 0 .../private/prototypes}/SetCapability_fp.h | 0 .../SetCommandCodeAuditStatus_fp.h | 0 .../private/prototypes}/SetPrimaryPolicy_fp.h | 0 .../include/private/prototypes}/Shutdown_fp.h | 0 .../tpm/include/private/prototypes}/Sign_fp.h | 0 .../private/prototypes}/StartAuthSession_fp.h | 0 .../include/private/prototypes}/Startup_fp.h | 0 .../private/prototypes}/StirRandom_fp.h | 0 .../private/prototypes}/TestParms_fp.h | 0 .../include/private/prototypes}/Ticket_fp.h | 0 .../tpm/include/private/prototypes}/Time_fp.h | 0 .../include/private/prototypes}/TpmASN1_fp.h | 0 .../prototypes}/TpmEcc_Signature_ECDAA_fp.h | 0 .../prototypes}/TpmEcc_Signature_ECDSA_fp.h | 2 +- .../prototypes}/TpmEcc_Signature_SM2_fp.h | 0 .../prototypes}/TpmEcc_Signature_Schnorr_fp.h | 0 .../prototypes}/TpmEcc_Signature_Util_fp.h | 0 .../private/prototypes}/TpmEcc_Util_fp.h | 0 .../private/prototypes}/TpmMath_Debug_fp.h | 0 .../private/prototypes}/TpmMath_Util_fp.h | 0 .../private/prototypes}/TpmSizeChecks_fp.h | 0 .../include/private/prototypes}/Unseal_fp.h | 0 .../private/prototypes}/VerifySignature_fp.h | 0 .../include/private/prototypes}/X509_ECC_fp.h | 0 .../include/private/prototypes}/X509_RSA_fp.h | 0 .../include/private/prototypes}/X509_spt_fp.h | 0 .../private/prototypes}/ZGen_2Phase_fp.h | 0 .../{ => TPMCmd/tpm/include/tpm_public}/ACT.h | 2 +- .../tpm/include/tpm_public}/BaseTypes.h | 0 .../tpm/include/tpm_public}/Capabilities.h | 0 .../tpm_public}/CompilerDependencies.h | 0 .../tpm_public}/CompilerDependencies_gcc.h | 0 .../tpm_public}/CompilerDependencies_msvc.h | 0 .../tpm/include/tpm_public}/GpMacros.h | 5 +- .../tpm/include/tpm_public}/MinMax.h | 0 .../tpm/include/tpm_public}/TPMB.h | 2 +- .../include/tpm_public}/TpmAlgorithmDefines.h | 6 +- .../tpm_public}/TpmCalculatedAttributes.h | 4 +- .../tpm/include/tpm_public}/TpmTypes.h | 8 +- .../include/tpm_public}/VerifyConfiguration.h | 0 .../tpm/include/tpm_public}/endian_swap.h | 0 .../tpm_public/prototypes}/TpmFail_fp.h | 0 .../tpm/include/tpm_public}/tpm_debug.h | 2 +- .../tpm/include/tpm_public/tpm_public.h | 15 + .../tpm/include/tpm_public}/tpm_radix.h | 0 src/tpm2/{ => TPMCmd/tpm/src/X509}/TpmASN1.c | 0 src/tpm2/{ => TPMCmd/tpm/src/X509}/X509_ECC.c | 0 src/tpm2/{ => TPMCmd/tpm/src/X509}/X509_RSA.c | 0 src/tpm2/{ => TPMCmd/tpm/src/X509}/X509_spt.c | 0 .../tpm/src/command/Attestation}/Attest_spt.c | 0 .../tpm/src/command/Attestation}/Quote.c | 0 .../tpm/src/command/ClockTimer}/ACT_spt.c | 2 +- .../tpm/src/command/Context}/Context_spt.c | 0 .../tpm/src/command/Duplication}/Duplicate.c | 0 .../tpm/src/command/Duplication}/Import.c | 0 .../tpm/src/command/EA}/PolicyAuthorize.c | 0 .../tpm/src/command/EA}/PolicyAuthorizeNV.c | 0 .../tpm/src/command/EA}/PolicyPCR.c | 0 .../tpm/src/command/EA}/PolicySecret.c | 0 .../tpm/src/command/EA}/PolicySigned.c | 0 .../tpm/src/command/EA}/PolicyTicket.c | 0 .../tpm/src/command/EA}/PolicyTransportSPDM.c | 0 .../tpm/src/command/EA}/Policy_spt.c | 0 .../src/command/Hierarchy}/CreatePrimary.c | 0 .../src/command/Hierarchy}/ReadOnlyControl.c | 0 .../tpm/src/command/NVStorage}/NV_Read.c | 2 +- .../src/command/NVStorage}/NV_ReadPublic.c | 2 +- .../src/command/NVStorage}/NV_ReadPublic2.c | 2 +- .../tpm/src/command/NVStorage}/NV_spt.c | 0 .../tpm/src/command/Object}/Create.c | 0 .../tpm/src/command/Object}/CreateLoaded.c | 0 .../tpm/src/command/Object}/MakeCredential.c | 0 .../src/command/Object}/ObjectChangeAuth.c | 0 .../tpm/src/command/Object}/Object_spt.c | 0 .../tpm/src/command/PCR}/PCR_Read.c | 0 .../command/Symmetric}/EncryptDecrypt_spt.c | 0 .../tpm/src/crypt}/AlgorithmTests.c | 0 .../tpm/src/crypt}/CryptCmac.c | 0 .../tpm/src/crypt}/CryptDes.c | 0 .../tpm/src/crypt}/CryptEccCrypt.c | 0 .../{ => TPMCmd/tpm/src/crypt}/CryptEccData.c | 0 .../tpm/src/crypt}/CryptEccKeyExchange.c | 0 .../tpm/src/crypt}/CryptEccMain.c | 0 .../tpm/src/crypt}/CryptEccSignature.c | 0 .../tpm/src/crypt}/CryptHash.c | 0 .../tpm/src/crypt}/CryptPrime.c | 0 .../tpm/src/crypt}/CryptPrimeSieve.c | 0 .../tpm/src/crypt}/CryptRand.c | 0 .../tpm/src/crypt}/CryptRsa.c | 0 .../tpm/src/crypt}/CryptSelfTest.c | 0 .../tpm/src/crypt}/CryptSmac.c | 0 .../tpm/src/crypt}/CryptSym.c | 2 +- .../{ => TPMCmd/tpm/src/crypt}/CryptUtil.c | 0 src/tpm2/{ => TPMCmd/tpm/src/crypt}/Ticket.c | 0 .../src/crypt/ecc}/TpmEcc_Signature_ECDAA.c | 0 .../tpm/src/crypt/ecc}/TpmEcc_Signature_SM2.c | 0 .../src/crypt/ecc}/TpmEcc_Signature_Schnorr.c | 0 .../src/crypt/ecc}/TpmEcc_Signature_Util.c | 0 .../tpm/src/crypt/ecc}/TpmEcc_Util.c | 0 .../tpm/src/crypt/math}/TpmMath_Debug.c | 0 .../tpm/src/crypt/math}/TpmMath_Util.c | 0 .../{ => TPMCmd/tpm/src/events}/_TPM_Init.c | 5 +- .../tpm/src/main}/CommandDispatcher.c | 0 .../{ => TPMCmd/tpm/src/main}/ExecCommand.c | 2 +- .../tpm/src/main}/SessionProcess.c | 4 +- .../tpm/src/subsystem}/CommandAudit.c | 0 src/tpm2/{ => TPMCmd/tpm/src/subsystem}/DA.c | 0 .../tpm/src/subsystem}/Hierarchy.c | 0 .../tpm/src/subsystem}/NvDynamic.c | 2 +- .../tpm/src/subsystem}/NvReserved.c | 0 .../{ => TPMCmd/tpm/src/subsystem}/Object.c | 0 src/tpm2/{ => TPMCmd/tpm/src/subsystem}/PCR.c | 0 src/tpm2/{ => TPMCmd/tpm/src/subsystem}/PP.c | 0 .../{ => TPMCmd/tpm/src/subsystem}/Session.c | 0 .../{ => TPMCmd/tpm/src/subsystem}/Time.c | 0 .../tpm/src/support}/AlgorithmCap.c | 0 src/tpm2/{ => TPMCmd/tpm/src/support}/Bits.c | 0 .../tpm/src/support}/CommandCodeAttributes.c | 0 .../{ => TPMCmd/tpm/src/support}/Entity.c | 2 +- .../{ => TPMCmd/tpm/src/support}/Global.c | 0 .../{ => TPMCmd/tpm/src/support}/Handle.c | 0 .../{ => TPMCmd/tpm/src/support}/IoBuffers.c | 0 .../{ => TPMCmd/tpm/src/support}/Locality.c | 0 .../tpm/src/support}/Manufacture.c | 0 .../{ => TPMCmd/tpm/src/support}/Marshal.c | 0 .../tpm/src/support}/MathOnByteBuffers.c | 0 .../{ => TPMCmd/tpm/src/support}/Memory.c | 0 src/tpm2/{ => TPMCmd/tpm/src/support}/Power.c | 0 .../tpm/src/support}/PropertyCap.c | 0 .../{ => TPMCmd/tpm/src/support}/Response.c | 0 .../tpm/src/support}/ResponseCodeProcessing.c | 0 .../{ => TPMCmd/tpm/src/support}/SecChannel.c | 0 .../{ => TPMCmd/tpm/src/support}/TpmFail.c | 2 +- .../tpm/src/support}/TpmSizeChecks.c | 0 src/tpm2/Unmarshal_fp.h | 2 +- src/tpm2/Utils.h | 2 +- src/tpm2/Volatile.h | 2 +- src/tpm2/crypto/CryptSelfTest_fp.h | 127 --- src/tpm2/crypto/openssl/ConsttimeUtils.h | 100 --- src/tpm2/crypto/openssl/consttime.txt | 76 -- src/tpm2/crypto/openssl/consttime.txt' | 58 -- src/tpm2/platform_to_tpm_interface.h | 72 -- src/tpm2/tpm_public.h | 12 - src/tpm_tpm2_interface.c | 24 +- src/tpm_tpm2_tis.c | 13 +- tests/Makefile.am | 32 +- 430 files changed, 674 insertions(+), 1076 deletions(-) rename src/tpm2/{crypto => }/CryptDes_fp.h (100%) delete mode 100644 src/tpm2/Platform.h create mode 100644 src/tpm2/TPMCmd/Platform/include/Platform.h rename src/tpm2/{ => TPMCmd/Platform/include}/PlatformACT.h (100%) rename src/tpm2/{ => TPMCmd/Platform/include}/PlatformClock.h (100%) rename src/tpm2/{ => TPMCmd/Platform/include}/PlatformData.h (100%) rename src/tpm2/{ => TPMCmd/Platform/include}/PlatformInternal.h (100%) rename src/tpm2/{ => TPMCmd/Platform/include/prototypes}/platform_public_interface.h (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/Cancel.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/Clock.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/DebugHelpers.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/Entropy.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/ExtraData.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/Failure.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/Init.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/LocalityPlat.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/NVMem.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/NVVirtual.c (92%) rename src/tpm2/{ => TPMCmd/Platform/src}/PPPlat.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/PlatformACT.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/PlatformData.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/PlatformPcr.c (99%) rename src/tpm2/{ => TPMCmd/Platform/src}/PowerPlat.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/RunCommand.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/SelfTest.c (83%) rename src/tpm2/{ => TPMCmd/Platform/src}/Unique.c (100%) rename src/tpm2/{ => TPMCmd/Platform/src}/VendorInfo.c (100%) rename src/tpm2/{ => TPMCmd/Simulator/include}/TpmTcpProtocol.h (100%) rename src/tpm2/{ => TPMCmd/Simulator/include/prototypes}/Simulator_fp.h (100%) rename src/tpm2/{ => TPMCmd/Simulator/src}/TPMCmdp.c (100%) rename src/tpm2/{ => TPMCmd/Simulator/src}/simulatorPrivate.h (66%) rename src/tpm2/{ => TPMCmd/Simulator/src}/simulator_sysheaders.h (100%) rename src/tpm2/{ => TPMCmd/TpmConfiguration/TpmConfiguration}/TpmBuildSwitches.h (99%) rename src/tpm2/{ => TPMCmd/TpmConfiguration/TpmConfiguration}/TpmProfile.h (72%) rename src/tpm2/{ => TPMCmd/TpmConfiguration/TpmConfiguration}/TpmProfile_CommandList.h (99%) rename src/tpm2/{ => TPMCmd/TpmConfiguration/TpmConfiguration}/TpmProfile_Common.h (100%) rename src/tpm2/{ => TPMCmd/TpmConfiguration/TpmConfiguration}/TpmProfile_ErrorCodes.h (100%) rename src/tpm2/{ => TPMCmd/TpmConfiguration/TpmConfiguration}/TpmProfile_Misc.h (100%) rename src/tpm2/{ => TPMCmd/TpmConfiguration/TpmConfiguration}/VendorCommands/CommandAttributeData_s_ccAttr.inl (100%) rename src/tpm2/{ => TPMCmd/TpmConfiguration/TpmConfiguration}/VendorCommands/CommandAttributeData_s_commandAttributes.inl (100%) rename src/tpm2/{ => TPMCmd/TpmConfiguration/TpmConfiguration}/VendorCommands/CommandDispatchData_CommandStructures.inl (95%) rename src/tpm2/{ => TPMCmd/TpmConfiguration/TpmConfiguration}/VendorCommands/CommandDispatchData_s_CommandDataArray.inl (100%) rename src/tpm2/{ => TPMCmd/TpmConfiguration/TpmConfiguration}/VendorCommands/VendorCommandList.h (100%) rename src/tpm2/{VendorCommands => TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/prototypes}/Vendor_TCG_Test_fp.h (100%) rename src/tpm2/{VendorCommands => TPMCmd/TpmConfiguration/TpmVendorCommandHandlers}/Vendor_TCG_Test.c (68%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/EccRef}/TpmEcc_Signature_ECDSA.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl}/BnToOsslMath.c (99%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl}/ExpDCache.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl}/Helpers.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl}/TpmToOsslDesSupport.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl}/TpmToOsslSupport.c (98%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl/include}/BnOssl.h (94%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl/include/Ossl}/BnToOsslMath.h (99%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl/include/Ossl}/BnToOsslMath_fp.h (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl/include/Ossl}/ExpDCache_fp.h (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl/include/Ossl}/Helpers_fp.h (99%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl/include/Ossl}/TpmToOsslDesSupport_fp.h (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl/include/Ossl}/TpmToOsslHash.h (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl/include/Ossl}/TpmToOsslSupport_fp.h (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/Ossl/include/Ossl}/TpmToOsslSym.h (100%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/RsaRef}/PrimeData.c (100%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/TpmBigNum}/BnConvert.c (100%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/TpmBigNum}/BnEccConstants.c (99%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/TpmBigNum}/BnMath.c (100%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/TpmBigNum}/BnMemory.c (100%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/TpmBigNum}/TpmBigNum.h (90%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/TpmBigNum}/TpmBigNumThunks.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/TpmBigNum/include}/BnConvert_fp.h (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/TpmBigNum/include}/BnMath_fp.h (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/TpmBigNum/include}/BnMemory_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/TpmBigNum/include}/BnSupport_Interface.h (99%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/TpmBigNum/include}/BnUtil_fp.h (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/TpmBigNum/include}/BnValues.h (98%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum}/TpmToTpmBigNumMath.h (96%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/common/include}/CryptoInterface.h (98%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/common/include}/EccConstantData.inl (100%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/common/include}/MathLibraryInterface.h (100%) rename src/tpm2/{ => TPMCmd/tpm/cryptolibs/common/include}/MathLibraryInterfaceTypes.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface}/pcrstruct.h (98%) create mode 100644 src/tpm2/TPMCmd/tpm/include/platform_interface/platform_to_tpm_interface.h rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface/prototypes}/ExecCommand_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface/prototypes}/Manufacture_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface/prototypes}/_TPM_Hash_Data_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface/prototypes}/_TPM_Hash_End_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface/prototypes}/_TPM_Hash_Start_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface/prototypes}/_TPM_Init_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface/prototypes}/platform_failure_mode_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface/prototypes}/platform_init_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface/prototypes}/platform_pcr_fp.h (97%) rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface/prototypes}/platform_virtual_nv_fp.h (95%) rename src/tpm2/{ => TPMCmd/tpm/include/platform_interface}/tpm_to_platform_interface.h (98%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/CommandAttributeData.h (99%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/CommandAttributes.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/CommandDispatchData.h (99%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private}/CryptEcc.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private}/CryptHash.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private}/CryptRand.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private}/CryptRsa.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private}/CryptSym.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private}/CryptTest.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/EccTestData.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/Global.h (99%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/HashTestData.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/InternalRoutines.h (71%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/KdfTestData.h (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/include/private}/LibSupport.h (99%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/Marshal.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/NV.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/OIDs.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/PRNG_TestVectors.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/RsaTestData.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/SelfTest.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/SymmetricTest.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/SymmetricTestData.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/Tpm.h (96%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/TpmASN1.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private}/X509.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ACT_SetTimeout_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ACT_spt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ActivateCredential_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/AlgorithmCap_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/AlgorithmTests_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Attest_spt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Bits_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/CertifyCreation_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/CertifyX509_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Certify_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ChangeEPS_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ChangePPS_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ClearControl_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Clear_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ClockRateAdjust_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ClockSet_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/CommandAudit_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/CommandCodeAttributes_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/CommandDispatcher_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Commit_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ContextLoad_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ContextSave_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Context_spt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/CreateLoaded_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/CreatePrimary_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Create_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptCmac_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptEccCrypt_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptEccKeyExchange_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptEccMain_fp.h (99%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptEccSignature_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptHash_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptPrimeSieve_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptPrime_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptRand_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptRsa_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/CryptSelfTest_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptSmac_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptSym_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/CryptUtil_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/DA_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/DictionaryAttackLockReset_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/DictionaryAttackParameters_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Duplicate_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/ECC_Decrypt_fp.h (100%) rename src/tpm2/{crypto => TPMCmd/tpm/include/private/prototypes}/ECC_Encrypt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ECC_Parameters_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ECDH_KeyGen_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ECDH_ZGen_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/EC_Ephemeral_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/EncryptDecrypt2_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/EncryptDecrypt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/EncryptDecrypt_spt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Entity_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/EventSequenceComplete_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/EvictControl_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/FlushContext_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/GetCapability_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/GetCommandAuditDigest_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/GetRandom_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/GetSessionAuditDigest_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/GetTestResult_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/GetTime_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/HMAC_Start_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/HMAC_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Handle_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/HashSequenceStart_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Hash_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/HierarchyChangeAuth_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/HierarchyControl_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Hierarchy_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Import_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/IncrementalSelfTest_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/IoBuffers_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/LoadExternal_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Load_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Locality_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/MAC_Start_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/MAC_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/MakeCredential_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Marshal_fp.h (99%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/MathOnByteBuffers_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Memory_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_Certify_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_ChangeAuth_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_DefineSpace2_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_DefineSpace_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_Extend_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_GlobalWriteLock_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_Increment_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_ReadLock_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_ReadPublic2_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_ReadPublic_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_Read_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_SetBits_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_UndefineSpaceSpecial_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_UndefineSpace_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_WriteLock_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_Write_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NV_spt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NvDynamic_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/NvReserved_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ObjectChangeAuth_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Object_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Object_spt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PCR_Allocate_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PCR_Event_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PCR_Extend_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PCR_Read_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PCR_Reset_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PCR_SetAuthPolicy_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PCR_SetAuthValue_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PCR_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PP_Commands_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PP_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyAuthValue_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyAuthorizeNV_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyAuthorize_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyCapability_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyCommandCode_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyCounterTimer_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyCpHash_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyDuplicationSelect_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyGetDigest_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyLocality_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyNV_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyNameHash_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyNvWritten_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyOR_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyPCR_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyParameters_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyPassword_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyPhysicalPresence_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyRestart_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicySecret_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicySigned_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyTemplate_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyTicket_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PolicyTransportSPDM_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Policy_spt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Power_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/PropertyCap_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Quote_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/RSA_Decrypt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/RSA_Encrypt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ReadClock_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ReadOnlyControl_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ReadPublic_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ResponseCodeProcessing_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Response_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Rewrap_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/SecChannel_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/SelfTest_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/SequenceComplete_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/SequenceUpdate_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/SessionProcess_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Session_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/SetAlgorithmSet_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/SetCapability_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/SetCommandCodeAuditStatus_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/SetPrimaryPolicy_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Shutdown_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Sign_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/StartAuthSession_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Startup_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/StirRandom_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/TestParms_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Ticket_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Time_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/TpmASN1_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/TpmEcc_Signature_ECDAA_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/TpmEcc_Signature_ECDSA_fp.h (97%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/TpmEcc_Signature_SM2_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/TpmEcc_Signature_Schnorr_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/TpmEcc_Signature_Util_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/TpmEcc_Util_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/TpmMath_Debug_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/TpmMath_Util_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/TpmSizeChecks_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/Unseal_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/VerifySignature_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/X509_ECC_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/X509_RSA_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/X509_spt_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/private/prototypes}/ZGen_2Phase_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/ACT.h (99%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/BaseTypes.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/Capabilities.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/CompilerDependencies.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/CompilerDependencies_gcc.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/CompilerDependencies_msvc.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/GpMacros.h (99%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/MinMax.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/TPMB.h (97%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/TpmAlgorithmDefines.h (99%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/TpmCalculatedAttributes.h (99%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/TpmTypes.h (99%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/VerifyConfiguration.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/endian_swap.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public/prototypes}/TpmFail_fp.h (100%) rename src/tpm2/{ => TPMCmd/tpm/include/tpm_public}/tpm_debug.h (97%) create mode 100644 src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_public.h rename src/tpm2/{crypto/openssl => TPMCmd/tpm/include/tpm_public}/tpm_radix.h (100%) rename src/tpm2/{ => TPMCmd/tpm/src/X509}/TpmASN1.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/X509}/X509_ECC.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/X509}/X509_RSA.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/X509}/X509_spt.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Attestation}/Attest_spt.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Attestation}/Quote.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/ClockTimer}/ACT_spt.c (99%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Context}/Context_spt.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Duplication}/Duplicate.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Duplication}/Import.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/EA}/PolicyAuthorize.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/EA}/PolicyAuthorizeNV.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/EA}/PolicyPCR.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/EA}/PolicySecret.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/EA}/PolicySigned.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/EA}/PolicyTicket.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/EA}/PolicyTransportSPDM.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/EA}/Policy_spt.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Hierarchy}/CreatePrimary.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Hierarchy}/ReadOnlyControl.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/NVStorage}/NV_Read.c (97%) rename src/tpm2/{ => TPMCmd/tpm/src/command/NVStorage}/NV_ReadPublic.c (94%) rename src/tpm2/{ => TPMCmd/tpm/src/command/NVStorage}/NV_ReadPublic2.c (95%) rename src/tpm2/{ => TPMCmd/tpm/src/command/NVStorage}/NV_spt.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Object}/Create.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Object}/CreateLoaded.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Object}/MakeCredential.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Object}/ObjectChangeAuth.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Object}/Object_spt.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/PCR}/PCR_Read.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/command/Symmetric}/EncryptDecrypt_spt.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt}/AlgorithmTests.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptCmac.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptDes.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptEccCrypt.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt}/CryptEccData.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptEccKeyExchange.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptEccMain.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptEccSignature.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptHash.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptPrime.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptPrimeSieve.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptRand.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptRsa.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt}/CryptSelfTest.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptSmac.c (100%) rename src/tpm2/{crypto/openssl => TPMCmd/tpm/src/crypt}/CryptSym.c (99%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt}/CryptUtil.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt}/Ticket.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt/ecc}/TpmEcc_Signature_ECDAA.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt/ecc}/TpmEcc_Signature_SM2.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt/ecc}/TpmEcc_Signature_Schnorr.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt/ecc}/TpmEcc_Signature_Util.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt/ecc}/TpmEcc_Util.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt/math}/TpmMath_Debug.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/crypt/math}/TpmMath_Util.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/events}/_TPM_Init.c (94%) rename src/tpm2/{ => TPMCmd/tpm/src/main}/CommandDispatcher.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/main}/ExecCommand.c (99%) rename src/tpm2/{ => TPMCmd/tpm/src/main}/SessionProcess.c (99%) rename src/tpm2/{ => TPMCmd/tpm/src/subsystem}/CommandAudit.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/subsystem}/DA.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/subsystem}/Hierarchy.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/subsystem}/NvDynamic.c (99%) rename src/tpm2/{ => TPMCmd/tpm/src/subsystem}/NvReserved.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/subsystem}/Object.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/subsystem}/PCR.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/subsystem}/PP.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/subsystem}/Session.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/subsystem}/Time.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/AlgorithmCap.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/Bits.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/CommandCodeAttributes.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/Entity.c (99%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/Global.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/Handle.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/IoBuffers.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/Locality.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/Manufacture.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/Marshal.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/MathOnByteBuffers.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/Memory.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/Power.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/PropertyCap.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/Response.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/ResponseCodeProcessing.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/SecChannel.c (100%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/TpmFail.c (99%) rename src/tpm2/{ => TPMCmd/tpm/src/support}/TpmSizeChecks.c (100%) delete mode 100644 src/tpm2/crypto/CryptSelfTest_fp.h delete mode 100644 src/tpm2/crypto/openssl/ConsttimeUtils.h delete mode 100644 src/tpm2/crypto/openssl/consttime.txt delete mode 100644 src/tpm2/crypto/openssl/consttime.txt' delete mode 100644 src/tpm2/platform_to_tpm_interface.h delete mode 100644 src/tpm2/tpm_public.h diff --git a/configure.ac b/configure.ac index 565415b48..6334cf144 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_TARGET -AM_INIT_AUTOMAKE([foreign 1.6 subdir-objects]) +AM_INIT_AUTOMAKE([foreign 1.9 subdir-objects tar-pax]) AM_SILENT_RULES([yes]) LIBTPMS_VER_MAJOR=`echo $PACKAGE_VERSION | awk -F. '{print $1}'` diff --git a/scripts/meld-all b/scripts/meld-all index 716ca50b2..dcfbc3eb7 100755 --- a/scripts/meld-all +++ b/scripts/meld-all @@ -86,7 +86,9 @@ main() continue fi - upstream=$(find "${TCG_TPM_HOME}" | grep -E "/${fname}\$") + fn=${f:${#1}} + upstream="${TCG_TPM_HOME}/${fn}" + #echo "$upstream" if [ -n "${upstream}" ]; then # find first empty line presumably after license diff --git a/src/Makefile.am b/src/Makefile.am index 14f219670..3aa1ee800 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -186,134 +186,135 @@ libtpms_tpm2_la_CFLAGS += -D_POSIX_ libtpms_tpm2_la_CFLAGS += -DTPM_POSIX libtpms_tpm2_la_SOURCES = \ - tpm2/ACT_spt.c \ tpm2/ACTCommands.c \ - tpm2/AlgorithmCap.c \ - tpm2/AlgorithmTests.c \ tpm2/AsymmetricCommands.c \ tpm2/AttestationCommands.c \ - tpm2/Attest_spt.c \ tpm2/AuditCommands.c \ - tpm2/Bits.c \ - tpm2/BnEccConstants.c \ - tpm2/BnConvert.c \ - tpm2/BnMath.c \ - tpm2/BnMemory.c \ - tpm2/Cancel.c \ tpm2/CapabilityCommands.c \ - tpm2/Clock.c \ tpm2/ClockCommands.c \ - tpm2/CommandAudit.c \ - tpm2/CommandCodeAttributes.c \ - tpm2/CommandDispatcher.c \ tpm2/ContextCommands.c \ - tpm2/Context_spt.c \ - tpm2/Create.c \ - tpm2/CreateLoaded.c \ - tpm2/CreatePrimary.c \ - tpm2/CryptEccData.c \ - tpm2/CryptSelfTest.c \ - tpm2/CryptUtil.c \ - tpm2/DA.c \ - tpm2/DebugHelpers.c \ tpm2/DictionaryCommands.c \ - tpm2/Duplicate.c \ tpm2/DuplicationCommands.c \ tpm2/EACommands.c \ - tpm2/EncryptDecrypt_spt.c \ - tpm2/Entity.c \ - tpm2/Entropy.c \ tpm2/EphemeralCommands.c \ - tpm2/ExecCommand.c \ - tpm2/ExtraData.c \ - tpm2/Failure.c \ - tpm2/Global.c \ - tpm2/Handle.c \ tpm2/HashCommands.c \ - tpm2/Hierarchy.c \ tpm2/HierarchyCommands.c \ - tpm2/Import.c \ - tpm2/Init.c \ tpm2/IntegrityCommands.c \ - tpm2/IoBuffers.c \ - tpm2/Locality.c \ - tpm2/LocalityPlat.c \ - tpm2/MakeCredential.c \ tpm2/ManagementCommands.c \ - tpm2/Manufacture.c \ - tpm2/Marshal.c \ - tpm2/MathOnByteBuffers.c \ - tpm2/Memory.c \ tpm2/NVCommands.c \ - tpm2/NvDynamic.c \ - tpm2/NVMem.c \ - tpm2/NvReserved.c \ - tpm2/NVVirtual.c \ - tpm2/NV_Read.c \ - tpm2/NV_ReadPublic.c \ - tpm2/NV_ReadPublic2.c \ - tpm2/NV_spt.c \ - tpm2/Object.c \ - tpm2/ObjectChangeAuth.c \ tpm2/ObjectCommands.c \ - tpm2/Object_spt.c \ - tpm2/PCR.c \ - tpm2/PCR_Read.c \ - tpm2/PlatformACT.c \ - tpm2/PlatformData.c \ - tpm2/PlatformPcr.c \ - tpm2/Policy_spt.c \ - tpm2/PolicyAuthorize.c \ - tpm2/PolicyAuthorizeNV.c \ - tpm2/PolicyPCR.c \ - tpm2/PolicySecret.c \ - tpm2/PolicySigned.c \ - tpm2/PolicyTicket.c \ - tpm2/PolicyTransportSPDM.c \ - tpm2/Power.c \ - tpm2/PowerPlat.c \ - tpm2/PP.c \ - tpm2/PPPlat.c \ - tpm2/PrimeData.c \ - tpm2/PropertyCap.c \ - tpm2/Quote.c \ tpm2/RandomCommands.c \ - tpm2/ReadOnlyControl.c \ - tpm2/Response.c \ - tpm2/ResponseCodeProcessing.c \ - tpm2/RunCommand.c \ - tpm2/SecChannel.c \ - tpm2/SelfTest.c \ - tpm2/Session.c \ tpm2/SessionCommands.c \ - tpm2/SessionProcess.c \ tpm2/SigningCommands.c \ tpm2/StartupCommands.c \ tpm2/SymmetricCommands.c \ tpm2/TestingCommands.c \ - tpm2/Ticket.c \ - tpm2/Time.c \ - tpm2/TpmASN1.c \ - tpm2/TpmBigNumThunks.c \ - tpm2/TpmEcc_Signature_ECDAA.c \ - tpm2/TpmEcc_Signature_ECDSA.c \ - tpm2/TpmEcc_Signature_Schnorr.c \ - tpm2/TpmEcc_Signature_SM2.c \ - tpm2/TpmEcc_Signature_Util.c \ - tpm2/TpmEcc_Util.c \ - tpm2/TpmMath_Debug.c \ - tpm2/TpmMath_Util.c \ - tpm2/TpmSizeChecks.c \ - tpm2/TPMCmdp.c \ - tpm2/TpmFail.c \ - tpm2/Unique.c \ + tpm2/TPMCmd/Platform/src/Cancel.c \ + tpm2/TPMCmd/Platform/src/Clock.c \ + tpm2/TPMCmd/Platform/src/DebugHelpers.c \ + tpm2/TPMCmd/Platform/src/Entropy.c \ + tpm2/TPMCmd/Platform/src/ExtraData.c \ + tpm2/TPMCmd/Platform/src/Failure.c \ + tpm2/TPMCmd/Platform/src/Init.c \ + tpm2/TPMCmd/Platform/src/LocalityPlat.c \ + tpm2/TPMCmd/Platform/src/NVMem.c \ + tpm2/TPMCmd/Platform/src/NVVirtual.c \ + tpm2/TPMCmd/Platform/src/PlatformACT.c \ + tpm2/TPMCmd/Platform/src/PlatformData.c \ + tpm2/TPMCmd/Platform/src/PlatformPcr.c \ + tpm2/TPMCmd/Platform/src/PowerPlat.c \ + tpm2/TPMCmd/Platform/src/PPPlat.c \ + tpm2/TPMCmd/Platform/src/RunCommand.c \ + tpm2/TPMCmd/Platform/src/SelfTest.c \ + tpm2/TPMCmd/Platform/src/Unique.c \ + tpm2/TPMCmd/Platform/src/VendorInfo.c \ + tpm2/TPMCmd/Simulator/src/TPMCmdp.c \ + tpm2/TPMCmd/tpm/cryptolibs/EccRef/TpmEcc_Signature_ECDSA.c \ + tpm2/TPMCmd/tpm/cryptolibs/RsaRef/PrimeData.c \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnConvert.c \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnEccConstants.c \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnMath.c \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnMemory.c \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNumThunks.c \ + tpm2/TPMCmd/tpm/src/command/Attestation/Attest_spt.c \ + tpm2/TPMCmd/tpm/src/command/Attestation/Quote.c \ + tpm2/TPMCmd/tpm/src/command/ClockTimer/ACT_spt.c \ + tpm2/TPMCmd/tpm/src/command/Context/Context_spt.c \ + tpm2/TPMCmd/tpm/src/command/Duplication/Duplicate.c \ + tpm2/TPMCmd/tpm/src/command/Duplication/Import.c \ + tpm2/TPMCmd/tpm/src/command/EA/PolicyAuthorize.c \ + tpm2/TPMCmd/tpm/src/command/EA/PolicyAuthorizeNV.c \ + tpm2/TPMCmd/tpm/src/command/EA/PolicyPCR.c \ + tpm2/TPMCmd/tpm/src/command/EA/PolicySecret.c \ + tpm2/TPMCmd/tpm/src/command/EA/PolicySigned.c \ + tpm2/TPMCmd/tpm/src/command/EA/Policy_spt.c \ + tpm2/TPMCmd/tpm/src/command/EA/PolicyTicket.c \ + tpm2/TPMCmd/tpm/src/command/EA/PolicyTransportSPDM.c \ + tpm2/TPMCmd/tpm/src/command/Hierarchy/CreatePrimary.c \ + tpm2/TPMCmd/tpm/src/command/Hierarchy/ReadOnlyControl.c \ + tpm2/TPMCmd/tpm/src/command/NVStorage/NV_Read.c \ + tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic2.c \ + tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic.c \ + tpm2/TPMCmd/tpm/src/command/NVStorage/NV_spt.c \ + tpm2/TPMCmd/tpm/src/command/Object/Create.c \ + tpm2/TPMCmd/tpm/src/command/Object/CreateLoaded.c \ + tpm2/TPMCmd/tpm/src/command/Object/MakeCredential.c \ + tpm2/TPMCmd/tpm/src/command/Object/ObjectChangeAuth.c \ + tpm2/TPMCmd/tpm/src/command/Object/Object_spt.c \ + tpm2/TPMCmd/tpm/src/command/PCR/PCR_Read.c \ + tpm2/TPMCmd/tpm/src/command/Symmetric/EncryptDecrypt_spt.c \ + tpm2/TPMCmd/tpm/src/crypt/AlgorithmTests.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptEccData.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptSelfTest.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c \ + tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_ECDAA.c \ + tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Schnorr.c \ + tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_SM2.c \ + tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Util.c \ + tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Util.c \ + tpm2/TPMCmd/tpm/src/crypt/math/TpmMath_Debug.c \ + tpm2/TPMCmd/tpm/src/crypt/math/TpmMath_Util.c \ + tpm2/TPMCmd/tpm/src/crypt/Ticket.c \ + tpm2/TPMCmd/tpm/src/events/_TPM_Init.c \ + tpm2/TPMCmd/tpm/src/main/CommandDispatcher.c \ + tpm2/TPMCmd/tpm/src/main/ExecCommand.c \ + tpm2/TPMCmd/tpm/src/main/SessionProcess.c \ + tpm2/TPMCmd/tpm/src/subsystem/CommandAudit.c \ + tpm2/TPMCmd/tpm/src/subsystem/DA.c \ + tpm2/TPMCmd/tpm/src/subsystem/Hierarchy.c \ + tpm2/TPMCmd/tpm/src/subsystem/NvDynamic.c \ + tpm2/TPMCmd/tpm/src/subsystem/NvReserved.c \ + tpm2/TPMCmd/tpm/src/subsystem/Object.c \ + tpm2/TPMCmd/tpm/src/subsystem/PCR.c \ + tpm2/TPMCmd/tpm/src/subsystem/PP.c \ + tpm2/TPMCmd/tpm/src/subsystem/Session.c \ + tpm2/TPMCmd/tpm/src/subsystem/Time.c \ + tpm2/TPMCmd/tpm/src/support/AlgorithmCap.c \ + tpm2/TPMCmd/tpm/src/support/Bits.c \ + tpm2/TPMCmd/tpm/src/support/CommandCodeAttributes.c \ + tpm2/TPMCmd/tpm/src/support/Entity.c \ + tpm2/TPMCmd/tpm/src/support/Global.c \ + tpm2/TPMCmd/tpm/src/support/Handle.c \ + tpm2/TPMCmd/tpm/src/support/IoBuffers.c \ + tpm2/TPMCmd/tpm/src/support/Locality.c \ + tpm2/TPMCmd/tpm/src/support/Manufacture.c \ + tpm2/TPMCmd/tpm/src/support/Marshal.c \ + tpm2/TPMCmd/tpm/src/support/MathOnByteBuffers.c \ + tpm2/TPMCmd/tpm/src/support/Memory.c \ + tpm2/TPMCmd/tpm/src/support/Power.c \ + tpm2/TPMCmd/tpm/src/support/PropertyCap.c \ + tpm2/TPMCmd/tpm/src/support/Response.c \ + tpm2/TPMCmd/tpm/src/support/ResponseCodeProcessing.c \ + tpm2/TPMCmd/tpm/src/support/SecChannel.c \ + tpm2/TPMCmd/tpm/src/support/TpmFail.c \ + tpm2/TPMCmd/tpm/src/support/TpmSizeChecks.c \ + tpm2/TPMCmd/tpm/src/X509/TpmASN1.c \ + tpm2/TPMCmd/tpm/src/X509/X509_ECC.c \ + tpm2/TPMCmd/tpm/src/X509/X509_RSA.c \ + tpm2/TPMCmd/tpm/src/X509/X509_spt.c \ + tpm2/TPMCmd/TpmConfiguration/TpmVendorCommandHandlers/Vendor_TCG_Test.c \ tpm2/Unmarshal.c \ - tpm2/VendorInfo.c \ - tpm2/X509_ECC.c \ - tpm2/X509_RSA.c \ - tpm2/X509_spt.c \ - tpm2/VendorCommands/Vendor_TCG_Test.c \ - tpm2/_TPM_Init.c \ + \ tpm_tpm2_interface.c \ tpm_tpm2_tis.c \ \ @@ -330,283 +331,282 @@ libtpms_tpm2_la_SOURCES = \ noinst_HEADERS += \ compiler.h \ - tpm2/crypto/CryptCmac_fp.h \ - tpm2/crypto/CryptDes_fp.h \ - tpm2/crypto/CryptEcc.h \ - tpm2/crypto/CryptEccCrypt_fp.h \ - tpm2/crypto/CryptEccKeyExchange_fp.h \ - tpm2/crypto/CryptEccMain_fp.h \ - tpm2/crypto/CryptEccSignature_fp.h \ - tpm2/crypto/CryptHash_fp.h \ - tpm2/crypto/CryptHash.h \ - tpm2/crypto/CryptPrime_fp.h \ - tpm2/crypto/CryptPrimeSieve_fp.h \ - tpm2/crypto/CryptRand_fp.h \ - tpm2/crypto/CryptRand.h \ - tpm2/crypto/CryptRsa_fp.h \ - tpm2/crypto/CryptRsa.h \ - tpm2/crypto/CryptSelfTest_fp.h \ - tpm2/crypto/CryptSmac_fp.h \ - tpm2/crypto/CryptSym.h \ - tpm2/crypto/CryptSym_fp.h \ - tpm2/crypto/CryptTest.h \ - tpm2/crypto/CryptUtil_fp.h \ - tpm2/crypto/ECC_Decrypt_fp.h \ - tpm2/crypto/ECC_Encrypt_fp.h \ - tpm2/ACT.h \ - tpm2/ACT_spt_fp.h \ - tpm2/ACT_SetTimeout_fp.h \ - tpm2/ActivateCredential_fp.h \ - tpm2/AlgorithmCap_fp.h \ - tpm2/AlgorithmTests_fp.h \ - tpm2/Attest_spt_fp.h \ - tpm2/BaseTypes.h \ - tpm2/Bits_fp.h \ - tpm2/BnEccConstants.c \ - tpm2/BnSupport_Interface.h \ - tpm2/BnUtil_fp.h \ - tpm2/Capabilities.h \ - tpm2/CertifyCreation_fp.h \ - tpm2/CertifyX509_fp.h \ - tpm2/Certify_fp.h \ - tpm2/ChangeEPS_fp.h \ - tpm2/ChangePPS_fp.h \ - tpm2/ClearControl_fp.h \ - tpm2/Clear_fp.h \ - tpm2/ClockRateAdjust_fp.h \ - tpm2/ClockSet_fp.h \ - tpm2/CommandAttributeData.h \ - tpm2/CommandAttributes.h \ - tpm2/CommandAudit_fp.h \ - tpm2/CommandCodeAttributes_fp.h \ - tpm2/CommandDispatchData.h \ - tpm2/CommandDispatcher_fp.h \ - tpm2/Commit_fp.h \ - tpm2/CompilerDependencies.h \ - tpm2/CompilerDependencies_gcc.h \ - tpm2/CompilerDependencies_msvc.h \ - tpm2/ContextLoad_fp.h \ - tpm2/ContextSave_fp.h \ - tpm2/Context_spt_fp.h \ - tpm2/Create_fp.h \ - tpm2/CreateLoaded_fp.h \ - tpm2/CreatePrimary_fp.h \ - tpm2/CryptoInterface.h \ - tpm2/CryptSelfTest_fp.h \ - tpm2/DA_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptCmac_fp.h \ + tpm2/CryptDes_fp.h \ tpm2/DebugHelpers_fp.h \ - tpm2/DictionaryAttackLockReset_fp.h \ - tpm2/DictionaryAttackParameters_fp.h \ - tpm2/Duplicate_fp.h \ - tpm2/EccConstantData.inl \ - tpm2/EccTestData.h \ - tpm2/ECC_Parameters_fp.h \ - tpm2/ECDH_KeyGen_fp.h \ - tpm2/ECDH_ZGen_fp.h \ - tpm2/EC_Ephemeral_fp.h \ - tpm2/EncryptDecrypt2_fp.h \ - tpm2/EncryptDecrypt_fp.h \ - tpm2/EncryptDecrypt_spt_fp.h \ - tpm2/endian_swap.h \ - tpm2/Entity_fp.h \ - tpm2/EventSequenceComplete_fp.h \ - tpm2/EvictControl_fp.h \ - tpm2/ExecCommand_fp.h \ - tpm2/FlushContext_fp.h \ - tpm2/GetCapability_fp.h \ - tpm2/GetCommandAuditDigest_fp.h \ - tpm2/GetRandom_fp.h \ - tpm2/GetSessionAuditDigest_fp.h \ - tpm2/GetTestResult_fp.h \ - tpm2/GetTime_fp.h \ - tpm2/Global.h \ - tpm2/GpMacros.h \ - tpm2/Handle_fp.h \ - tpm2/Hash_fp.h \ - tpm2/HashSequenceStart_fp.h \ - tpm2/HashTestData.h \ - tpm2/HierarchyChangeAuth_fp.h \ - tpm2/HierarchyControl_fp.h \ - tpm2/Hierarchy_fp.h \ - tpm2/HMAC_fp.h \ - tpm2/HMAC_Start_fp.h \ - tpm2/Import_fp.h \ - tpm2/IncrementalSelfTest_fp.h \ - tpm2/InternalRoutines.h \ - tpm2/IoBuffers_fp.h \ - tpm2/KdfTestData.h \ - tpm2/LoadExternal_fp.h \ - tpm2/Load_fp.h \ - tpm2/Locality_fp.h \ - tpm2/MAC_fp.h \ - tpm2/MAC_Start_fp.h \ - tpm2/MakeCredential_fp.h \ - tpm2/Manufacture_fp.h \ - tpm2/Marshal.h \ - tpm2/Marshal_fp.h \ - tpm2/MathLibraryInterface.h \ - tpm2/MathLibraryInterfaceTypes.h \ - tpm2/MathOnByteBuffers_fp.h \ - tpm2/Memory_fp.h \ - tpm2/MinMax.h \ - tpm2/NV_Certify_fp.h \ - tpm2/NV_ChangeAuth_fp.h \ - tpm2/NV_DefineSpace_fp.h \ - tpm2/NV_DefineSpace2_fp.h \ - tpm2/NvDynamic_fp.h \ - tpm2/NV_Extend_fp.h \ - tpm2/NV_GlobalWriteLock_fp.h \ - tpm2/NV.h \ - tpm2/NV_Increment_fp.h \ - tpm2/NV_Read_fp.h \ - tpm2/NV_ReadLock_fp.h \ - tpm2/NV_ReadPublic_fp.h \ - tpm2/NV_ReadPublic2_fp.h \ - tpm2/NvReserved_fp.h \ - tpm2/NV_SetBits_fp.h \ - tpm2/NV_spt_fp.h \ - tpm2/NV_UndefineSpace_fp.h \ - tpm2/NV_UndefineSpaceSpecial_fp.h \ - tpm2/NV_Write_fp.h \ - tpm2/NV_WriteLock_fp.h \ - tpm2/OIDs.h \ - tpm2/ObjectChangeAuth_fp.h \ - tpm2/Object_fp.h \ - tpm2/Object_spt_fp.h \ - tpm2/pcrstruct.h \ - tpm2/PCR_Allocate_fp.h \ - tpm2/PCR_Event_fp.h \ - tpm2/PCR_Extend_fp.h \ - tpm2/PCR_fp.h \ - tpm2/PCR_Read_fp.h \ - tpm2/PCR_Reset_fp.h \ - tpm2/PCR_SetAuthPolicy_fp.h \ - tpm2/PCR_SetAuthValue_fp.h \ - tpm2/Platform.h \ - tpm2/PlatformACT.h \ tpm2/PlatformACT_fp.h \ - tpm2/PlatformClock.h \ - tpm2/PlatformData.h \ - tpm2/PlatformInternal.h \ - tpm2/platform_failure_mode_fp.h \ - tpm2/platform_init_fp.h \ - tpm2/platform_virtual_nv_fp.h \ - tpm2/platform_public_interface.h \ - tpm2/platform_pcr_fp.h \ - tpm2/platform_to_tpm_interface.h \ tpm2/Platform_fp.h \ - tpm2/PolicyAuthorize_fp.h \ - tpm2/PolicyAuthorizeNV_fp.h \ - tpm2/PolicyAuthValue_fp.h \ - tpm2/PolicyCapability_fp.h \ - tpm2/PolicyCommandCode_fp.h \ - tpm2/PolicyCounterTimer_fp.h \ - tpm2/PolicyCpHash_fp.h \ - tpm2/PolicyDuplicationSelect_fp.h \ - tpm2/PolicyGetDigest_fp.h \ - tpm2/PolicyLocality_fp.h \ - tpm2/PolicyNameHash_fp.h \ - tpm2/PolicyNV_fp.h \ - tpm2/PolicyNvWritten_fp.h \ - tpm2/PolicyOR_fp.h \ - tpm2/PolicyParameters_fp.h \ - tpm2/PolicyPassword_fp.h \ - tpm2/PolicyPCR_fp.h \ - tpm2/PolicyPhysicalPresence_fp.h \ - tpm2/PolicyRestart_fp.h \ - tpm2/PolicySecret_fp.h \ - tpm2/PolicySigned_fp.h \ - tpm2/Policy_spt_fp.h \ - tpm2/PolicyTemplate_fp.h \ - tpm2/PolicyTicket_fp.h \ - tpm2/PolicyTransportSPDM_fp.h \ - tpm2/Power_fp.h \ - tpm2/PP_Commands_fp.h \ - tpm2/PP_fp.h \ - tpm2/PRNG_TestVectors.h \ - tpm2/PropertyCap_fp.h \ - tpm2/Quote_fp.h \ - tpm2/ReadClock_fp.h \ - tpm2/ReadOnlyControl_fp.h \ - tpm2/ReadPublic_fp.h \ - tpm2/ResponseCodeProcessing_fp.h \ - tpm2/Response_fp.h \ - tpm2/Rewrap_fp.h \ - tpm2/RsaTestData.h \ - tpm2/RSA_Decrypt_fp.h \ - tpm2/RSA_Encrypt_fp.h \ - tpm2/SecChannel_fp.h \ - tpm2/SelfTest.h \ - tpm2/SelfTest_fp.h \ - tpm2/SequenceComplete_fp.h \ - tpm2/SequenceUpdate_fp.h \ - tpm2/Session_fp.h \ - tpm2/SessionProcess_fp.h \ - tpm2/SetAlgorithmSet_fp.h \ - tpm2/SetCapability_fp.h \ - tpm2/SetCommandCodeAuditStatus_fp.h \ - tpm2/SetPrimaryPolicy_fp.h \ - tpm2/Shutdown_fp.h \ - tpm2/Sign_fp.h \ - tpm2/simulatorPrivate.h \ - tpm2/simulator_sysheaders.h \ - tpm2/Simulator_fp.h \ - tpm2/StartAuthSession_fp.h \ - tpm2/Startup_fp.h \ - tpm2/StirRandom_fp.h \ - tpm2/SymmetricTest.h \ - tpm2/SymmetricTestData.h \ tpm2/TcpServerPosix_fp.h \ - tpm2/TestParms_fp.h \ - tpm2/Ticket_fp.h \ - tpm2/Time_fp.h \ - tpm2/TPMB.h \ - tpm2/TpmAlgorithmDefines.h \ - tpm2/TpmASN1.h \ - tpm2/TpmASN1_fp.h \ - tpm2/TpmBuildSwitches.h \ - tpm2/TpmEcc_Signature_ECDAA_fp.h \ - tpm2/TpmEcc_Signature_ECDSA_fp.h \ - tpm2/TpmEcc_Signature_Schnorr_fp.h \ - tpm2/TpmEcc_Signature_SM2_fp.h \ - tpm2/TpmEcc_Signature_Util_fp.h \ - tpm2/TpmFail_fp.h \ - tpm2/TpmMath_Debug_fp.h \ - tpm2/TpmMath_Util_fp.h \ - tpm2/TpmProfile.h \ - tpm2/TpmProfile_CommandList.h \ - tpm2/TpmProfile_Common.h \ - tpm2/TpmProfile_ErrorCodes.h \ - tpm2/TpmProfile_Misc.h \ - tpm2/Tpm.h \ - tpm2/TpmBigNum.h \ - tpm2/tpm_debug.h \ - tpm2/tpm_public.h \ - tpm2/tpm_to_platform_interface.h \ - tpm2/_TPM_Hash_Data_fp.h \ - tpm2/_TPM_Hash_End_fp.h \ - tpm2/_TPM_Hash_Start_fp.h \ - tpm2/_TPM_Init_fp.h \ - tpm2/TpmCalculatedAttributes.h \ - tpm2/TpmEcc_Util_fp.h \ - tpm2/TpmSizeChecks_fp.h \ - tpm2/TpmTcpProtocol.h \ - tpm2/TpmTypes.h \ + tpm2/TPMCmd/Platform/include/PlatformACT.h \ + tpm2/TPMCmd/Platform/include/PlatformClock.h \ + tpm2/TPMCmd/Platform/include/PlatformData.h \ + tpm2/TPMCmd/Platform/include/Platform.h \ + tpm2/TPMCmd/Platform/include/PlatformInternal.h \ + tpm2/TPMCmd/Platform/include/prototypes/platform_public_interface.h \ + tpm2/TPMCmd/Simulator/include/prototypes/Simulator_fp.h \ + tpm2/TPMCmd/Simulator/include/TpmTcpProtocol.h \ + tpm2/TPMCmd/Simulator/src/simulatorPrivate.h \ + tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmBuildSwitches.h \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_CommandList.h \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Common.h \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_ErrorCodes.h \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile.h \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Misc.h \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandAttributeData_s_ccAttr.inl \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandAttributeData_s_commandAttributes.inl \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandDispatchData_CommandStructures.inl \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandDispatchData_s_CommandDataArray.inl \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/prototypes/Vendor_TCG_Test_fp.h \ + tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/VendorCommandList.h \ + tpm2/TPMCmd/tpm/cryptolibs/common/include/CryptoInterface.h \ + tpm2/TPMCmd/tpm/cryptolibs/common/include/EccConstantData.inl \ + tpm2/TPMCmd/tpm/cryptolibs/common/include/MathLibraryInterface.h \ + tpm2/TPMCmd/tpm/cryptolibs/common/include/MathLibraryInterfaceTypes.h \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnEccConstants.c \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnSupport_Interface.h \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnUtil_fp.h \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNum.h \ + tpm2/TPMCmd/tpm/include/platform_interface/pcrstruct.h \ + tpm2/TPMCmd/tpm/include/platform_interface/platform_to_tpm_interface.h \ + tpm2/TPMCmd/tpm/include/platform_interface/prototypes/ExecCommand_fp.h \ + tpm2/TPMCmd/tpm/include/platform_interface/prototypes/Manufacture_fp.h \ + tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_failure_mode_fp.h \ + tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_init_fp.h \ + tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_pcr_fp.h \ + tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_virtual_nv_fp.h \ + tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Hash_Data_fp.h \ + tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Hash_End_fp.h \ + tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Hash_Start_fp.h \ + tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Init_fp.h \ + tpm2/TPMCmd/tpm/include/platform_interface/tpm_to_platform_interface.h \ + tpm2/TPMCmd/tpm/include/private/CommandAttributeData.h \ + tpm2/TPMCmd/tpm/include/private/CommandAttributes.h \ + tpm2/TPMCmd/tpm/include/private/CommandDispatchData.h \ + tpm2/TPMCmd/tpm/include/private/CryptEcc.h \ + tpm2/TPMCmd/tpm/include/private/CryptHash.h \ + tpm2/TPMCmd/tpm/include/private/CryptRand.h \ + tpm2/TPMCmd/tpm/include/private/CryptRsa.h \ + tpm2/TPMCmd/tpm/include/private/CryptSym.h \ + tpm2/TPMCmd/tpm/include/private/CryptTest.h \ + tpm2/TPMCmd/tpm/include/private/EccTestData.h \ + tpm2/TPMCmd/tpm/include/private/Global.h \ + tpm2/TPMCmd/tpm/include/private/HashTestData.h \ + tpm2/TPMCmd/tpm/include/private/InternalRoutines.h \ + tpm2/TPMCmd/tpm/include/private/KdfTestData.h \ + tpm2/TPMCmd/tpm/include/private/Marshal.h \ + tpm2/TPMCmd/tpm/include/private/NV.h \ + tpm2/TPMCmd/tpm/include/private/OIDs.h \ + tpm2/TPMCmd/tpm/include/private/PRNG_TestVectors.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ActivateCredential_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ACT_SetTimeout_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ACT_spt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmCap_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmTests_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Attest_spt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Bits_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CertifyCreation_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Certify_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CertifyX509_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ChangeEPS_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ChangePPS_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ClearControl_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Clear_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ClockRateAdjust_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ClockSet_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CommandAudit_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CommandCodeAttributes_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CommandDispatcher_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Commit_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ContextLoad_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ContextSave_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Context_spt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Create_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CreateLoaded_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CreatePrimary_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccCrypt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccKeyExchange_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccMain_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccSignature_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptHash_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrime_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrimeSieve_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptRand_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptRsa_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptSelfTest_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptSmac_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptSym_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/CryptUtil_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/DA_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackLockReset_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackParameters_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Decrypt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Encrypt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Duplicate_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Parameters_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_KeyGen_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_ZGen_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/EC_Ephemeral_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt2_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_spt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Entity_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/EventSequenceComplete_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/EvictControl_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/FlushContext_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/GetCapability_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/GetCommandAuditDigest_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/GetRandom_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/GetSessionAuditDigest_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/GetTestResult_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/GetTime_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Handle_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Hash_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/HashSequenceStart_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyChangeAuth_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyControl_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Hierarchy_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_Start_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Import_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/IncrementalSelfTest_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/IoBuffers_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/LoadExternal_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Load_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Locality_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/MAC_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/MAC_Start_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/MakeCredential_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Marshal_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/MathOnByteBuffers_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Memory_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_Certify_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_ChangeAuth_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace2_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NvDynamic_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_Extend_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_GlobalWriteLock_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_Increment_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_Read_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadLock_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic2_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NvReserved_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_SetBits_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_spt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpace_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpaceSpecial_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_Write_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/NV_WriteLock_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ObjectChangeAuth_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Object_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Object_spt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Allocate_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Event_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Extend_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PCR_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Read_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Reset_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthPolicy_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthValue_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorize_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorizeNV_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthValue_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCapability_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCommandCode_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCounterTimer_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCpHash_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyDuplicationSelect_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyGetDigest_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyLocality_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNameHash_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNV_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNvWritten_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyOR_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyParameters_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPassword_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPCR_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPhysicalPresence_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyRestart_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicySecret_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicySigned_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Policy_spt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTemplate_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTicket_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTransportSPDM_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Power_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PP_Commands_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PP_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/PropertyCap_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Quote_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ReadClock_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ReadOnlyControl_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ReadPublic_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ResponseCodeProcessing_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Response_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Rewrap_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Decrypt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Encrypt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/SecChannel_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/SelfTest_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/SequenceComplete_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/SequenceUpdate_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Session_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/SessionProcess_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/SetAlgorithmSet_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/SetCapability_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/SetCommandCodeAuditStatus_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/SetPrimaryPolicy_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Shutdown_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Sign_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/StartAuthSession_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Startup_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/StirRandom_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/TestParms_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Ticket_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Time_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/TpmASN1_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_ECDAA_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_ECDSA_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Schnorr_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_SM2_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Util_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Util_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Debug_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Util_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/TpmSizeChecks_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/Unseal_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/VerifySignature_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/X509_ECC_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/X509_RSA_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/X509_spt_fp.h \ + tpm2/TPMCmd/tpm/include/private/prototypes/ZGen_2Phase_fp.h \ + tpm2/TPMCmd/tpm/include/private/RsaTestData.h \ + tpm2/TPMCmd/tpm/include/private/SelfTest.h \ + tpm2/TPMCmd/tpm/include/private/SymmetricTestData.h \ + tpm2/TPMCmd/tpm/include/private/SymmetricTest.h \ + tpm2/TPMCmd/tpm/include/private/TpmASN1.h \ + tpm2/TPMCmd/tpm/include/private/Tpm.h \ + tpm2/TPMCmd/tpm/include/private/X509.h \ + tpm2/TPMCmd/tpm/include/tpm_public/ACT.h \ + tpm2/TPMCmd/tpm/include/tpm_public/BaseTypes.h \ + tpm2/TPMCmd/tpm/include/tpm_public/Capabilities.h \ + tpm2/TPMCmd/tpm/include/tpm_public/CompilerDependencies_gcc.h \ + tpm2/TPMCmd/tpm/include/tpm_public/CompilerDependencies.h \ + tpm2/TPMCmd/tpm/include/tpm_public/CompilerDependencies_msvc.h \ + tpm2/TPMCmd/tpm/include/tpm_public/endian_swap.h \ + tpm2/TPMCmd/tpm/include/tpm_public/GpMacros.h \ + tpm2/TPMCmd/tpm/include/tpm_public/MinMax.h \ + tpm2/TPMCmd/tpm/include/tpm_public/prototypes/TpmFail_fp.h \ + tpm2/TPMCmd/tpm/include/tpm_public/TpmAlgorithmDefines.h \ + tpm2/TPMCmd/tpm/include/tpm_public/TPMB.h \ + tpm2/TPMCmd/tpm/include/tpm_public/TpmCalculatedAttributes.h \ + tpm2/TPMCmd/tpm/include/tpm_public/tpm_debug.h \ + tpm2/TPMCmd/tpm/include/tpm_public/tpm_public.h \ + tpm2/TPMCmd/tpm/include/tpm_public/TpmTypes.h \ + tpm2/TPMCmd/tpm/include/tpm_public/VerifyConfiguration.h \ tpm2/Unmarshal_fp.h \ - tpm2/Unseal_fp.h \ - tpm2/VerifyConfiguration.h \ - tpm2/VerifySignature_fp.h \ - tpm2/X509.h \ - tpm2/X509_ECC_fp.h \ - tpm2/X509_RSA_fp.h \ - tpm2/X509_spt_fp.h \ - tpm2/ZGen_2Phase_fp.h \ - tpm2/VendorCommands/CommandAttributeData_s_ccAttr.inl \ - tpm2/VendorCommands/CommandAttributeData_s_commandAttributes.inl \ - tpm2/VendorCommands/CommandDispatchData_CommandStructures.inl \ - tpm2/VendorCommands/CommandDispatchData_s_CommandDataArray.inl \ - tpm2/VendorCommands/Vendor_TCG_Test_fp.h \ - tpm2/VendorCommands/VendorCommandList.h \ \ tpm2/BackwardsCompatibility.h \ tpm2/BackwardsCompatibilityBitArray.h \ @@ -624,49 +624,60 @@ noinst_HEADERS += \ if LIBTPMS_USE_OPENSSL libtpms_tpm2_la_SOURCES += \ - tpm2/crypto/openssl/BnToOsslMath.c \ - tpm2/crypto/openssl/CryptCmac.c \ - tpm2/crypto/openssl/CryptDes.c \ - tpm2/crypto/openssl/CryptEccCrypt.c \ - tpm2/crypto/openssl/CryptEccKeyExchange.c \ - tpm2/crypto/openssl/CryptEccMain.c \ - tpm2/crypto/openssl/CryptEccSignature.c \ - tpm2/crypto/openssl/CryptHash.c \ - tpm2/crypto/openssl/CryptPrime.c \ - tpm2/crypto/openssl/CryptPrimeSieve.c \ - tpm2/crypto/openssl/CryptRand.c \ - tpm2/crypto/openssl/CryptRsa.c \ - tpm2/crypto/openssl/CryptSmac.c \ - tpm2/crypto/openssl/CryptSym.c \ - tpm2/crypto/openssl/ExpDCache.c \ - tpm2/crypto/openssl/Helpers.c \ - tpm2/crypto/openssl/TpmToOsslDesSupport.c \ - tpm2/crypto/openssl/TpmToOsslSupport.c + tpm2/TPMCmd/tpm/cryptolibs/Ossl/BnToOsslMath.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptCmac.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptDes.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptEccCrypt.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptEccKeyExchange.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptEccMain.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptEccSignature.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptHash.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptPrime.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptPrimeSieve.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptRand.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptRsa.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptSmac.c \ + tpm2/TPMCmd/tpm/src/crypt/CryptSym.c \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/ExpDCache.c \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/Helpers.c \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/TpmToOsslDesSupport.c \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/TpmToOsslSupport.c noinst_HEADERS += \ - tpm2/crypto/openssl/BnOssl.h \ - tpm2/crypto/openssl/BnToOsslMath_fp.h \ - tpm2/crypto/openssl/BnToOsslMath.h \ - tpm2/crypto/openssl/ConsttimeUtils.h \ - tpm2/crypto/openssl/BnConvert_fp.h \ - tpm2/crypto/openssl/BnMath_fp.h \ - tpm2/crypto/openssl/BnMemory_fp.h \ - tpm2/crypto/openssl/BnValues.h \ - tpm2/crypto/openssl/ExpDCache_fp.h \ - tpm2/crypto/openssl/Helpers_fp.h \ - tpm2/crypto/openssl/LibSupport.h \ - tpm2/crypto/openssl/TpmToTpmBigNumMath.h \ - tpm2/crypto/openssl/TpmToOsslDesSupport_fp.h \ - tpm2/crypto/openssl/TpmToOsslHash.h \ - tpm2/crypto/openssl/TpmToOsslSupport_fp.h \ - tpm2/crypto/openssl/TpmToOsslSym.h \ - tpm2/crypto/openssl/tpm_radix.h + tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/BnOssl.h \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath_fp.h \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnConvert_fp.h \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMath_fp.h \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMemory_fp.h \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnValues.h \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath.h \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/ExpDCache_fp.h \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/Helpers_fp.h \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslDesSupport_fp.h \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslHash.h \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSupport_fp.h \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSym.h \ + tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum/TpmToTpmBigNumMath.h \ + tpm2/TPMCmd/tpm/include/private/LibSupport.h \ + tpm2/TPMCmd/tpm/include/tpm_public/tpm_radix.h libtpms_tpm2_la_CFLAGS += \ -I $(srcdir)/tpm2 \ - -I $(srcdir)/tpm2/crypto \ - -I $(srcdir)/tpm2/crypto/openssl - + -I $(srcdir)/tpm2/crypto/openssl \ + -I $(srcdir)/tpm2/TPMCmd/Platform/include/ \ + -I $(srcdir)/tpm2/TPMCmd/Simulator/include/ \ + -I $(srcdir)/tpm2/TPMCmd/Simulator/include/prototypes \ + -I $(srcdir)/tpm2/TPMCmd/TpmConfiguration \ + -I $(srcdir)/tpm2/TPMCmd/tpm/include/ \ + -I $(srcdir)/tpm2/TPMCmd/tpm/include/private \ + -I $(srcdir)/tpm2/TPMCmd/tpm/include/private/prototypes/ \ + -I $(srcdir)/tpm2/TPMCmd/tpm/cryptolibs/common/include/ \ + -I $(srcdir)/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/ \ + -I $(srcdir)/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum/ \ + -I $(srcdir)/tpm2/TPMCmd/tpm/cryptolibs/ \ + -I $(srcdir)/tpm2/TPMCmd/tpm/cryptolibs/Ossl/ \ + -I $(srcdir)/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include \ + -I $(srcdir)/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/ libtpms_tpm2_la_LIBADD += -lcrypto diff --git a/src/tpm2/BackwardsCompatibilityBitArray.h b/src/tpm2/BackwardsCompatibilityBitArray.h index 0d5002ee5..f9d5170c4 100644 --- a/src/tpm2/BackwardsCompatibilityBitArray.h +++ b/src/tpm2/BackwardsCompatibilityBitArray.h @@ -40,7 +40,7 @@ #define BACKWARDS_COMPATIBILITY_BIT_ARRAY_H #include "Tpm.h" -#include "TpmTypes.h" +#include TPM_RC ConvertFromCompressedBitArray(BYTE *inAuditCommands, diff --git a/src/tpm2/crypto/CryptDes_fp.h b/src/tpm2/CryptDes_fp.h similarity index 100% rename from src/tpm2/crypto/CryptDes_fp.h rename to src/tpm2/CryptDes_fp.h diff --git a/src/tpm2/NVMarshal.c b/src/tpm2/NVMarshal.c index d57961c2b..f94c5a52f 100644 --- a/src/tpm2/NVMarshal.c +++ b/src/tpm2/NVMarshal.c @@ -56,7 +56,7 @@ #include "Simulator_fp.h" #include "BackwardsCompatibilityBitArray.h" #include "BackwardsCompatibilityObject.h" -#include "platform_failure_mode_fp.h" +#include #define TPM_HAVE_TPM2_DECLARATIONS #include "tpm_library_intern.h" diff --git a/src/tpm2/NVMarshal.h b/src/tpm2/NVMarshal.h index 7b06e40ac..0ff265f67 100644 --- a/src/tpm2/NVMarshal.h +++ b/src/tpm2/NVMarshal.h @@ -42,7 +42,7 @@ #include #include "Tpm.h" -#include "TpmTypes.h" +#include "tpm_public/TpmTypes.h" #include "RuntimeProfile_fp.h" #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) diff --git a/src/tpm2/Platform.h b/src/tpm2/Platform.h deleted file mode 100644 index e1c9f5996..000000000 --- a/src/tpm2/Platform.h +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: BSD-2-Clause - - -#ifndef _PLATFORM_H_ -#define _PLATFORM_H_ - -#include "TpmBuildSwitches.h" -#include "TpmProfile.h" -#include "BaseTypes.h" -#include "TPMB.h" -#include "MinMax.h" - -#include "PlatformACT.h" -#include "PlatformClock.h" -#include "PlatformData.h" -#include "platform_public_interface.h" -#include "tpm_to_platform_interface.h" -#include "platform_to_tpm_interface.h" -#include "PlatformInternal.h" - -#define GLOBAL_C -#define NV_C -#include "pcrstruct.h" -#include "platform_pcr_fp.h" - -#endif // _PLATFORM_H_ diff --git a/src/tpm2/Platform_fp.h b/src/tpm2/Platform_fp.h index 71c4cff38..a428cc7b7 100644 --- a/src/tpm2/Platform_fp.h +++ b/src/tpm2/Platform_fp.h @@ -58,4 +58,5 @@ /* */ /********************************************************************************/ -#include "platform_public_interface.h" // libtpms added +#include // libtpms added + diff --git a/src/tpm2/RuntimeAlgorithm.c b/src/tpm2/RuntimeAlgorithm.c index 0bec7bbdf..ba81bd611 100644 --- a/src/tpm2/RuntimeAlgorithm.c +++ b/src/tpm2/RuntimeAlgorithm.c @@ -45,7 +45,7 @@ #include "Tpm.h" #include "NVMarshal.h" -#include "GpMacros.h" +#include "tpm_public/GpMacros.h" #include "tpm_library_intern.h" #define ALGO_SEPARATOR_C ',' diff --git a/src/tpm2/StateMarshal.h b/src/tpm2/StateMarshal.h index 6fc6d1464..29bed70ad 100644 --- a/src/tpm2/StateMarshal.h +++ b/src/tpm2/StateMarshal.h @@ -40,7 +40,7 @@ #define STATE_MARSHAL_H #include "Tpm.h" -#include "TpmTypes.h" +#include /* * we keep these in a separate file to avoid symbol clashes when diff --git a/src/tpm2/TPMCmd/Platform/include/Platform.h b/src/tpm2/TPMCmd/Platform/include/Platform.h new file mode 100644 index 000000000..c6d0f11b0 --- /dev/null +++ b/src/tpm2/TPMCmd/Platform/include/Platform.h @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: BSD-2-Clause + + +#ifndef _PLATFORM_H_ +#define _PLATFORM_H_ + +#include +#include +// TODO_RENAME_INC_FOLDER: public refers to the TPM_CoreLib public headers +#include +#include +#include + +#include "PlatformACT.h" +#include "PlatformClock.h" +#include "PlatformData.h" +#include "prototypes/platform_public_interface.h" +// TODO_RENAME_INC_FOLDER:platform_interface refers to the TPM_CoreLib platform interface +#include +#include +#include "PlatformInternal.h" + +#define GLOBAL_C +#define NV_C +#include +#include + +#endif // _PLATFORM_H_ diff --git a/src/tpm2/PlatformACT.h b/src/tpm2/TPMCmd/Platform/include/PlatformACT.h similarity index 100% rename from src/tpm2/PlatformACT.h rename to src/tpm2/TPMCmd/Platform/include/PlatformACT.h diff --git a/src/tpm2/PlatformClock.h b/src/tpm2/TPMCmd/Platform/include/PlatformClock.h similarity index 100% rename from src/tpm2/PlatformClock.h rename to src/tpm2/TPMCmd/Platform/include/PlatformClock.h diff --git a/src/tpm2/PlatformData.h b/src/tpm2/TPMCmd/Platform/include/PlatformData.h similarity index 100% rename from src/tpm2/PlatformData.h rename to src/tpm2/TPMCmd/Platform/include/PlatformData.h diff --git a/src/tpm2/PlatformInternal.h b/src/tpm2/TPMCmd/Platform/include/PlatformInternal.h similarity index 100% rename from src/tpm2/PlatformInternal.h rename to src/tpm2/TPMCmd/Platform/include/PlatformInternal.h diff --git a/src/tpm2/platform_public_interface.h b/src/tpm2/TPMCmd/Platform/include/prototypes/platform_public_interface.h similarity index 100% rename from src/tpm2/platform_public_interface.h rename to src/tpm2/TPMCmd/Platform/include/prototypes/platform_public_interface.h diff --git a/src/tpm2/Cancel.c b/src/tpm2/TPMCmd/Platform/src/Cancel.c similarity index 100% rename from src/tpm2/Cancel.c rename to src/tpm2/TPMCmd/Platform/src/Cancel.c diff --git a/src/tpm2/Clock.c b/src/tpm2/TPMCmd/Platform/src/Clock.c similarity index 100% rename from src/tpm2/Clock.c rename to src/tpm2/TPMCmd/Platform/src/Clock.c diff --git a/src/tpm2/DebugHelpers.c b/src/tpm2/TPMCmd/Platform/src/DebugHelpers.c similarity index 100% rename from src/tpm2/DebugHelpers.c rename to src/tpm2/TPMCmd/Platform/src/DebugHelpers.c diff --git a/src/tpm2/Entropy.c b/src/tpm2/TPMCmd/Platform/src/Entropy.c similarity index 100% rename from src/tpm2/Entropy.c rename to src/tpm2/TPMCmd/Platform/src/Entropy.c diff --git a/src/tpm2/ExtraData.c b/src/tpm2/TPMCmd/Platform/src/ExtraData.c similarity index 100% rename from src/tpm2/ExtraData.c rename to src/tpm2/TPMCmd/Platform/src/ExtraData.c diff --git a/src/tpm2/Failure.c b/src/tpm2/TPMCmd/Platform/src/Failure.c similarity index 100% rename from src/tpm2/Failure.c rename to src/tpm2/TPMCmd/Platform/src/Failure.c diff --git a/src/tpm2/Init.c b/src/tpm2/TPMCmd/Platform/src/Init.c similarity index 100% rename from src/tpm2/Init.c rename to src/tpm2/TPMCmd/Platform/src/Init.c diff --git a/src/tpm2/LocalityPlat.c b/src/tpm2/TPMCmd/Platform/src/LocalityPlat.c similarity index 100% rename from src/tpm2/LocalityPlat.c rename to src/tpm2/TPMCmd/Platform/src/LocalityPlat.c diff --git a/src/tpm2/NVMem.c b/src/tpm2/TPMCmd/Platform/src/NVMem.c similarity index 100% rename from src/tpm2/NVMem.c rename to src/tpm2/TPMCmd/Platform/src/NVMem.c diff --git a/src/tpm2/NVVirtual.c b/src/tpm2/TPMCmd/Platform/src/NVVirtual.c similarity index 92% rename from src/tpm2/NVVirtual.c rename to src/tpm2/TPMCmd/Platform/src/NVVirtual.c index cde23aaf2..83fc47b36 100644 --- a/src/tpm2/NVVirtual.c +++ b/src/tpm2/TPMCmd/Platform/src/NVVirtual.c @@ -1,9 +1,9 @@ // SPDX-License-Identifier: BSD-2-Clause #include "Platform.h" -#include "TpmAlgorithmDefines.h" -#include "TpmTypes.h" -#include "platform_virtual_nv_fp.h" +#include +#include +#include // NV Index handles for EKICA and EK Certificates. #define RSA_2048_EK_CERT_HANDLE (0x01c00002) diff --git a/src/tpm2/PPPlat.c b/src/tpm2/TPMCmd/Platform/src/PPPlat.c similarity index 100% rename from src/tpm2/PPPlat.c rename to src/tpm2/TPMCmd/Platform/src/PPPlat.c diff --git a/src/tpm2/PlatformACT.c b/src/tpm2/TPMCmd/Platform/src/PlatformACT.c similarity index 100% rename from src/tpm2/PlatformACT.c rename to src/tpm2/TPMCmd/Platform/src/PlatformACT.c diff --git a/src/tpm2/PlatformData.c b/src/tpm2/TPMCmd/Platform/src/PlatformData.c similarity index 100% rename from src/tpm2/PlatformData.c rename to src/tpm2/TPMCmd/Platform/src/PlatformData.c diff --git a/src/tpm2/PlatformPcr.c b/src/tpm2/TPMCmd/Platform/src/PlatformPcr.c similarity index 99% rename from src/tpm2/PlatformPcr.c rename to src/tpm2/TPMCmd/Platform/src/PlatformPcr.c index b347e92f9..670425444 100644 --- a/src/tpm2/PlatformPcr.c +++ b/src/tpm2/TPMCmd/Platform/src/PlatformPcr.c @@ -3,7 +3,7 @@ // PCR platform interface functions #include "Platform.h" -#include "TpmAlgorithmDefines.h" +#include // use this as a convenient lookup for hash size for PCRs. UINT16 CryptHashGetDigestSize(TPM_ALG_ID hashAlg // IN: hash algorithm to look up diff --git a/src/tpm2/PowerPlat.c b/src/tpm2/TPMCmd/Platform/src/PowerPlat.c similarity index 100% rename from src/tpm2/PowerPlat.c rename to src/tpm2/TPMCmd/Platform/src/PowerPlat.c diff --git a/src/tpm2/RunCommand.c b/src/tpm2/TPMCmd/Platform/src/RunCommand.c similarity index 100% rename from src/tpm2/RunCommand.c rename to src/tpm2/TPMCmd/Platform/src/RunCommand.c diff --git a/src/tpm2/SelfTest.c b/src/tpm2/TPMCmd/Platform/src/SelfTest.c similarity index 83% rename from src/tpm2/SelfTest.c rename to src/tpm2/TPMCmd/Platform/src/SelfTest.c index 7d3a1c83b..1b47c4402 100644 --- a/src/tpm2/SelfTest.c +++ b/src/tpm2/TPMCmd/Platform/src/SelfTest.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSD-2-Clause #include "Platform.h" -#include "TpmAlgorithmDefines.h" -#include "TpmTypes.h" +#include +#include LIB_EXPORT void _plat_GetEnabledSelfTest( uint8_t fullTest, // IN: full test or not diff --git a/src/tpm2/Unique.c b/src/tpm2/TPMCmd/Platform/src/Unique.c similarity index 100% rename from src/tpm2/Unique.c rename to src/tpm2/TPMCmd/Platform/src/Unique.c diff --git a/src/tpm2/VendorInfo.c b/src/tpm2/TPMCmd/Platform/src/VendorInfo.c similarity index 100% rename from src/tpm2/VendorInfo.c rename to src/tpm2/TPMCmd/Platform/src/VendorInfo.c diff --git a/src/tpm2/TpmTcpProtocol.h b/src/tpm2/TPMCmd/Simulator/include/TpmTcpProtocol.h similarity index 100% rename from src/tpm2/TpmTcpProtocol.h rename to src/tpm2/TPMCmd/Simulator/include/TpmTcpProtocol.h diff --git a/src/tpm2/Simulator_fp.h b/src/tpm2/TPMCmd/Simulator/include/prototypes/Simulator_fp.h similarity index 100% rename from src/tpm2/Simulator_fp.h rename to src/tpm2/TPMCmd/Simulator/include/prototypes/Simulator_fp.h diff --git a/src/tpm2/TPMCmdp.c b/src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c similarity index 100% rename from src/tpm2/TPMCmdp.c rename to src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c diff --git a/src/tpm2/simulatorPrivate.h b/src/tpm2/TPMCmd/Simulator/src/simulatorPrivate.h similarity index 66% rename from src/tpm2/simulatorPrivate.h rename to src/tpm2/TPMCmd/Simulator/src/simulatorPrivate.h index 003c044f7..c578f9296 100644 --- a/src/tpm2/simulatorPrivate.h +++ b/src/tpm2/TPMCmd/Simulator/src/simulatorPrivate.h @@ -8,27 +8,24 @@ /* */ /* 1. Copyright Licenses: */ /* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ +/* (c) Copyright IBM Corporation, 2020-2025 */ /* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ +/* All rights reserved. */ /* */ -/* 2. Source Code Distribution Conditions: */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are */ +/* met: */ /* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ +/* Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the following disclaimer. */ /* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ /* */ -/* 3. Disclaimers: */ +/* Neither the names of the IBM Corporation nor the names of its */ +/* contributors may be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ /* */ /* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ /* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ @@ -65,15 +62,15 @@ #define SIMULATOR_PRIVATE_H //** Includes, Locals, Defines and Function Prototypes -#include "tpm_public.h" +#include #include "simulator_sysheaders.h" // TODO_RENAME_INC_FOLDER:prototypes refers to the platform library -#include "platform_public_interface.h" +#include // TODO_RENAME_INC_FOLDER:platform_interface refers to the TPM_CoreLib platform interface -#include "tpm_to_platform_interface.h" -#include "platform_to_tpm_interface.h" +#include +#include #include "TpmTcpProtocol.h" #include "Simulator_fp.h" diff --git a/src/tpm2/simulator_sysheaders.h b/src/tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h similarity index 100% rename from src/tpm2/simulator_sysheaders.h rename to src/tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h diff --git a/src/tpm2/TpmBuildSwitches.h b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmBuildSwitches.h similarity index 99% rename from src/tpm2/TpmBuildSwitches.h rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmBuildSwitches.h index fa9cb2e14..e7ca46708 100644 --- a/src/tpm2/TpmBuildSwitches.h +++ b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmBuildSwitches.h @@ -200,6 +200,6 @@ #define FAIL_TRACE YES // TODO_RENAME_INC_FOLDER: public refers to the TPM_CoreLib public headers -#include "CompilerDependencies.h" +#include #endif // _TPM_BUILD_SWITCHES_H_ diff --git a/src/tpm2/TpmProfile.h b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile.h similarity index 72% rename from src/tpm2/TpmProfile.h rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile.h index 0acc9a87b..5271f812c 100644 --- a/src/tpm2/TpmProfile.h +++ b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile.h @@ -8,11 +8,11 @@ #ifndef _TPM_PROFILE_H_ #define _TPM_PROFILE_H_ -#include "TpmBuildSwitches.h" -#include "TpmProfile_Common.h" -#include "TpmProfile_CommandList.h" -#include "TpmProfile_Misc.h" -#include "TpmProfile_ErrorCodes.h" +#include +#include +#include +#include +#include // libtpms: added begin #ifndef HASH_LIB diff --git a/src/tpm2/TpmProfile_CommandList.h b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_CommandList.h similarity index 99% rename from src/tpm2/TpmProfile_CommandList.h rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_CommandList.h index 11392c0c8..259e4432e 100644 --- a/src/tpm2/TpmProfile_CommandList.h +++ b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_CommandList.h @@ -170,6 +170,6 @@ // clang-format on -#include "VendorCommands/VendorCommandList.h" +#include #endif // _TPM_PROFILE_COMMAND_LIST_H_ diff --git a/src/tpm2/TpmProfile_Common.h b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Common.h similarity index 100% rename from src/tpm2/TpmProfile_Common.h rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Common.h diff --git a/src/tpm2/TpmProfile_ErrorCodes.h b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_ErrorCodes.h similarity index 100% rename from src/tpm2/TpmProfile_ErrorCodes.h rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_ErrorCodes.h diff --git a/src/tpm2/TpmProfile_Misc.h b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Misc.h similarity index 100% rename from src/tpm2/TpmProfile_Misc.h rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Misc.h diff --git a/src/tpm2/VendorCommands/CommandAttributeData_s_ccAttr.inl b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandAttributeData_s_ccAttr.inl similarity index 100% rename from src/tpm2/VendorCommands/CommandAttributeData_s_ccAttr.inl rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandAttributeData_s_ccAttr.inl diff --git a/src/tpm2/VendorCommands/CommandAttributeData_s_commandAttributes.inl b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandAttributeData_s_commandAttributes.inl similarity index 100% rename from src/tpm2/VendorCommands/CommandAttributeData_s_commandAttributes.inl rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandAttributeData_s_commandAttributes.inl diff --git a/src/tpm2/VendorCommands/CommandDispatchData_CommandStructures.inl b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandDispatchData_CommandStructures.inl similarity index 95% rename from src/tpm2/VendorCommands/CommandDispatchData_CommandStructures.inl rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandDispatchData_CommandStructures.inl index a0d094ca4..0435a751f 100644 --- a/src/tpm2/VendorCommands/CommandDispatchData_CommandStructures.inl +++ b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandDispatchData_CommandStructures.inl @@ -14,7 +14,7 @@ #endif #if CC_Vendor_TCG_Test -# include "Vendor_TCG_Test_fp.h" // libtpms: changed +# include "TpmConfiguration/VendorCommands/prototypes/Vendor_TCG_Test_fp.h" typedef TPM_RC(Vendor_TCG_Test_Entry)(Vendor_TCG_Test_In* in, Vendor_TCG_Test_Out* out); diff --git a/src/tpm2/VendorCommands/CommandDispatchData_s_CommandDataArray.inl b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandDispatchData_s_CommandDataArray.inl similarity index 100% rename from src/tpm2/VendorCommands/CommandDispatchData_s_CommandDataArray.inl rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/CommandDispatchData_s_CommandDataArray.inl diff --git a/src/tpm2/VendorCommands/VendorCommandList.h b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/VendorCommandList.h similarity index 100% rename from src/tpm2/VendorCommands/VendorCommandList.h rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/VendorCommandList.h diff --git a/src/tpm2/VendorCommands/Vendor_TCG_Test_fp.h b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/prototypes/Vendor_TCG_Test_fp.h similarity index 100% rename from src/tpm2/VendorCommands/Vendor_TCG_Test_fp.h rename to src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/prototypes/Vendor_TCG_Test_fp.h diff --git a/src/tpm2/VendorCommands/Vendor_TCG_Test.c b/src/tpm2/TPMCmd/TpmConfiguration/TpmVendorCommandHandlers/Vendor_TCG_Test.c similarity index 68% rename from src/tpm2/VendorCommands/Vendor_TCG_Test.c rename to src/tpm2/TPMCmd/TpmConfiguration/TpmVendorCommandHandlers/Vendor_TCG_Test.c index 2528d85ed..c6233510b 100644 --- a/src/tpm2/VendorCommands/Vendor_TCG_Test.c +++ b/src/tpm2/TPMCmd/TpmConfiguration/TpmVendorCommandHandlers/Vendor_TCG_Test.c @@ -1,11 +1,10 @@ -// SPDX-License-Identifier: BSD-2-Clause -#include "tpm_public.h" +#include #if CC_Vendor_TCG_Test // Conditional expansion of this file -# include "TpmTypes.h" -# include "Vendor_TCG_Test_fp.h" +# include +# include TPM_RC TPM2_Vendor_TCG_Test(Vendor_TCG_Test_In* in, // IN: input parameter list diff --git a/src/tpm2/TpmEcc_Signature_ECDSA.c b/src/tpm2/TPMCmd/tpm/cryptolibs/EccRef/TpmEcc_Signature_ECDSA.c similarity index 100% rename from src/tpm2/TpmEcc_Signature_ECDSA.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/EccRef/TpmEcc_Signature_ECDSA.c diff --git a/src/tpm2/crypto/openssl/BnToOsslMath.c b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/BnToOsslMath.c similarity index 99% rename from src/tpm2/crypto/openssl/BnToOsslMath.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/BnToOsslMath.c index 685b21341..a71c8dc3b 100644 --- a/src/tpm2/crypto/openssl/BnToOsslMath.c +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/BnToOsslMath.c @@ -26,7 +26,7 @@ #include "BnOssl.h" #ifdef MATH_LIB_OSSL -# include "BnToOsslMath_fp.h" +# include //** Functions diff --git a/src/tpm2/crypto/openssl/ExpDCache.c b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/ExpDCache.c similarity index 100% rename from src/tpm2/crypto/openssl/ExpDCache.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/ExpDCache.c diff --git a/src/tpm2/crypto/openssl/Helpers.c b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/Helpers.c similarity index 100% rename from src/tpm2/crypto/openssl/Helpers.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/Helpers.c diff --git a/src/tpm2/crypto/openssl/TpmToOsslDesSupport.c b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/TpmToOsslDesSupport.c similarity index 100% rename from src/tpm2/crypto/openssl/TpmToOsslDesSupport.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/TpmToOsslDesSupport.c diff --git a/src/tpm2/crypto/openssl/TpmToOsslSupport.c b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/TpmToOsslSupport.c similarity index 98% rename from src/tpm2/crypto/openssl/TpmToOsslSupport.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/TpmToOsslSupport.c index b2b421d12..8965d607a 100644 --- a/src/tpm2/crypto/openssl/TpmToOsslSupport.c +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/TpmToOsslSupport.c @@ -66,9 +66,9 @@ //** Defines and Includes #include "BnOssl.h" -#include "CryptoInterface.h" -#include "TpmToOsslSym.h" -#include "TpmToOsslHash.h" +#include +#include +#include #include #include diff --git a/src/tpm2/crypto/openssl/BnOssl.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/BnOssl.h similarity index 94% rename from src/tpm2/crypto/openssl/BnOssl.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/BnOssl.h index 004d9f49f..660d2cd5b 100644 --- a/src/tpm2/crypto/openssl/BnOssl.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/BnOssl.h @@ -64,15 +64,15 @@ #ifndef _BNOSSL_H_ #define _BNOSSL_H_ // TODO_RENAME_INC_FOLDER: public refers to the TPM_CoreLib public headers -#include "tpm_public.h" -#include "TpmFail_fp.h" -#include "BnToOsslMath.h" +#include +#include +#include // TODO_RENAME_INC_FOLDER: these refer to TpmBigNum protected headers -#include "BnSupport_Interface.h" -#include "BnUtil_fp.h" -#include "BnMemory_fp.h" -#include "BnMath_fp.h" -#include "BnConvert_fp.h" +#include +#include +#include +#include +#include #if CRYPTO_LIB_REPORTING # include diff --git a/src/tpm2/crypto/openssl/BnToOsslMath.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath.h similarity index 99% rename from src/tpm2/crypto/openssl/BnToOsslMath.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath.h index ccfd02af9..4bd9cc75d 100644 --- a/src/tpm2/crypto/openssl/BnToOsslMath.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath.h @@ -72,7 +72,7 @@ # error this OpenSSL Interface expects to be used from TpmBigNum #endif -#include "BnValues.h" +#include #include #include #include @@ -149,7 +149,7 @@ TPM_INLINE const TPMBN_ECC_CURVE_CONSTANTS* AccessCurveConstants( return E->C; } -#include "TpmToOsslSupport_fp.h" +#include // Start and end a context within which the OpenSSL memory management works #define OSSL_ENTER() BN_CTX* CTX = OsslContextEnter() diff --git a/src/tpm2/crypto/openssl/BnToOsslMath_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath_fp.h similarity index 100% rename from src/tpm2/crypto/openssl/BnToOsslMath_fp.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath_fp.h diff --git a/src/tpm2/crypto/openssl/ExpDCache_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/ExpDCache_fp.h similarity index 100% rename from src/tpm2/crypto/openssl/ExpDCache_fp.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/ExpDCache_fp.h diff --git a/src/tpm2/crypto/openssl/Helpers_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/Helpers_fp.h similarity index 99% rename from src/tpm2/crypto/openssl/Helpers_fp.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/Helpers_fp.h index 7cc86169a..56614cc4d 100644 --- a/src/tpm2/crypto/openssl/Helpers_fp.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/Helpers_fp.h @@ -43,7 +43,7 @@ #ifndef HELPERS_FP_H #define HELPERS_FP_H -#include "TpmTypes.h" +#include "tpm_public/TpmTypes.h" #include diff --git a/src/tpm2/crypto/openssl/TpmToOsslDesSupport_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslDesSupport_fp.h similarity index 100% rename from src/tpm2/crypto/openssl/TpmToOsslDesSupport_fp.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslDesSupport_fp.h diff --git a/src/tpm2/crypto/openssl/TpmToOsslHash.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslHash.h similarity index 100% rename from src/tpm2/crypto/openssl/TpmToOsslHash.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslHash.h diff --git a/src/tpm2/crypto/openssl/TpmToOsslSupport_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSupport_fp.h similarity index 100% rename from src/tpm2/crypto/openssl/TpmToOsslSupport_fp.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSupport_fp.h diff --git a/src/tpm2/crypto/openssl/TpmToOsslSym.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSym.h similarity index 100% rename from src/tpm2/crypto/openssl/TpmToOsslSym.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSym.h diff --git a/src/tpm2/PrimeData.c b/src/tpm2/TPMCmd/tpm/cryptolibs/RsaRef/PrimeData.c similarity index 100% rename from src/tpm2/PrimeData.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/RsaRef/PrimeData.c diff --git a/src/tpm2/BnConvert.c b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnConvert.c similarity index 100% rename from src/tpm2/BnConvert.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnConvert.c diff --git a/src/tpm2/BnEccConstants.c b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnEccConstants.c similarity index 99% rename from src/tpm2/BnEccConstants.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnEccConstants.c index 346632cc0..3d4b5e738 100644 --- a/src/tpm2/BnEccConstants.c +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnEccConstants.c @@ -7,7 +7,7 @@ #include "TpmBigNum.h" //#include "Tpm.h" // TODO_RENAME_INC_FOLDER:private refers to the TPM_CoreLib private headers -#include "OIDs.h" +#include #if ALG_ECC @@ -46,7 +46,7 @@ // This file contains the raw data for ECC curve constants. The data is wrapped // in macros so this file can be included in other files that format the data in // a memory format desired by the user. This file itself is never used alone. -# include "EccConstantData.inl" +# include // now define the TPMBN_ECC_CURVE_CONSTANTS objects for the known curves diff --git a/src/tpm2/BnMath.c b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnMath.c similarity index 100% rename from src/tpm2/BnMath.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnMath.c diff --git a/src/tpm2/BnMemory.c b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnMemory.c similarity index 100% rename from src/tpm2/BnMemory.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnMemory.c diff --git a/src/tpm2/TpmBigNum.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNum.h similarity index 90% rename from src/tpm2/TpmBigNum.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNum.h index 725e5bca2..bc90c9729 100644 --- a/src/tpm2/TpmBigNum.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNum.h @@ -61,17 +61,17 @@ //** Introduction // This file contains the headers necessary to build the tpm big num library. // TODO_RENAME_INC_FOLDER: public refers to the TPM_CoreLib public headers -#include "tpm_public.h" -#include "TpmFail_fp.h" +#include +#include // TODO_RENAME_INC_FOLDER: private refers to the TPM_CoreLib private(protected) headers -#include "TpmAlgorithmDefines.h" -#include "GpMacros.h" // required for TpmFail_fp.h -#include "Capabilities.h" -#include "TpmTypes.h" // requires capabilities & GpMacros -#include "TpmToTpmBigNumMath.h" +#include +#include // required for TpmFail_fp.h +#include +#include // requires capabilities & GpMacros +#include #include "BnSupport_Interface.h" #include "BnConvert_fp.h" #include "BnMemory_fp.h" #include "BnMath_fp.h" #include "BnUtil_fp.h" -#include "MathLibraryInterface.h" +#include diff --git a/src/tpm2/TpmBigNumThunks.c b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNumThunks.c similarity index 100% rename from src/tpm2/TpmBigNumThunks.c rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNumThunks.c diff --git a/src/tpm2/crypto/openssl/BnConvert_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnConvert_fp.h similarity index 100% rename from src/tpm2/crypto/openssl/BnConvert_fp.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnConvert_fp.h diff --git a/src/tpm2/crypto/openssl/BnMath_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMath_fp.h similarity index 100% rename from src/tpm2/crypto/openssl/BnMath_fp.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMath_fp.h diff --git a/src/tpm2/crypto/openssl/BnMemory_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMemory_fp.h similarity index 100% rename from src/tpm2/crypto/openssl/BnMemory_fp.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMemory_fp.h diff --git a/src/tpm2/BnSupport_Interface.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnSupport_Interface.h similarity index 99% rename from src/tpm2/BnSupport_Interface.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnSupport_Interface.h index 5928a02f5..376c98cd8 100644 --- a/src/tpm2/BnSupport_Interface.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnSupport_Interface.h @@ -78,8 +78,8 @@ #ifndef BN_SUPPORT_INTERFACE_H #define BN_SUPPORT_INTERFACE_H // TODO_RENAME_INC_FOLDER:private refers to the TPM_CoreLib private headers -#include "GpMacros.h" -#include "CryptoInterface.h" +#include "tpm_public/GpMacros.h" +#include #include "BnValues.h" //** BnSupportLibInit() diff --git a/src/tpm2/BnUtil_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnUtil_fp.h similarity index 100% rename from src/tpm2/BnUtil_fp.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnUtil_fp.h diff --git a/src/tpm2/crypto/openssl/BnValues.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnValues.h similarity index 98% rename from src/tpm2/crypto/openssl/BnValues.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnValues.h index 0f05db68a..301bb91d2 100644 --- a/src/tpm2/crypto/openssl/BnValues.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnValues.h @@ -26,10 +26,10 @@ #ifndef _BN_NUMBERS_H #define _BN_NUMBERS_H // TODO_RENAME_INC_FOLDER:private refers to the TPM_CoreLib private headers -#include "TpmAlgorithmDefines.h" -#include "GpMacros.h" // required for TpmFail_fp.h -#include "Capabilities.h" -#include "TpmTypes.h" // requires capabilities & GpMacros +#include +#include // required for TpmFail_fp.h +#include +#include // requires capabilities & GpMacros // These are the basic big number formats. This is convertible to the library- // specific format without too much difficulty. For the math performed using diff --git a/src/tpm2/crypto/openssl/TpmToTpmBigNumMath.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum/TpmToTpmBigNumMath.h similarity index 96% rename from src/tpm2/crypto/openssl/TpmToTpmBigNumMath.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum/TpmToTpmBigNumMath.h index dbd625ce3..55879aad6 100644 --- a/src/tpm2/crypto/openssl/TpmToTpmBigNumMath.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum/TpmToTpmBigNumMath.h @@ -74,9 +74,9 @@ #define MATH_LIB_TPMBIGNUM // TODO_RENAME_INC_FOLDER: private refers to the TPM_CoreLib private headers -#include "GpMacros.h" // required for TpmFail_fp.h -#include "Capabilities.h" -#include "TpmTypes.h" // requires capabilities & GpMacros +#include // required for TpmFail_fp.h +#include +#include // requires capabilities & GpMacros #include "BnValues.h" #ifndef LIB_INCLUDE @@ -115,6 +115,6 @@ // now include the math library functional interface and instantiate the // Crypt_Int & related types // TODO_RENAME_INC_FOLDER: This should have a Tpm_Cryptolib_Common component prefix. -#include "MathLibraryInterface.h" +#include #endif // _TPM_TO_TPMBIGNUM_MATH_H_ diff --git a/src/tpm2/CryptoInterface.h b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/CryptoInterface.h similarity index 98% rename from src/tpm2/CryptoInterface.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/common/include/CryptoInterface.h index 0550c7474..15fc5b199 100644 --- a/src/tpm2/CryptoInterface.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/CryptoInterface.h @@ -43,7 +43,7 @@ #ifndef CRYPTO_INTERFACE_H #define CRYPTO_INTERFACE_H -#include "TpmBuildSwitches.h" +#include "TpmConfiguration/TpmBuildSwitches.h" #if SIMULATION && CRYPTO_LIB_REPORTING diff --git a/src/tpm2/EccConstantData.inl b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/EccConstantData.inl similarity index 100% rename from src/tpm2/EccConstantData.inl rename to src/tpm2/TPMCmd/tpm/cryptolibs/common/include/EccConstantData.inl diff --git a/src/tpm2/MathLibraryInterface.h b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/MathLibraryInterface.h similarity index 100% rename from src/tpm2/MathLibraryInterface.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/common/include/MathLibraryInterface.h diff --git a/src/tpm2/MathLibraryInterfaceTypes.h b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/MathLibraryInterfaceTypes.h similarity index 100% rename from src/tpm2/MathLibraryInterfaceTypes.h rename to src/tpm2/TPMCmd/tpm/cryptolibs/common/include/MathLibraryInterfaceTypes.h diff --git a/src/tpm2/pcrstruct.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/pcrstruct.h similarity index 98% rename from src/tpm2/pcrstruct.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/pcrstruct.h index 8025888db..2970a8850 100644 --- a/src/tpm2/pcrstruct.h +++ b/src/tpm2/TPMCmd/tpm/include/platform_interface/pcrstruct.h @@ -66,9 +66,9 @@ #ifndef _PCRSTRUCT_H_ #define _PCRSTRUCT_H_ -#include "BaseTypes.h" -#include "TpmAlgorithmDefines.h" -#include "TpmTypes.h" +#include +#include +#include // a single PCR typedef struct diff --git a/src/tpm2/TPMCmd/tpm/include/platform_interface/platform_to_tpm_interface.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/platform_to_tpm_interface.h new file mode 100644 index 000000000..9fb0f2250 --- /dev/null +++ b/src/tpm2/TPMCmd/tpm/include/platform_interface/platform_to_tpm_interface.h @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include +#include +#include +#include +#include +#include +// TODO_RENAME_INC_FOLDER: public refers to the TPM_CoreLib public headers +#include diff --git a/src/tpm2/ExecCommand_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/ExecCommand_fp.h similarity index 100% rename from src/tpm2/ExecCommand_fp.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/ExecCommand_fp.h diff --git a/src/tpm2/Manufacture_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/Manufacture_fp.h similarity index 100% rename from src/tpm2/Manufacture_fp.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/Manufacture_fp.h diff --git a/src/tpm2/_TPM_Hash_Data_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Hash_Data_fp.h similarity index 100% rename from src/tpm2/_TPM_Hash_Data_fp.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Hash_Data_fp.h diff --git a/src/tpm2/_TPM_Hash_End_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Hash_End_fp.h similarity index 100% rename from src/tpm2/_TPM_Hash_End_fp.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Hash_End_fp.h diff --git a/src/tpm2/_TPM_Hash_Start_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Hash_Start_fp.h similarity index 100% rename from src/tpm2/_TPM_Hash_Start_fp.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Hash_Start_fp.h diff --git a/src/tpm2/_TPM_Init_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Init_fp.h similarity index 100% rename from src/tpm2/_TPM_Init_fp.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Init_fp.h diff --git a/src/tpm2/platform_failure_mode_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_failure_mode_fp.h similarity index 100% rename from src/tpm2/platform_failure_mode_fp.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_failure_mode_fp.h diff --git a/src/tpm2/platform_init_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_init_fp.h similarity index 100% rename from src/tpm2/platform_init_fp.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_init_fp.h diff --git a/src/tpm2/platform_pcr_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_pcr_fp.h similarity index 97% rename from src/tpm2/platform_pcr_fp.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_pcr_fp.h index 5d9f39247..579e5a24c 100644 --- a/src/tpm2/platform_pcr_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_pcr_fp.h @@ -64,9 +64,9 @@ #ifndef _PLATFORM_PCR_FP_H_ #define _PLATFORM_PCR_FP_H_ -#include "BaseTypes.h" -#include "TpmTypes.h" -#include "pcrstruct.h" +#include +#include +#include // return the number of PCRs the platform recognizes for GetPcrInitializationAttributes. // PCRs are numbered starting at zero. diff --git a/src/tpm2/platform_virtual_nv_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_virtual_nv_fp.h similarity index 95% rename from src/tpm2/platform_virtual_nv_fp.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_virtual_nv_fp.h index e16388b4f..397f8cb3f 100644 --- a/src/tpm2/platform_virtual_nv_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_virtual_nv_fp.h @@ -3,8 +3,8 @@ #ifndef _PLATFORM_VIRTUAL_FP_H_ #define _PLATFORM_VIRTUAL_FP_H_ -#include "NV_Read_fp.h" -#include "NV_ReadPublic_fp.h" +#include +#include // The ECC EK Cert and EK ICA Cert NV indexes are not populated like normal. // Data is generated on the fly and returned when NV_Read or NV_ReadPublic is diff --git a/src/tpm2/tpm_to_platform_interface.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/tpm_to_platform_interface.h similarity index 98% rename from src/tpm2/tpm_to_platform_interface.h rename to src/tpm2/TPMCmd/tpm/include/platform_interface/tpm_to_platform_interface.h index 7910d2f0f..40bcd6608 100644 --- a/src/tpm2/tpm_to_platform_interface.h +++ b/src/tpm2/TPMCmd/tpm/include/platform_interface/tpm_to_platform_interface.h @@ -7,8 +7,8 @@ #define _TPM_TO_PLATFORM_INTERFACE_H_ // need to read configuration for ACT_SUPPORT flag check below -#include "TpmBuildSwitches.h" -#include "TpmProfile.h" +#include +#include #include //** From Cancel.c @@ -442,15 +442,15 @@ LIB_EXPORT size_t _plat_debug_snprintf( #endif // ENABLE_TPM_DEBUG_PRINT // platform PCR initialization functions -#include "platform_pcr_fp.h" +#include // platform initialization functions -#include "platform_init_fp.h" +#include // platform failure mode functions -#include "platform_failure_mode_fp.h" +#include // platform virtual NV functions -#include "platform_virtual_nv_fp.h" +#include #endif // _TPM_TO_PLATFORM_INTERFACE_H_ diff --git a/src/tpm2/CommandAttributeData.h b/src/tpm2/TPMCmd/tpm/include/private/CommandAttributeData.h similarity index 99% rename from src/tpm2/CommandAttributeData.h rename to src/tpm2/TPMCmd/tpm/include/private/CommandAttributeData.h index fe147fd3f..2a419a4b7 100644 --- a/src/tpm2/CommandAttributeData.h +++ b/src/tpm2/TPMCmd/tpm/include/private/CommandAttributeData.h @@ -414,7 +414,7 @@ const TPMA_CC s_ccAttr [] = { #endif // Include attributes for vendor commands -#include "VendorCommands/CommandAttributeData_s_ccAttr.inl" +#include "TpmConfiguration/VendorCommands/CommandAttributeData_s_ccAttr.inl" // list terminator TPMA_ZERO_INITIALIZER() @@ -943,7 +943,7 @@ const COMMAND_ATTRIBUTES s_commandAttributes [] = { #endif // Include attributes for vendor commands -#include "VendorCommands/CommandAttributeData_s_commandAttributes.inl" +#include "TpmConfiguration/VendorCommands/CommandAttributeData_s_commandAttributes.inl" // list terminator 0 diff --git a/src/tpm2/CommandAttributes.h b/src/tpm2/TPMCmd/tpm/include/private/CommandAttributes.h similarity index 100% rename from src/tpm2/CommandAttributes.h rename to src/tpm2/TPMCmd/tpm/include/private/CommandAttributes.h diff --git a/src/tpm2/CommandDispatchData.h b/src/tpm2/TPMCmd/tpm/include/private/CommandDispatchData.h similarity index 99% rename from src/tpm2/CommandDispatchData.h rename to src/tpm2/TPMCmd/tpm/include/private/CommandDispatchData.h index b79c6e03b..efc80f896 100644 --- a/src/tpm2/CommandDispatchData.h +++ b/src/tpm2/TPMCmd/tpm/include/private/CommandDispatchData.h @@ -5190,7 +5190,7 @@ ACT_SetTimeout_COMMAND_DESCRIPTOR_t _ACT_SetTimeoutData = { #define _ACT_SetTimeoutDataAddress 0 #endif // CC_ACT_SetTimeout -#include "VendorCommands/CommandDispatchData_CommandStructures.inl" +#include // Lookup table to access the per-command tables above @@ -5606,7 +5606,7 @@ COMMAND_DESCRIPTOR_t* s_CommandDataArray[] = { (COMMAND_DESCRIPTOR_t*)_PolicyTransportSPDMDataAddress, #endif // CC_PolicyTransportSPDM -#include "VendorCommands/CommandDispatchData_s_CommandDataArray.inl" +#include // list terminator 0 diff --git a/src/tpm2/crypto/CryptEcc.h b/src/tpm2/TPMCmd/tpm/include/private/CryptEcc.h similarity index 100% rename from src/tpm2/crypto/CryptEcc.h rename to src/tpm2/TPMCmd/tpm/include/private/CryptEcc.h diff --git a/src/tpm2/crypto/CryptHash.h b/src/tpm2/TPMCmd/tpm/include/private/CryptHash.h similarity index 100% rename from src/tpm2/crypto/CryptHash.h rename to src/tpm2/TPMCmd/tpm/include/private/CryptHash.h diff --git a/src/tpm2/crypto/CryptRand.h b/src/tpm2/TPMCmd/tpm/include/private/CryptRand.h similarity index 100% rename from src/tpm2/crypto/CryptRand.h rename to src/tpm2/TPMCmd/tpm/include/private/CryptRand.h diff --git a/src/tpm2/crypto/CryptRsa.h b/src/tpm2/TPMCmd/tpm/include/private/CryptRsa.h similarity index 100% rename from src/tpm2/crypto/CryptRsa.h rename to src/tpm2/TPMCmd/tpm/include/private/CryptRsa.h diff --git a/src/tpm2/crypto/CryptSym.h b/src/tpm2/TPMCmd/tpm/include/private/CryptSym.h similarity index 100% rename from src/tpm2/crypto/CryptSym.h rename to src/tpm2/TPMCmd/tpm/include/private/CryptSym.h diff --git a/src/tpm2/crypto/CryptTest.h b/src/tpm2/TPMCmd/tpm/include/private/CryptTest.h similarity index 100% rename from src/tpm2/crypto/CryptTest.h rename to src/tpm2/TPMCmd/tpm/include/private/CryptTest.h diff --git a/src/tpm2/EccTestData.h b/src/tpm2/TPMCmd/tpm/include/private/EccTestData.h similarity index 100% rename from src/tpm2/EccTestData.h rename to src/tpm2/TPMCmd/tpm/include/private/EccTestData.h diff --git a/src/tpm2/Global.h b/src/tpm2/TPMCmd/tpm/include/private/Global.h similarity index 99% rename from src/tpm2/Global.h rename to src/tpm2/TPMCmd/tpm/include/private/Global.h index 456e6a51b..80d919d69 100644 --- a/src/tpm2/Global.h +++ b/src/tpm2/TPMCmd/tpm/include/private/Global.h @@ -32,9 +32,9 @@ _REDUCE_WARNING_LEVEL_(2) _NORMAL_WARNING_LEVEL_ #include "BackwardsCompatibility.h" // libtpms added -# include "GpMacros.h" -# include "Capabilities.h" -# include "TpmTypes.h" // requires GpMacros & Capabilities +# include "tpm_public/GpMacros.h" +# include "tpm_public/Capabilities.h" +# include "tpm_public/TpmTypes.h" // requires GpMacros & Capabilities # include "CommandAttributes.h" # include "CryptTest.h" @@ -50,7 +50,7 @@ _NORMAL_WARNING_LEVEL_ # include "CryptRsa.h" # include "CryptTest.h" # include "NV.h" -# include "ACT.h" +# include "tpm_public/ACT.h" # include "Utils.h" // libtpms added //** Defines and Types @@ -1429,7 +1429,7 @@ EXTERN OBJECT s_objects[MAX_LOADED_OBJECTS]; //*** From PCR.c //***************************************************************************** # if defined PCR_C || defined GLOBAL_C -# include "pcrstruct.h" +# include EXTERN PCR s_pcrs[IMPLEMENTATION_PCR]; diff --git a/src/tpm2/HashTestData.h b/src/tpm2/TPMCmd/tpm/include/private/HashTestData.h similarity index 100% rename from src/tpm2/HashTestData.h rename to src/tpm2/TPMCmd/tpm/include/private/HashTestData.h diff --git a/src/tpm2/InternalRoutines.h b/src/tpm2/TPMCmd/tpm/include/private/InternalRoutines.h similarity index 71% rename from src/tpm2/InternalRoutines.h rename to src/tpm2/TPMCmd/tpm/include/private/InternalRoutines.h index b439b78d2..5256b7575 100644 --- a/src/tpm2/InternalRoutines.h +++ b/src/tpm2/TPMCmd/tpm/include/private/InternalRoutines.h @@ -8,9 +8,10 @@ #endif // DRTM functions -#include "_TPM_Hash_Start_fp.h" -#include "_TPM_Hash_Data_fp.h" -#include "_TPM_Hash_End_fp.h" +// TODO_RENAME_INC_FOLDER:platform_interface refers to the TPM_CoreLib platform interface +#include +#include +#include // Internal subsystem functions #include "Object_fp.h" @@ -28,17 +29,19 @@ #if SEC_CHANNEL_SUPPORT # include "SecChannel_fp.h" #endif // SEC_CHANNEL_SUPPORT -#include "TpmFail_fp.h" +// TODO_RENAME_INC_FOLDER: public refers to the TPM_CoreLib public headers +#include #include "SessionProcess_fp.h" // Internal support functions #include "CommandCodeAttributes_fp.h" -#include "Marshal_fp.h" +#include "Marshal.h" #include "Time_fp.h" #include "Locality_fp.h" #include "PP_fp.h" #include "CommandAudit_fp.h" -#include "Manufacture_fp.h" +// TODO_RENAME_INC_FOLDER:platform_interface refers to the TPM_CoreLib platform interface +#include #include "Handle_fp.h" #include "Power_fp.h" #include "Response_fp.h" @@ -55,15 +58,18 @@ #include "IoBuffers_fp.h" #include "Memory_fp.h" #include "ResponseCodeProcessing_fp.h" -/* Internal cryptographic functions */ -#include "BnConvert_fp.h" -#include "BnMath_fp.h" -#include "BnMemory_fp.h" + +// Asymmetric Support library Interface +// TODO_RENAME_INC_FOLDER: needs a component prefix +// Math interface must be included before other Crypt headers to define types +#include + +// Internal cryptographic functions #include "Ticket_fp.h" #include "CryptUtil_fp.h" #include "CryptHash_fp.h" #include "CryptSym_fp.h" -#include "CryptDes_fp.h" +#include "CryptDes_fp.h" // libtpms added #include "CryptPrime_fp.h" #include "CryptRand_fp.h" #include "CryptSelfTest_fp.h" @@ -89,12 +95,9 @@ # include "CryptCmac_fp.h" # endif #endif -// Asymmetric Support library Interface -// TODO_RENAME_INC_FOLDER: needs a component prefix -#include "MathLibraryInterface.h" // Linkage to platform functions // TODO_RENAME_INC_FOLDER:platform_interface refers to the TPM_CoreLib platform interface -#include "tpm_to_platform_interface.h" +#include #endif diff --git a/src/tpm2/KdfTestData.h b/src/tpm2/TPMCmd/tpm/include/private/KdfTestData.h similarity index 100% rename from src/tpm2/KdfTestData.h rename to src/tpm2/TPMCmd/tpm/include/private/KdfTestData.h diff --git a/src/tpm2/crypto/openssl/LibSupport.h b/src/tpm2/TPMCmd/tpm/include/private/LibSupport.h similarity index 99% rename from src/tpm2/crypto/openssl/LibSupport.h rename to src/tpm2/TPMCmd/tpm/include/private/LibSupport.h index 88c32eac2..523849687 100644 --- a/src/tpm2/crypto/openssl/LibSupport.h +++ b/src/tpm2/TPMCmd/tpm/include/private/LibSupport.h @@ -64,7 +64,7 @@ #ifndef _LIB_SUPPORT_H_ #define _LIB_SUPPORT_H_ // TODO_RENAME_INC_FOLDER: public refers to the TPM_CoreLib public headers -#include "tpm_radix.h" +#include // Include the options for hashing and symmetric. Defer the load of the math package // Until the bignum parameters are defined. diff --git a/src/tpm2/Marshal.h b/src/tpm2/TPMCmd/tpm/include/private/Marshal.h similarity index 100% rename from src/tpm2/Marshal.h rename to src/tpm2/TPMCmd/tpm/include/private/Marshal.h diff --git a/src/tpm2/NV.h b/src/tpm2/TPMCmd/tpm/include/private/NV.h similarity index 100% rename from src/tpm2/NV.h rename to src/tpm2/TPMCmd/tpm/include/private/NV.h diff --git a/src/tpm2/OIDs.h b/src/tpm2/TPMCmd/tpm/include/private/OIDs.h similarity index 100% rename from src/tpm2/OIDs.h rename to src/tpm2/TPMCmd/tpm/include/private/OIDs.h diff --git a/src/tpm2/PRNG_TestVectors.h b/src/tpm2/TPMCmd/tpm/include/private/PRNG_TestVectors.h similarity index 100% rename from src/tpm2/PRNG_TestVectors.h rename to src/tpm2/TPMCmd/tpm/include/private/PRNG_TestVectors.h diff --git a/src/tpm2/RsaTestData.h b/src/tpm2/TPMCmd/tpm/include/private/RsaTestData.h similarity index 100% rename from src/tpm2/RsaTestData.h rename to src/tpm2/TPMCmd/tpm/include/private/RsaTestData.h diff --git a/src/tpm2/SelfTest.h b/src/tpm2/TPMCmd/tpm/include/private/SelfTest.h similarity index 100% rename from src/tpm2/SelfTest.h rename to src/tpm2/TPMCmd/tpm/include/private/SelfTest.h diff --git a/src/tpm2/SymmetricTest.h b/src/tpm2/TPMCmd/tpm/include/private/SymmetricTest.h similarity index 100% rename from src/tpm2/SymmetricTest.h rename to src/tpm2/TPMCmd/tpm/include/private/SymmetricTest.h diff --git a/src/tpm2/SymmetricTestData.h b/src/tpm2/TPMCmd/tpm/include/private/SymmetricTestData.h similarity index 100% rename from src/tpm2/SymmetricTestData.h rename to src/tpm2/TPMCmd/tpm/include/private/SymmetricTestData.h diff --git a/src/tpm2/Tpm.h b/src/tpm2/TPMCmd/tpm/include/private/Tpm.h similarity index 96% rename from src/tpm2/Tpm.h rename to src/tpm2/TPMCmd/tpm/include/private/Tpm.h index 7dbe8ac7f..90472a410 100644 --- a/src/tpm2/Tpm.h +++ b/src/tpm2/TPMCmd/tpm/include/private/Tpm.h @@ -63,14 +63,14 @@ #ifndef _TPM_H_ #define _TPM_H_ // TODO_RENAME_INC_FOLDER: public refers to the TPM_CoreLib public headers -#include "tpm_public.h" +#include -#include "TpmAlgorithmDefines.h" +#include "tpm_public/TpmAlgorithmDefines.h" #include "LibSupport.h" // Types from the library. These need to come before // Global.h because some of the structures in // that file depend on the structures used by the // cryptographic libraries. -#include "GpMacros.h" // Define additional macros +#include "tpm_public/GpMacros.h" // Define additional macros #include "Global.h" // Define other TPM types #include "InternalRoutines.h" // Function prototypes #include "RuntimeProfile_fp.h" // libtpms added diff --git a/src/tpm2/TpmASN1.h b/src/tpm2/TPMCmd/tpm/include/private/TpmASN1.h similarity index 100% rename from src/tpm2/TpmASN1.h rename to src/tpm2/TPMCmd/tpm/include/private/TpmASN1.h diff --git a/src/tpm2/X509.h b/src/tpm2/TPMCmd/tpm/include/private/X509.h similarity index 100% rename from src/tpm2/X509.h rename to src/tpm2/TPMCmd/tpm/include/private/X509.h diff --git a/src/tpm2/ACT_SetTimeout_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_SetTimeout_fp.h similarity index 100% rename from src/tpm2/ACT_SetTimeout_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_SetTimeout_fp.h diff --git a/src/tpm2/ACT_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_spt_fp.h similarity index 100% rename from src/tpm2/ACT_spt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_spt_fp.h diff --git a/src/tpm2/ActivateCredential_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ActivateCredential_fp.h similarity index 100% rename from src/tpm2/ActivateCredential_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ActivateCredential_fp.h diff --git a/src/tpm2/AlgorithmCap_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmCap_fp.h similarity index 100% rename from src/tpm2/AlgorithmCap_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmCap_fp.h diff --git a/src/tpm2/AlgorithmTests_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmTests_fp.h similarity index 100% rename from src/tpm2/AlgorithmTests_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmTests_fp.h diff --git a/src/tpm2/Attest_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Attest_spt_fp.h similarity index 100% rename from src/tpm2/Attest_spt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Attest_spt_fp.h diff --git a/src/tpm2/Bits_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Bits_fp.h similarity index 100% rename from src/tpm2/Bits_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Bits_fp.h diff --git a/src/tpm2/CertifyCreation_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyCreation_fp.h similarity index 100% rename from src/tpm2/CertifyCreation_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyCreation_fp.h diff --git a/src/tpm2/CertifyX509_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyX509_fp.h similarity index 100% rename from src/tpm2/CertifyX509_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyX509_fp.h diff --git a/src/tpm2/Certify_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Certify_fp.h similarity index 100% rename from src/tpm2/Certify_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Certify_fp.h diff --git a/src/tpm2/ChangeEPS_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangeEPS_fp.h similarity index 100% rename from src/tpm2/ChangeEPS_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangeEPS_fp.h diff --git a/src/tpm2/ChangePPS_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangePPS_fp.h similarity index 100% rename from src/tpm2/ChangePPS_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangePPS_fp.h diff --git a/src/tpm2/ClearControl_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClearControl_fp.h similarity index 100% rename from src/tpm2/ClearControl_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ClearControl_fp.h diff --git a/src/tpm2/Clear_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Clear_fp.h similarity index 100% rename from src/tpm2/Clear_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Clear_fp.h diff --git a/src/tpm2/ClockRateAdjust_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockRateAdjust_fp.h similarity index 100% rename from src/tpm2/ClockRateAdjust_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockRateAdjust_fp.h diff --git a/src/tpm2/ClockSet_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockSet_fp.h similarity index 100% rename from src/tpm2/ClockSet_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockSet_fp.h diff --git a/src/tpm2/CommandAudit_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandAudit_fp.h similarity index 100% rename from src/tpm2/CommandAudit_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandAudit_fp.h diff --git a/src/tpm2/CommandCodeAttributes_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandCodeAttributes_fp.h similarity index 100% rename from src/tpm2/CommandCodeAttributes_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandCodeAttributes_fp.h diff --git a/src/tpm2/CommandDispatcher_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandDispatcher_fp.h similarity index 100% rename from src/tpm2/CommandDispatcher_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandDispatcher_fp.h diff --git a/src/tpm2/Commit_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Commit_fp.h similarity index 100% rename from src/tpm2/Commit_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Commit_fp.h diff --git a/src/tpm2/ContextLoad_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextLoad_fp.h similarity index 100% rename from src/tpm2/ContextLoad_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextLoad_fp.h diff --git a/src/tpm2/ContextSave_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextSave_fp.h similarity index 100% rename from src/tpm2/ContextSave_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextSave_fp.h diff --git a/src/tpm2/Context_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Context_spt_fp.h similarity index 100% rename from src/tpm2/Context_spt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Context_spt_fp.h diff --git a/src/tpm2/CreateLoaded_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CreateLoaded_fp.h similarity index 100% rename from src/tpm2/CreateLoaded_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CreateLoaded_fp.h diff --git a/src/tpm2/CreatePrimary_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CreatePrimary_fp.h similarity index 100% rename from src/tpm2/CreatePrimary_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CreatePrimary_fp.h diff --git a/src/tpm2/Create_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Create_fp.h similarity index 100% rename from src/tpm2/Create_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Create_fp.h diff --git a/src/tpm2/crypto/CryptCmac_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptCmac_fp.h similarity index 100% rename from src/tpm2/crypto/CryptCmac_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptCmac_fp.h diff --git a/src/tpm2/crypto/CryptEccCrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccCrypt_fp.h similarity index 100% rename from src/tpm2/crypto/CryptEccCrypt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccCrypt_fp.h diff --git a/src/tpm2/crypto/CryptEccKeyExchange_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccKeyExchange_fp.h similarity index 100% rename from src/tpm2/crypto/CryptEccKeyExchange_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccKeyExchange_fp.h diff --git a/src/tpm2/crypto/CryptEccMain_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccMain_fp.h similarity index 99% rename from src/tpm2/crypto/CryptEccMain_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccMain_fp.h index e24bc6b68..99e8a816b 100644 --- a/src/tpm2/crypto/CryptEccMain_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccMain_fp.h @@ -67,7 +67,7 @@ #define _CRYPT_ECC_MAIN_FP_H_ #if ALG_ECC -# include "CryptRand.h" +# include //** Functions # if SIMULATION diff --git a/src/tpm2/crypto/CryptEccSignature_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccSignature_fp.h similarity index 100% rename from src/tpm2/crypto/CryptEccSignature_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccSignature_fp.h diff --git a/src/tpm2/crypto/CryptHash_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptHash_fp.h similarity index 100% rename from src/tpm2/crypto/CryptHash_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptHash_fp.h diff --git a/src/tpm2/crypto/CryptPrimeSieve_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrimeSieve_fp.h similarity index 100% rename from src/tpm2/crypto/CryptPrimeSieve_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrimeSieve_fp.h diff --git a/src/tpm2/crypto/CryptPrime_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrime_fp.h similarity index 100% rename from src/tpm2/crypto/CryptPrime_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrime_fp.h diff --git a/src/tpm2/crypto/CryptRand_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRand_fp.h similarity index 100% rename from src/tpm2/crypto/CryptRand_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRand_fp.h diff --git a/src/tpm2/crypto/CryptRsa_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRsa_fp.h similarity index 100% rename from src/tpm2/crypto/CryptRsa_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRsa_fp.h diff --git a/src/tpm2/CryptSelfTest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSelfTest_fp.h similarity index 100% rename from src/tpm2/CryptSelfTest_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSelfTest_fp.h diff --git a/src/tpm2/crypto/CryptSmac_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSmac_fp.h similarity index 100% rename from src/tpm2/crypto/CryptSmac_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSmac_fp.h diff --git a/src/tpm2/crypto/CryptSym_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSym_fp.h similarity index 100% rename from src/tpm2/crypto/CryptSym_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSym_fp.h diff --git a/src/tpm2/crypto/CryptUtil_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptUtil_fp.h similarity index 100% rename from src/tpm2/crypto/CryptUtil_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptUtil_fp.h diff --git a/src/tpm2/DA_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/DA_fp.h similarity index 100% rename from src/tpm2/DA_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/DA_fp.h diff --git a/src/tpm2/DictionaryAttackLockReset_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackLockReset_fp.h similarity index 100% rename from src/tpm2/DictionaryAttackLockReset_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackLockReset_fp.h diff --git a/src/tpm2/DictionaryAttackParameters_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackParameters_fp.h similarity index 100% rename from src/tpm2/DictionaryAttackParameters_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackParameters_fp.h diff --git a/src/tpm2/Duplicate_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Duplicate_fp.h similarity index 100% rename from src/tpm2/Duplicate_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Duplicate_fp.h diff --git a/src/tpm2/crypto/ECC_Decrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Decrypt_fp.h similarity index 100% rename from src/tpm2/crypto/ECC_Decrypt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Decrypt_fp.h diff --git a/src/tpm2/crypto/ECC_Encrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Encrypt_fp.h similarity index 100% rename from src/tpm2/crypto/ECC_Encrypt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Encrypt_fp.h diff --git a/src/tpm2/ECC_Parameters_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Parameters_fp.h similarity index 100% rename from src/tpm2/ECC_Parameters_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Parameters_fp.h diff --git a/src/tpm2/ECDH_KeyGen_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_KeyGen_fp.h similarity index 100% rename from src/tpm2/ECDH_KeyGen_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_KeyGen_fp.h diff --git a/src/tpm2/ECDH_ZGen_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_ZGen_fp.h similarity index 100% rename from src/tpm2/ECDH_ZGen_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_ZGen_fp.h diff --git a/src/tpm2/EC_Ephemeral_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EC_Ephemeral_fp.h similarity index 100% rename from src/tpm2/EC_Ephemeral_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/EC_Ephemeral_fp.h diff --git a/src/tpm2/EncryptDecrypt2_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt2_fp.h similarity index 100% rename from src/tpm2/EncryptDecrypt2_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt2_fp.h diff --git a/src/tpm2/EncryptDecrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_fp.h similarity index 100% rename from src/tpm2/EncryptDecrypt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_fp.h diff --git a/src/tpm2/EncryptDecrypt_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_spt_fp.h similarity index 100% rename from src/tpm2/EncryptDecrypt_spt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_spt_fp.h diff --git a/src/tpm2/Entity_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Entity_fp.h similarity index 100% rename from src/tpm2/Entity_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Entity_fp.h diff --git a/src/tpm2/EventSequenceComplete_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EventSequenceComplete_fp.h similarity index 100% rename from src/tpm2/EventSequenceComplete_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/EventSequenceComplete_fp.h diff --git a/src/tpm2/EvictControl_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EvictControl_fp.h similarity index 100% rename from src/tpm2/EvictControl_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/EvictControl_fp.h diff --git a/src/tpm2/FlushContext_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/FlushContext_fp.h similarity index 100% rename from src/tpm2/FlushContext_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/FlushContext_fp.h diff --git a/src/tpm2/GetCapability_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCapability_fp.h similarity index 100% rename from src/tpm2/GetCapability_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCapability_fp.h diff --git a/src/tpm2/GetCommandAuditDigest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCommandAuditDigest_fp.h similarity index 100% rename from src/tpm2/GetCommandAuditDigest_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCommandAuditDigest_fp.h diff --git a/src/tpm2/GetRandom_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetRandom_fp.h similarity index 100% rename from src/tpm2/GetRandom_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/GetRandom_fp.h diff --git a/src/tpm2/GetSessionAuditDigest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetSessionAuditDigest_fp.h similarity index 100% rename from src/tpm2/GetSessionAuditDigest_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/GetSessionAuditDigest_fp.h diff --git a/src/tpm2/GetTestResult_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTestResult_fp.h similarity index 100% rename from src/tpm2/GetTestResult_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTestResult_fp.h diff --git a/src/tpm2/GetTime_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTime_fp.h similarity index 100% rename from src/tpm2/GetTime_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTime_fp.h diff --git a/src/tpm2/HMAC_Start_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_Start_fp.h similarity index 100% rename from src/tpm2/HMAC_Start_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_Start_fp.h diff --git a/src/tpm2/HMAC_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_fp.h similarity index 100% rename from src/tpm2/HMAC_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_fp.h diff --git a/src/tpm2/Handle_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Handle_fp.h similarity index 100% rename from src/tpm2/Handle_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Handle_fp.h diff --git a/src/tpm2/HashSequenceStart_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HashSequenceStart_fp.h similarity index 100% rename from src/tpm2/HashSequenceStart_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/HashSequenceStart_fp.h diff --git a/src/tpm2/Hash_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Hash_fp.h similarity index 100% rename from src/tpm2/Hash_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Hash_fp.h diff --git a/src/tpm2/HierarchyChangeAuth_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyChangeAuth_fp.h similarity index 100% rename from src/tpm2/HierarchyChangeAuth_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyChangeAuth_fp.h diff --git a/src/tpm2/HierarchyControl_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyControl_fp.h similarity index 100% rename from src/tpm2/HierarchyControl_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyControl_fp.h diff --git a/src/tpm2/Hierarchy_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Hierarchy_fp.h similarity index 100% rename from src/tpm2/Hierarchy_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Hierarchy_fp.h diff --git a/src/tpm2/Import_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Import_fp.h similarity index 100% rename from src/tpm2/Import_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Import_fp.h diff --git a/src/tpm2/IncrementalSelfTest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/IncrementalSelfTest_fp.h similarity index 100% rename from src/tpm2/IncrementalSelfTest_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/IncrementalSelfTest_fp.h diff --git a/src/tpm2/IoBuffers_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/IoBuffers_fp.h similarity index 100% rename from src/tpm2/IoBuffers_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/IoBuffers_fp.h diff --git a/src/tpm2/LoadExternal_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/LoadExternal_fp.h similarity index 100% rename from src/tpm2/LoadExternal_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/LoadExternal_fp.h diff --git a/src/tpm2/Load_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Load_fp.h similarity index 100% rename from src/tpm2/Load_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Load_fp.h diff --git a/src/tpm2/Locality_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Locality_fp.h similarity index 100% rename from src/tpm2/Locality_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Locality_fp.h diff --git a/src/tpm2/MAC_Start_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_Start_fp.h similarity index 100% rename from src/tpm2/MAC_Start_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_Start_fp.h diff --git a/src/tpm2/MAC_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_fp.h similarity index 100% rename from src/tpm2/MAC_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_fp.h diff --git a/src/tpm2/MakeCredential_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MakeCredential_fp.h similarity index 100% rename from src/tpm2/MakeCredential_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/MakeCredential_fp.h diff --git a/src/tpm2/Marshal_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Marshal_fp.h similarity index 99% rename from src/tpm2/Marshal_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Marshal_fp.h index 08686ac02..31ca655a6 100644 --- a/src/tpm2/Marshal_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Marshal_fp.h @@ -62,7 +62,7 @@ #define MARSHAL_FP_H #include "Tpm.h" -#include "TpmTypes.h" +#include #ifdef __cplusplus extern "C" { diff --git a/src/tpm2/MathOnByteBuffers_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MathOnByteBuffers_fp.h similarity index 100% rename from src/tpm2/MathOnByteBuffers_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/MathOnByteBuffers_fp.h diff --git a/src/tpm2/Memory_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Memory_fp.h similarity index 100% rename from src/tpm2/Memory_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Memory_fp.h diff --git a/src/tpm2/NV_Certify_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Certify_fp.h similarity index 100% rename from src/tpm2/NV_Certify_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Certify_fp.h diff --git a/src/tpm2/NV_ChangeAuth_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ChangeAuth_fp.h similarity index 100% rename from src/tpm2/NV_ChangeAuth_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ChangeAuth_fp.h diff --git a/src/tpm2/NV_DefineSpace2_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace2_fp.h similarity index 100% rename from src/tpm2/NV_DefineSpace2_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace2_fp.h diff --git a/src/tpm2/NV_DefineSpace_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace_fp.h similarity index 100% rename from src/tpm2/NV_DefineSpace_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace_fp.h diff --git a/src/tpm2/NV_Extend_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Extend_fp.h similarity index 100% rename from src/tpm2/NV_Extend_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Extend_fp.h diff --git a/src/tpm2/NV_GlobalWriteLock_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_GlobalWriteLock_fp.h similarity index 100% rename from src/tpm2/NV_GlobalWriteLock_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_GlobalWriteLock_fp.h diff --git a/src/tpm2/NV_Increment_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Increment_fp.h similarity index 100% rename from src/tpm2/NV_Increment_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Increment_fp.h diff --git a/src/tpm2/NV_ReadLock_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadLock_fp.h similarity index 100% rename from src/tpm2/NV_ReadLock_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadLock_fp.h diff --git a/src/tpm2/NV_ReadPublic2_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic2_fp.h similarity index 100% rename from src/tpm2/NV_ReadPublic2_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic2_fp.h diff --git a/src/tpm2/NV_ReadPublic_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic_fp.h similarity index 100% rename from src/tpm2/NV_ReadPublic_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic_fp.h diff --git a/src/tpm2/NV_Read_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Read_fp.h similarity index 100% rename from src/tpm2/NV_Read_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Read_fp.h diff --git a/src/tpm2/NV_SetBits_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_SetBits_fp.h similarity index 100% rename from src/tpm2/NV_SetBits_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_SetBits_fp.h diff --git a/src/tpm2/NV_UndefineSpaceSpecial_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpaceSpecial_fp.h similarity index 100% rename from src/tpm2/NV_UndefineSpaceSpecial_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpaceSpecial_fp.h diff --git a/src/tpm2/NV_UndefineSpace_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpace_fp.h similarity index 100% rename from src/tpm2/NV_UndefineSpace_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpace_fp.h diff --git a/src/tpm2/NV_WriteLock_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_WriteLock_fp.h similarity index 100% rename from src/tpm2/NV_WriteLock_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_WriteLock_fp.h diff --git a/src/tpm2/NV_Write_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Write_fp.h similarity index 100% rename from src/tpm2/NV_Write_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Write_fp.h diff --git a/src/tpm2/NV_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_spt_fp.h similarity index 100% rename from src/tpm2/NV_spt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_spt_fp.h diff --git a/src/tpm2/NvDynamic_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NvDynamic_fp.h similarity index 100% rename from src/tpm2/NvDynamic_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NvDynamic_fp.h diff --git a/src/tpm2/NvReserved_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NvReserved_fp.h similarity index 100% rename from src/tpm2/NvReserved_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/NvReserved_fp.h diff --git a/src/tpm2/ObjectChangeAuth_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ObjectChangeAuth_fp.h similarity index 100% rename from src/tpm2/ObjectChangeAuth_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ObjectChangeAuth_fp.h diff --git a/src/tpm2/Object_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Object_fp.h similarity index 100% rename from src/tpm2/Object_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Object_fp.h diff --git a/src/tpm2/Object_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Object_spt_fp.h similarity index 100% rename from src/tpm2/Object_spt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Object_spt_fp.h diff --git a/src/tpm2/PCR_Allocate_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Allocate_fp.h similarity index 100% rename from src/tpm2/PCR_Allocate_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Allocate_fp.h diff --git a/src/tpm2/PCR_Event_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Event_fp.h similarity index 100% rename from src/tpm2/PCR_Event_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Event_fp.h diff --git a/src/tpm2/PCR_Extend_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Extend_fp.h similarity index 100% rename from src/tpm2/PCR_Extend_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Extend_fp.h diff --git a/src/tpm2/PCR_Read_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Read_fp.h similarity index 100% rename from src/tpm2/PCR_Read_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Read_fp.h diff --git a/src/tpm2/PCR_Reset_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Reset_fp.h similarity index 100% rename from src/tpm2/PCR_Reset_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Reset_fp.h diff --git a/src/tpm2/PCR_SetAuthPolicy_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthPolicy_fp.h similarity index 100% rename from src/tpm2/PCR_SetAuthPolicy_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthPolicy_fp.h diff --git a/src/tpm2/PCR_SetAuthValue_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthValue_fp.h similarity index 100% rename from src/tpm2/PCR_SetAuthValue_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthValue_fp.h diff --git a/src/tpm2/PCR_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_fp.h similarity index 100% rename from src/tpm2/PCR_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_fp.h diff --git a/src/tpm2/PP_Commands_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_Commands_fp.h similarity index 100% rename from src/tpm2/PP_Commands_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_Commands_fp.h diff --git a/src/tpm2/PP_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_fp.h similarity index 100% rename from src/tpm2/PP_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_fp.h diff --git a/src/tpm2/PolicyAuthValue_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthValue_fp.h similarity index 100% rename from src/tpm2/PolicyAuthValue_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthValue_fp.h diff --git a/src/tpm2/PolicyAuthorizeNV_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorizeNV_fp.h similarity index 100% rename from src/tpm2/PolicyAuthorizeNV_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorizeNV_fp.h diff --git a/src/tpm2/PolicyAuthorize_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorize_fp.h similarity index 100% rename from src/tpm2/PolicyAuthorize_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorize_fp.h diff --git a/src/tpm2/PolicyCapability_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCapability_fp.h similarity index 100% rename from src/tpm2/PolicyCapability_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCapability_fp.h diff --git a/src/tpm2/PolicyCommandCode_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCommandCode_fp.h similarity index 100% rename from src/tpm2/PolicyCommandCode_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCommandCode_fp.h diff --git a/src/tpm2/PolicyCounterTimer_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCounterTimer_fp.h similarity index 100% rename from src/tpm2/PolicyCounterTimer_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCounterTimer_fp.h diff --git a/src/tpm2/PolicyCpHash_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCpHash_fp.h similarity index 100% rename from src/tpm2/PolicyCpHash_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCpHash_fp.h diff --git a/src/tpm2/PolicyDuplicationSelect_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyDuplicationSelect_fp.h similarity index 100% rename from src/tpm2/PolicyDuplicationSelect_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyDuplicationSelect_fp.h diff --git a/src/tpm2/PolicyGetDigest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyGetDigest_fp.h similarity index 100% rename from src/tpm2/PolicyGetDigest_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyGetDigest_fp.h diff --git a/src/tpm2/PolicyLocality_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyLocality_fp.h similarity index 100% rename from src/tpm2/PolicyLocality_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyLocality_fp.h diff --git a/src/tpm2/PolicyNV_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNV_fp.h similarity index 100% rename from src/tpm2/PolicyNV_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNV_fp.h diff --git a/src/tpm2/PolicyNameHash_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNameHash_fp.h similarity index 100% rename from src/tpm2/PolicyNameHash_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNameHash_fp.h diff --git a/src/tpm2/PolicyNvWritten_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNvWritten_fp.h similarity index 100% rename from src/tpm2/PolicyNvWritten_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNvWritten_fp.h diff --git a/src/tpm2/PolicyOR_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyOR_fp.h similarity index 100% rename from src/tpm2/PolicyOR_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyOR_fp.h diff --git a/src/tpm2/PolicyPCR_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPCR_fp.h similarity index 100% rename from src/tpm2/PolicyPCR_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPCR_fp.h diff --git a/src/tpm2/PolicyParameters_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyParameters_fp.h similarity index 100% rename from src/tpm2/PolicyParameters_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyParameters_fp.h diff --git a/src/tpm2/PolicyPassword_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPassword_fp.h similarity index 100% rename from src/tpm2/PolicyPassword_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPassword_fp.h diff --git a/src/tpm2/PolicyPhysicalPresence_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPhysicalPresence_fp.h similarity index 100% rename from src/tpm2/PolicyPhysicalPresence_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPhysicalPresence_fp.h diff --git a/src/tpm2/PolicyRestart_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyRestart_fp.h similarity index 100% rename from src/tpm2/PolicyRestart_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyRestart_fp.h diff --git a/src/tpm2/PolicySecret_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySecret_fp.h similarity index 100% rename from src/tpm2/PolicySecret_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySecret_fp.h diff --git a/src/tpm2/PolicySigned_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySigned_fp.h similarity index 100% rename from src/tpm2/PolicySigned_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySigned_fp.h diff --git a/src/tpm2/PolicyTemplate_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTemplate_fp.h similarity index 100% rename from src/tpm2/PolicyTemplate_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTemplate_fp.h diff --git a/src/tpm2/PolicyTicket_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTicket_fp.h similarity index 100% rename from src/tpm2/PolicyTicket_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTicket_fp.h diff --git a/src/tpm2/PolicyTransportSPDM_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTransportSPDM_fp.h similarity index 100% rename from src/tpm2/PolicyTransportSPDM_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTransportSPDM_fp.h diff --git a/src/tpm2/Policy_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Policy_spt_fp.h similarity index 100% rename from src/tpm2/Policy_spt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Policy_spt_fp.h diff --git a/src/tpm2/Power_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Power_fp.h similarity index 100% rename from src/tpm2/Power_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Power_fp.h diff --git a/src/tpm2/PropertyCap_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PropertyCap_fp.h similarity index 100% rename from src/tpm2/PropertyCap_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/PropertyCap_fp.h diff --git a/src/tpm2/Quote_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Quote_fp.h similarity index 100% rename from src/tpm2/Quote_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Quote_fp.h diff --git a/src/tpm2/RSA_Decrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Decrypt_fp.h similarity index 100% rename from src/tpm2/RSA_Decrypt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Decrypt_fp.h diff --git a/src/tpm2/RSA_Encrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Encrypt_fp.h similarity index 100% rename from src/tpm2/RSA_Encrypt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Encrypt_fp.h diff --git a/src/tpm2/ReadClock_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadClock_fp.h similarity index 100% rename from src/tpm2/ReadClock_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadClock_fp.h diff --git a/src/tpm2/ReadOnlyControl_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadOnlyControl_fp.h similarity index 100% rename from src/tpm2/ReadOnlyControl_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadOnlyControl_fp.h diff --git a/src/tpm2/ReadPublic_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadPublic_fp.h similarity index 100% rename from src/tpm2/ReadPublic_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadPublic_fp.h diff --git a/src/tpm2/ResponseCodeProcessing_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ResponseCodeProcessing_fp.h similarity index 100% rename from src/tpm2/ResponseCodeProcessing_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ResponseCodeProcessing_fp.h diff --git a/src/tpm2/Response_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Response_fp.h similarity index 100% rename from src/tpm2/Response_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Response_fp.h diff --git a/src/tpm2/Rewrap_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Rewrap_fp.h similarity index 100% rename from src/tpm2/Rewrap_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Rewrap_fp.h diff --git a/src/tpm2/SecChannel_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SecChannel_fp.h similarity index 100% rename from src/tpm2/SecChannel_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/SecChannel_fp.h diff --git a/src/tpm2/SelfTest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SelfTest_fp.h similarity index 100% rename from src/tpm2/SelfTest_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/SelfTest_fp.h diff --git a/src/tpm2/SequenceComplete_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceComplete_fp.h similarity index 100% rename from src/tpm2/SequenceComplete_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceComplete_fp.h diff --git a/src/tpm2/SequenceUpdate_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceUpdate_fp.h similarity index 100% rename from src/tpm2/SequenceUpdate_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceUpdate_fp.h diff --git a/src/tpm2/SessionProcess_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SessionProcess_fp.h similarity index 100% rename from src/tpm2/SessionProcess_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/SessionProcess_fp.h diff --git a/src/tpm2/Session_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Session_fp.h similarity index 100% rename from src/tpm2/Session_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Session_fp.h diff --git a/src/tpm2/SetAlgorithmSet_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetAlgorithmSet_fp.h similarity index 100% rename from src/tpm2/SetAlgorithmSet_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/SetAlgorithmSet_fp.h diff --git a/src/tpm2/SetCapability_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCapability_fp.h similarity index 100% rename from src/tpm2/SetCapability_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCapability_fp.h diff --git a/src/tpm2/SetCommandCodeAuditStatus_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCommandCodeAuditStatus_fp.h similarity index 100% rename from src/tpm2/SetCommandCodeAuditStatus_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCommandCodeAuditStatus_fp.h diff --git a/src/tpm2/SetPrimaryPolicy_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetPrimaryPolicy_fp.h similarity index 100% rename from src/tpm2/SetPrimaryPolicy_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/SetPrimaryPolicy_fp.h diff --git a/src/tpm2/Shutdown_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Shutdown_fp.h similarity index 100% rename from src/tpm2/Shutdown_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Shutdown_fp.h diff --git a/src/tpm2/Sign_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Sign_fp.h similarity index 100% rename from src/tpm2/Sign_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Sign_fp.h diff --git a/src/tpm2/StartAuthSession_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/StartAuthSession_fp.h similarity index 100% rename from src/tpm2/StartAuthSession_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/StartAuthSession_fp.h diff --git a/src/tpm2/Startup_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Startup_fp.h similarity index 100% rename from src/tpm2/Startup_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Startup_fp.h diff --git a/src/tpm2/StirRandom_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/StirRandom_fp.h similarity index 100% rename from src/tpm2/StirRandom_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/StirRandom_fp.h diff --git a/src/tpm2/TestParms_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TestParms_fp.h similarity index 100% rename from src/tpm2/TestParms_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/TestParms_fp.h diff --git a/src/tpm2/Ticket_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Ticket_fp.h similarity index 100% rename from src/tpm2/Ticket_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Ticket_fp.h diff --git a/src/tpm2/Time_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Time_fp.h similarity index 100% rename from src/tpm2/Time_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Time_fp.h diff --git a/src/tpm2/TpmASN1_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmASN1_fp.h similarity index 100% rename from src/tpm2/TpmASN1_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmASN1_fp.h diff --git a/src/tpm2/TpmEcc_Signature_ECDAA_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_ECDAA_fp.h similarity index 100% rename from src/tpm2/TpmEcc_Signature_ECDAA_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_ECDAA_fp.h diff --git a/src/tpm2/TpmEcc_Signature_ECDSA_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_ECDSA_fp.h similarity index 97% rename from src/tpm2/TpmEcc_Signature_ECDSA_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_ECDSA_fp.h index ff1f01153..b7407a43f 100644 --- a/src/tpm2/TpmEcc_Signature_ECDSA_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_ECDSA_fp.h @@ -4,7 +4,7 @@ #define _TPMECC_SIGNATURE_ECDSA_FP_H_ #if ALG_ECC && ALG_ECDSA -# include "CryptRand.h" +# include //*** TpmEcc_SignEcdsa() // This function implements the ECDSA signing algorithm. The method is described diff --git a/src/tpm2/TpmEcc_Signature_SM2_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_SM2_fp.h similarity index 100% rename from src/tpm2/TpmEcc_Signature_SM2_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_SM2_fp.h diff --git a/src/tpm2/TpmEcc_Signature_Schnorr_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Schnorr_fp.h similarity index 100% rename from src/tpm2/TpmEcc_Signature_Schnorr_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Schnorr_fp.h diff --git a/src/tpm2/TpmEcc_Signature_Util_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Util_fp.h similarity index 100% rename from src/tpm2/TpmEcc_Signature_Util_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Util_fp.h diff --git a/src/tpm2/TpmEcc_Util_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Util_fp.h similarity index 100% rename from src/tpm2/TpmEcc_Util_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Util_fp.h diff --git a/src/tpm2/TpmMath_Debug_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Debug_fp.h similarity index 100% rename from src/tpm2/TpmMath_Debug_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Debug_fp.h diff --git a/src/tpm2/TpmMath_Util_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Util_fp.h similarity index 100% rename from src/tpm2/TpmMath_Util_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Util_fp.h diff --git a/src/tpm2/TpmSizeChecks_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmSizeChecks_fp.h similarity index 100% rename from src/tpm2/TpmSizeChecks_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmSizeChecks_fp.h diff --git a/src/tpm2/Unseal_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Unseal_fp.h similarity index 100% rename from src/tpm2/Unseal_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/Unseal_fp.h diff --git a/src/tpm2/VerifySignature_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/VerifySignature_fp.h similarity index 100% rename from src/tpm2/VerifySignature_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/VerifySignature_fp.h diff --git a/src/tpm2/X509_ECC_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_ECC_fp.h similarity index 100% rename from src/tpm2/X509_ECC_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_ECC_fp.h diff --git a/src/tpm2/X509_RSA_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_RSA_fp.h similarity index 100% rename from src/tpm2/X509_RSA_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_RSA_fp.h diff --git a/src/tpm2/X509_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_spt_fp.h similarity index 100% rename from src/tpm2/X509_spt_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_spt_fp.h diff --git a/src/tpm2/ZGen_2Phase_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ZGen_2Phase_fp.h similarity index 100% rename from src/tpm2/ZGen_2Phase_fp.h rename to src/tpm2/TPMCmd/tpm/include/private/prototypes/ZGen_2Phase_fp.h diff --git a/src/tpm2/ACT.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/ACT.h similarity index 99% rename from src/tpm2/ACT.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/ACT.h index 2e75f28cb..5523b9444 100644 --- a/src/tpm2/ACT.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/ACT.h @@ -3,7 +3,7 @@ #ifndef _ACT_H_ #define _ACT_H_ -#include "TpmProfile.h" +#include #if 0 // libtpms added #if ACT_SUPPORT \ diff --git a/src/tpm2/BaseTypes.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/BaseTypes.h similarity index 100% rename from src/tpm2/BaseTypes.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/BaseTypes.h diff --git a/src/tpm2/Capabilities.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/Capabilities.h similarity index 100% rename from src/tpm2/Capabilities.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/Capabilities.h diff --git a/src/tpm2/CompilerDependencies.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/CompilerDependencies.h similarity index 100% rename from src/tpm2/CompilerDependencies.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/CompilerDependencies.h diff --git a/src/tpm2/CompilerDependencies_gcc.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/CompilerDependencies_gcc.h similarity index 100% rename from src/tpm2/CompilerDependencies_gcc.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/CompilerDependencies_gcc.h diff --git a/src/tpm2/CompilerDependencies_msvc.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/CompilerDependencies_msvc.h similarity index 100% rename from src/tpm2/CompilerDependencies_msvc.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/CompilerDependencies_msvc.h diff --git a/src/tpm2/GpMacros.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/GpMacros.h similarity index 99% rename from src/tpm2/GpMacros.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/GpMacros.h index c721fc31d..38b361bd9 100644 --- a/src/tpm2/GpMacros.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/GpMacros.h @@ -11,7 +11,8 @@ #endif #include "endian_swap.h" -#include "TpmFail_fp.h" +#include +#include //** For Self-test // These macros are used in CryptUtil to invoke the incremental self test. @@ -435,6 +436,6 @@ // and that is a UINT64. So, this is an invariant value #define CONTEXT_COUNTER UINT64 -#include "TpmCalculatedAttributes.h" +#include "tpm_public/TpmCalculatedAttributes.h" #endif // GP_MACROS_H diff --git a/src/tpm2/MinMax.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/MinMax.h similarity index 100% rename from src/tpm2/MinMax.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/MinMax.h diff --git a/src/tpm2/TPMB.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/TPMB.h similarity index 97% rename from src/tpm2/TPMB.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/TPMB.h index 037108850..fdc570a91 100644 --- a/src/tpm2/TPMB.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/TPMB.h @@ -7,7 +7,7 @@ #ifndef _TPMB_H #define _TPMB_H -#include "BaseTypes.h" +#include //*** Size Types // These types are used to differentiate the two different size values used. diff --git a/src/tpm2/TpmAlgorithmDefines.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmAlgorithmDefines.h similarity index 99% rename from src/tpm2/TpmAlgorithmDefines.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/TpmAlgorithmDefines.h index f1d31163c..1dfab9ea7 100644 --- a/src/tpm2/TpmAlgorithmDefines.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmAlgorithmDefines.h @@ -6,9 +6,9 @@ #ifndef _TPM_INCLUDE_PRIVATE_TPMALGORITHMDEFINES_H_ #define _TPM_INCLUDE_PRIVATE_TPMALGORITHMDEFINES_H_ -#include "TpmProfile.h" -#include "MinMax.h" -#include "TPMB.h" +#include +#include "tpm_public/MinMax.h" +#include "tpm_public/TPMB.h" #if ALG_ECC // Table "Defines for NIST_P192 ECC Values" (TCG Algorithm Registry) diff --git a/src/tpm2/TpmCalculatedAttributes.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmCalculatedAttributes.h similarity index 99% rename from src/tpm2/TpmCalculatedAttributes.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/TpmCalculatedAttributes.h index e50336d70..e1b7eac53 100644 --- a/src/tpm2/TpmCalculatedAttributes.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmCalculatedAttributes.h @@ -61,8 +61,8 @@ #ifndef _TPM_CALCULATED_ATTRIBUTES_H_ #define _TPM_CALCULATED_ATTRIBUTES_H_ -#include "TpmAlgorithmDefines.h" -#include "GpMacros.h" +#include "tpm_public/TpmAlgorithmDefines.h" +#include "tpm_public/GpMacros.h" #define JOIN(x, y) x##y #define JOIN3(x, y, z) x##y##z diff --git a/src/tpm2/TpmTypes.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmTypes.h similarity index 99% rename from src/tpm2/TpmTypes.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/TpmTypes.h index f1aceb410..c79583954 100644 --- a/src/tpm2/TpmTypes.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmTypes.h @@ -9,10 +9,10 @@ #ifndef MAX_CAP_BUFFER # error MAX_CAP_BUFFER must be defined before this file so it can calculate maximum capability sizes #endif -#include "Capabilities.h" -#include "TpmAlgorithmDefines.h" -#include "TpmCalculatedAttributes.h" -#include "GpMacros.h" +#include "tpm_public/Capabilities.h" +#include "tpm_public/TpmAlgorithmDefines.h" +#include "tpm_public/TpmCalculatedAttributes.h" +#include "tpm_public/GpMacros.h" // Table "Definition of Types for Documentation Clarity" (Part 2: Structures) typedef UINT32 TPM_ALGORITHM_ID; diff --git a/src/tpm2/VerifyConfiguration.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/VerifyConfiguration.h similarity index 100% rename from src/tpm2/VerifyConfiguration.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/VerifyConfiguration.h diff --git a/src/tpm2/endian_swap.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/endian_swap.h similarity index 100% rename from src/tpm2/endian_swap.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/endian_swap.h diff --git a/src/tpm2/TpmFail_fp.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/prototypes/TpmFail_fp.h similarity index 100% rename from src/tpm2/TpmFail_fp.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/prototypes/TpmFail_fp.h diff --git a/src/tpm2/tpm_debug.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_debug.h similarity index 97% rename from src/tpm2/tpm_debug.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_debug.h index 0f175ff42..009463890 100644 --- a/src/tpm2/tpm_debug.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_debug.h @@ -3,7 +3,7 @@ #ifndef _TPM_DEBUG_H_ #define _TPM_DEBUG_H_ -#include "tpm_to_platform_interface.h" +#include // Basic Debug Printing #if ENABLE_TPM_DEBUG_PRINT diff --git a/src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_public.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_public.h new file mode 100644 index 000000000..27d534f5e --- /dev/null +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_public.h @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: BSD-2-Clause + +#include +#include + +// public refers to the TPM_CoreLib public headers +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/src/tpm2/crypto/openssl/tpm_radix.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_radix.h similarity index 100% rename from src/tpm2/crypto/openssl/tpm_radix.h rename to src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_radix.h diff --git a/src/tpm2/TpmASN1.c b/src/tpm2/TPMCmd/tpm/src/X509/TpmASN1.c similarity index 100% rename from src/tpm2/TpmASN1.c rename to src/tpm2/TPMCmd/tpm/src/X509/TpmASN1.c diff --git a/src/tpm2/X509_ECC.c b/src/tpm2/TPMCmd/tpm/src/X509/X509_ECC.c similarity index 100% rename from src/tpm2/X509_ECC.c rename to src/tpm2/TPMCmd/tpm/src/X509/X509_ECC.c diff --git a/src/tpm2/X509_RSA.c b/src/tpm2/TPMCmd/tpm/src/X509/X509_RSA.c similarity index 100% rename from src/tpm2/X509_RSA.c rename to src/tpm2/TPMCmd/tpm/src/X509/X509_RSA.c diff --git a/src/tpm2/X509_spt.c b/src/tpm2/TPMCmd/tpm/src/X509/X509_spt.c similarity index 100% rename from src/tpm2/X509_spt.c rename to src/tpm2/TPMCmd/tpm/src/X509/X509_spt.c diff --git a/src/tpm2/Attest_spt.c b/src/tpm2/TPMCmd/tpm/src/command/Attestation/Attest_spt.c similarity index 100% rename from src/tpm2/Attest_spt.c rename to src/tpm2/TPMCmd/tpm/src/command/Attestation/Attest_spt.c diff --git a/src/tpm2/Quote.c b/src/tpm2/TPMCmd/tpm/src/command/Attestation/Quote.c similarity index 100% rename from src/tpm2/Quote.c rename to src/tpm2/TPMCmd/tpm/src/command/Attestation/Quote.c diff --git a/src/tpm2/ACT_spt.c b/src/tpm2/TPMCmd/tpm/src/command/ClockTimer/ACT_spt.c similarity index 99% rename from src/tpm2/ACT_spt.c rename to src/tpm2/TPMCmd/tpm/src/command/ClockTimer/ACT_spt.c index be0262b4b..c3bcef070 100644 --- a/src/tpm2/ACT_spt.c +++ b/src/tpm2/TPMCmd/tpm/src/command/ClockTimer/ACT_spt.c @@ -71,7 +71,7 @@ #include "Tpm.h" #include "ACT_spt_fp.h" // TODO_RENAME_INC_FOLDER:platform_interface refers to the TPM_CoreLib platform interface -#include "tpm_to_platform_interface.h" +#include //** Functions diff --git a/src/tpm2/Context_spt.c b/src/tpm2/TPMCmd/tpm/src/command/Context/Context_spt.c similarity index 100% rename from src/tpm2/Context_spt.c rename to src/tpm2/TPMCmd/tpm/src/command/Context/Context_spt.c diff --git a/src/tpm2/Duplicate.c b/src/tpm2/TPMCmd/tpm/src/command/Duplication/Duplicate.c similarity index 100% rename from src/tpm2/Duplicate.c rename to src/tpm2/TPMCmd/tpm/src/command/Duplication/Duplicate.c diff --git a/src/tpm2/Import.c b/src/tpm2/TPMCmd/tpm/src/command/Duplication/Import.c similarity index 100% rename from src/tpm2/Import.c rename to src/tpm2/TPMCmd/tpm/src/command/Duplication/Import.c diff --git a/src/tpm2/PolicyAuthorize.c b/src/tpm2/TPMCmd/tpm/src/command/EA/PolicyAuthorize.c similarity index 100% rename from src/tpm2/PolicyAuthorize.c rename to src/tpm2/TPMCmd/tpm/src/command/EA/PolicyAuthorize.c diff --git a/src/tpm2/PolicyAuthorizeNV.c b/src/tpm2/TPMCmd/tpm/src/command/EA/PolicyAuthorizeNV.c similarity index 100% rename from src/tpm2/PolicyAuthorizeNV.c rename to src/tpm2/TPMCmd/tpm/src/command/EA/PolicyAuthorizeNV.c diff --git a/src/tpm2/PolicyPCR.c b/src/tpm2/TPMCmd/tpm/src/command/EA/PolicyPCR.c similarity index 100% rename from src/tpm2/PolicyPCR.c rename to src/tpm2/TPMCmd/tpm/src/command/EA/PolicyPCR.c diff --git a/src/tpm2/PolicySecret.c b/src/tpm2/TPMCmd/tpm/src/command/EA/PolicySecret.c similarity index 100% rename from src/tpm2/PolicySecret.c rename to src/tpm2/TPMCmd/tpm/src/command/EA/PolicySecret.c diff --git a/src/tpm2/PolicySigned.c b/src/tpm2/TPMCmd/tpm/src/command/EA/PolicySigned.c similarity index 100% rename from src/tpm2/PolicySigned.c rename to src/tpm2/TPMCmd/tpm/src/command/EA/PolicySigned.c diff --git a/src/tpm2/PolicyTicket.c b/src/tpm2/TPMCmd/tpm/src/command/EA/PolicyTicket.c similarity index 100% rename from src/tpm2/PolicyTicket.c rename to src/tpm2/TPMCmd/tpm/src/command/EA/PolicyTicket.c diff --git a/src/tpm2/PolicyTransportSPDM.c b/src/tpm2/TPMCmd/tpm/src/command/EA/PolicyTransportSPDM.c similarity index 100% rename from src/tpm2/PolicyTransportSPDM.c rename to src/tpm2/TPMCmd/tpm/src/command/EA/PolicyTransportSPDM.c diff --git a/src/tpm2/Policy_spt.c b/src/tpm2/TPMCmd/tpm/src/command/EA/Policy_spt.c similarity index 100% rename from src/tpm2/Policy_spt.c rename to src/tpm2/TPMCmd/tpm/src/command/EA/Policy_spt.c diff --git a/src/tpm2/CreatePrimary.c b/src/tpm2/TPMCmd/tpm/src/command/Hierarchy/CreatePrimary.c similarity index 100% rename from src/tpm2/CreatePrimary.c rename to src/tpm2/TPMCmd/tpm/src/command/Hierarchy/CreatePrimary.c diff --git a/src/tpm2/ReadOnlyControl.c b/src/tpm2/TPMCmd/tpm/src/command/Hierarchy/ReadOnlyControl.c similarity index 100% rename from src/tpm2/ReadOnlyControl.c rename to src/tpm2/TPMCmd/tpm/src/command/Hierarchy/ReadOnlyControl.c diff --git a/src/tpm2/NV_Read.c b/src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_Read.c similarity index 97% rename from src/tpm2/NV_Read.c rename to src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_Read.c index e72c8ea8b..aad4bb9c3 100644 --- a/src/tpm2/NV_Read.c +++ b/src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_Read.c @@ -2,7 +2,7 @@ #include "Tpm.h" #include "NV_Read_fp.h" -#include "platform_virtual_nv_fp.h" +#include #if CC_NV_Read // Conditional expansion of this file diff --git a/src/tpm2/NV_ReadPublic.c b/src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic.c similarity index 94% rename from src/tpm2/NV_ReadPublic.c rename to src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic.c index 48e15e9a9..27fc61e0d 100644 --- a/src/tpm2/NV_ReadPublic.c +++ b/src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic.c @@ -2,7 +2,7 @@ #include "Tpm.h" #include "NV_ReadPublic_fp.h" -#include "platform_virtual_nv_fp.h" +#include #if CC_NV_ReadPublic // Conditional expansion of this file diff --git a/src/tpm2/NV_ReadPublic2.c b/src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic2.c similarity index 95% rename from src/tpm2/NV_ReadPublic2.c rename to src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic2.c index b6de7efd7..b47b26139 100644 --- a/src/tpm2/NV_ReadPublic2.c +++ b/src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic2.c @@ -3,7 +3,7 @@ #include "Tpm.h" #include "NV_ReadPublic2_fp.h" #include "NV_DefineSpace_fp.h" // for the RC modifiers -#include "platform_virtual_nv_fp.h" +#include #if CC_NV_ReadPublic2 // Conditional expansion of this file diff --git a/src/tpm2/NV_spt.c b/src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_spt.c similarity index 100% rename from src/tpm2/NV_spt.c rename to src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_spt.c diff --git a/src/tpm2/Create.c b/src/tpm2/TPMCmd/tpm/src/command/Object/Create.c similarity index 100% rename from src/tpm2/Create.c rename to src/tpm2/TPMCmd/tpm/src/command/Object/Create.c diff --git a/src/tpm2/CreateLoaded.c b/src/tpm2/TPMCmd/tpm/src/command/Object/CreateLoaded.c similarity index 100% rename from src/tpm2/CreateLoaded.c rename to src/tpm2/TPMCmd/tpm/src/command/Object/CreateLoaded.c diff --git a/src/tpm2/MakeCredential.c b/src/tpm2/TPMCmd/tpm/src/command/Object/MakeCredential.c similarity index 100% rename from src/tpm2/MakeCredential.c rename to src/tpm2/TPMCmd/tpm/src/command/Object/MakeCredential.c diff --git a/src/tpm2/ObjectChangeAuth.c b/src/tpm2/TPMCmd/tpm/src/command/Object/ObjectChangeAuth.c similarity index 100% rename from src/tpm2/ObjectChangeAuth.c rename to src/tpm2/TPMCmd/tpm/src/command/Object/ObjectChangeAuth.c diff --git a/src/tpm2/Object_spt.c b/src/tpm2/TPMCmd/tpm/src/command/Object/Object_spt.c similarity index 100% rename from src/tpm2/Object_spt.c rename to src/tpm2/TPMCmd/tpm/src/command/Object/Object_spt.c diff --git a/src/tpm2/PCR_Read.c b/src/tpm2/TPMCmd/tpm/src/command/PCR/PCR_Read.c similarity index 100% rename from src/tpm2/PCR_Read.c rename to src/tpm2/TPMCmd/tpm/src/command/PCR/PCR_Read.c diff --git a/src/tpm2/EncryptDecrypt_spt.c b/src/tpm2/TPMCmd/tpm/src/command/Symmetric/EncryptDecrypt_spt.c similarity index 100% rename from src/tpm2/EncryptDecrypt_spt.c rename to src/tpm2/TPMCmd/tpm/src/command/Symmetric/EncryptDecrypt_spt.c diff --git a/src/tpm2/AlgorithmTests.c b/src/tpm2/TPMCmd/tpm/src/crypt/AlgorithmTests.c similarity index 100% rename from src/tpm2/AlgorithmTests.c rename to src/tpm2/TPMCmd/tpm/src/crypt/AlgorithmTests.c diff --git a/src/tpm2/crypto/openssl/CryptCmac.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptCmac.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptCmac.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptCmac.c diff --git a/src/tpm2/crypto/openssl/CryptDes.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptDes.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptDes.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptDes.c diff --git a/src/tpm2/crypto/openssl/CryptEccCrypt.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccCrypt.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptEccCrypt.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptEccCrypt.c diff --git a/src/tpm2/CryptEccData.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccData.c similarity index 100% rename from src/tpm2/CryptEccData.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptEccData.c diff --git a/src/tpm2/crypto/openssl/CryptEccKeyExchange.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccKeyExchange.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptEccKeyExchange.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptEccKeyExchange.c diff --git a/src/tpm2/crypto/openssl/CryptEccMain.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccMain.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptEccMain.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptEccMain.c diff --git a/src/tpm2/crypto/openssl/CryptEccSignature.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccSignature.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptEccSignature.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptEccSignature.c diff --git a/src/tpm2/crypto/openssl/CryptHash.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptHash.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptHash.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptHash.c diff --git a/src/tpm2/crypto/openssl/CryptPrime.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptPrime.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptPrime.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptPrime.c diff --git a/src/tpm2/crypto/openssl/CryptPrimeSieve.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptPrimeSieve.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptPrimeSieve.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptPrimeSieve.c diff --git a/src/tpm2/crypto/openssl/CryptRand.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptRand.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptRand.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptRand.c diff --git a/src/tpm2/crypto/openssl/CryptRsa.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptRsa.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptRsa.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptRsa.c diff --git a/src/tpm2/CryptSelfTest.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptSelfTest.c similarity index 100% rename from src/tpm2/CryptSelfTest.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptSelfTest.c diff --git a/src/tpm2/crypto/openssl/CryptSmac.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptSmac.c similarity index 100% rename from src/tpm2/crypto/openssl/CryptSmac.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptSmac.c diff --git a/src/tpm2/crypto/openssl/CryptSym.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptSym.c similarity index 99% rename from src/tpm2/crypto/openssl/CryptSym.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptSym.c index 9564627e6..1a1dbf3cd 100644 --- a/src/tpm2/crypto/openssl/CryptSym.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/CryptSym.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: BSD-2-clause +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // diff --git a/src/tpm2/CryptUtil.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c similarity index 100% rename from src/tpm2/CryptUtil.c rename to src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c diff --git a/src/tpm2/Ticket.c b/src/tpm2/TPMCmd/tpm/src/crypt/Ticket.c similarity index 100% rename from src/tpm2/Ticket.c rename to src/tpm2/TPMCmd/tpm/src/crypt/Ticket.c diff --git a/src/tpm2/TpmEcc_Signature_ECDAA.c b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_ECDAA.c similarity index 100% rename from src/tpm2/TpmEcc_Signature_ECDAA.c rename to src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_ECDAA.c diff --git a/src/tpm2/TpmEcc_Signature_SM2.c b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_SM2.c similarity index 100% rename from src/tpm2/TpmEcc_Signature_SM2.c rename to src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_SM2.c diff --git a/src/tpm2/TpmEcc_Signature_Schnorr.c b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Schnorr.c similarity index 100% rename from src/tpm2/TpmEcc_Signature_Schnorr.c rename to src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Schnorr.c diff --git a/src/tpm2/TpmEcc_Signature_Util.c b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Util.c similarity index 100% rename from src/tpm2/TpmEcc_Signature_Util.c rename to src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Util.c diff --git a/src/tpm2/TpmEcc_Util.c b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Util.c similarity index 100% rename from src/tpm2/TpmEcc_Util.c rename to src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Util.c diff --git a/src/tpm2/TpmMath_Debug.c b/src/tpm2/TPMCmd/tpm/src/crypt/math/TpmMath_Debug.c similarity index 100% rename from src/tpm2/TpmMath_Debug.c rename to src/tpm2/TPMCmd/tpm/src/crypt/math/TpmMath_Debug.c diff --git a/src/tpm2/TpmMath_Util.c b/src/tpm2/TPMCmd/tpm/src/crypt/math/TpmMath_Util.c similarity index 100% rename from src/tpm2/TpmMath_Util.c rename to src/tpm2/TPMCmd/tpm/src/crypt/math/TpmMath_Util.c diff --git a/src/tpm2/_TPM_Init.c b/src/tpm2/TPMCmd/tpm/src/events/_TPM_Init.c similarity index 94% rename from src/tpm2/_TPM_Init.c rename to src/tpm2/TPMCmd/tpm/src/events/_TPM_Init.c index 3a9ab399b..4f933744b 100644 --- a/src/tpm2/_TPM_Init.c +++ b/src/tpm2/TPMCmd/tpm/src/events/_TPM_Init.c @@ -1,7 +1,8 @@ // SPDX-License-Identifier: BSD-2-Clause -#include "Tpm.h" -#include "_TPM_Init_fp.h" +#include +// TODO_RENAME_INC_FOLDER:platform_interface refers to the TPM_CoreLib platform interface +#include #include "StateMarshal.h" // libtpms added // Move this to a future _plat_NvUpdateData() API and perform this in diff --git a/src/tpm2/CommandDispatcher.c b/src/tpm2/TPMCmd/tpm/src/main/CommandDispatcher.c similarity index 100% rename from src/tpm2/CommandDispatcher.c rename to src/tpm2/TPMCmd/tpm/src/main/CommandDispatcher.c diff --git a/src/tpm2/ExecCommand.c b/src/tpm2/TPMCmd/tpm/src/main/ExecCommand.c similarity index 99% rename from src/tpm2/ExecCommand.c rename to src/tpm2/TPMCmd/tpm/src/main/ExecCommand.c index 0d580296e..51a43ca0e 100644 --- a/src/tpm2/ExecCommand.c +++ b/src/tpm2/TPMCmd/tpm/src/main/ExecCommand.c @@ -10,7 +10,7 @@ #include "Tpm.h" #include "Marshal.h" // TODO_RENAME_INC_FOLDER:platform_interface refers to the TPM_CoreLib platform interface -#include "ExecCommand_fp.h" // libtpms changed +#include // Uncomment this next #include if doing static command/response buffer sizing // #include "CommandResponseSizes_fp.h" diff --git a/src/tpm2/SessionProcess.c b/src/tpm2/TPMCmd/tpm/src/main/SessionProcess.c similarity index 99% rename from src/tpm2/SessionProcess.c rename to src/tpm2/TPMCmd/tpm/src/main/SessionProcess.c index a90891c44..690e0cb4b 100644 --- a/src/tpm2/SessionProcess.c +++ b/src/tpm2/TPMCmd/tpm/src/main/SessionProcess.c @@ -11,9 +11,9 @@ #define SESSION_PROCESS_C #include "Tpm.h" -#include "ACT.h" +#include "tpm_public/ACT.h" #include "Marshal.h" -#include "platform_virtual_nv_fp.h" +#include #if SEC_CHANNEL_SUPPORT # include "SecChannel_fp.h" #endif // SEC_CHANNEL_SUPPORT diff --git a/src/tpm2/CommandAudit.c b/src/tpm2/TPMCmd/tpm/src/subsystem/CommandAudit.c similarity index 100% rename from src/tpm2/CommandAudit.c rename to src/tpm2/TPMCmd/tpm/src/subsystem/CommandAudit.c diff --git a/src/tpm2/DA.c b/src/tpm2/TPMCmd/tpm/src/subsystem/DA.c similarity index 100% rename from src/tpm2/DA.c rename to src/tpm2/TPMCmd/tpm/src/subsystem/DA.c diff --git a/src/tpm2/Hierarchy.c b/src/tpm2/TPMCmd/tpm/src/subsystem/Hierarchy.c similarity index 100% rename from src/tpm2/Hierarchy.c rename to src/tpm2/TPMCmd/tpm/src/subsystem/Hierarchy.c diff --git a/src/tpm2/NvDynamic.c b/src/tpm2/TPMCmd/tpm/src/subsystem/NvDynamic.c similarity index 99% rename from src/tpm2/NvDynamic.c rename to src/tpm2/TPMCmd/tpm/src/subsystem/NvDynamic.c index 0b851a922..a8c28d03e 100644 --- a/src/tpm2/NvDynamic.c +++ b/src/tpm2/TPMCmd/tpm/src/subsystem/NvDynamic.c @@ -41,7 +41,7 @@ #define NV_C #include "Tpm.h" #include "Marshal.h" -#include "platform_virtual_nv_fp.h" // libtpms changed +#include #include "tpm_library_intern.h" // libtpms added #include "BackwardsCompatibilityObject.h" // libtpms added diff --git a/src/tpm2/NvReserved.c b/src/tpm2/TPMCmd/tpm/src/subsystem/NvReserved.c similarity index 100% rename from src/tpm2/NvReserved.c rename to src/tpm2/TPMCmd/tpm/src/subsystem/NvReserved.c diff --git a/src/tpm2/Object.c b/src/tpm2/TPMCmd/tpm/src/subsystem/Object.c similarity index 100% rename from src/tpm2/Object.c rename to src/tpm2/TPMCmd/tpm/src/subsystem/Object.c diff --git a/src/tpm2/PCR.c b/src/tpm2/TPMCmd/tpm/src/subsystem/PCR.c similarity index 100% rename from src/tpm2/PCR.c rename to src/tpm2/TPMCmd/tpm/src/subsystem/PCR.c diff --git a/src/tpm2/PP.c b/src/tpm2/TPMCmd/tpm/src/subsystem/PP.c similarity index 100% rename from src/tpm2/PP.c rename to src/tpm2/TPMCmd/tpm/src/subsystem/PP.c diff --git a/src/tpm2/Session.c b/src/tpm2/TPMCmd/tpm/src/subsystem/Session.c similarity index 100% rename from src/tpm2/Session.c rename to src/tpm2/TPMCmd/tpm/src/subsystem/Session.c diff --git a/src/tpm2/Time.c b/src/tpm2/TPMCmd/tpm/src/subsystem/Time.c similarity index 100% rename from src/tpm2/Time.c rename to src/tpm2/TPMCmd/tpm/src/subsystem/Time.c diff --git a/src/tpm2/AlgorithmCap.c b/src/tpm2/TPMCmd/tpm/src/support/AlgorithmCap.c similarity index 100% rename from src/tpm2/AlgorithmCap.c rename to src/tpm2/TPMCmd/tpm/src/support/AlgorithmCap.c diff --git a/src/tpm2/Bits.c b/src/tpm2/TPMCmd/tpm/src/support/Bits.c similarity index 100% rename from src/tpm2/Bits.c rename to src/tpm2/TPMCmd/tpm/src/support/Bits.c diff --git a/src/tpm2/CommandCodeAttributes.c b/src/tpm2/TPMCmd/tpm/src/support/CommandCodeAttributes.c similarity index 100% rename from src/tpm2/CommandCodeAttributes.c rename to src/tpm2/TPMCmd/tpm/src/support/CommandCodeAttributes.c diff --git a/src/tpm2/Entity.c b/src/tpm2/TPMCmd/tpm/src/support/Entity.c similarity index 99% rename from src/tpm2/Entity.c rename to src/tpm2/TPMCmd/tpm/src/support/Entity.c index bdc058436..5030f3f71 100644 --- a/src/tpm2/Entity.c +++ b/src/tpm2/TPMCmd/tpm/src/support/Entity.c @@ -8,7 +8,7 @@ //** Includes #include "Tpm.h" -#include "platform_virtual_nv_fp.h" +#include //** Functions //*** EntityGetLoadStatus() diff --git a/src/tpm2/Global.c b/src/tpm2/TPMCmd/tpm/src/support/Global.c similarity index 100% rename from src/tpm2/Global.c rename to src/tpm2/TPMCmd/tpm/src/support/Global.c diff --git a/src/tpm2/Handle.c b/src/tpm2/TPMCmd/tpm/src/support/Handle.c similarity index 100% rename from src/tpm2/Handle.c rename to src/tpm2/TPMCmd/tpm/src/support/Handle.c diff --git a/src/tpm2/IoBuffers.c b/src/tpm2/TPMCmd/tpm/src/support/IoBuffers.c similarity index 100% rename from src/tpm2/IoBuffers.c rename to src/tpm2/TPMCmd/tpm/src/support/IoBuffers.c diff --git a/src/tpm2/Locality.c b/src/tpm2/TPMCmd/tpm/src/support/Locality.c similarity index 100% rename from src/tpm2/Locality.c rename to src/tpm2/TPMCmd/tpm/src/support/Locality.c diff --git a/src/tpm2/Manufacture.c b/src/tpm2/TPMCmd/tpm/src/support/Manufacture.c similarity index 100% rename from src/tpm2/Manufacture.c rename to src/tpm2/TPMCmd/tpm/src/support/Manufacture.c diff --git a/src/tpm2/Marshal.c b/src/tpm2/TPMCmd/tpm/src/support/Marshal.c similarity index 100% rename from src/tpm2/Marshal.c rename to src/tpm2/TPMCmd/tpm/src/support/Marshal.c diff --git a/src/tpm2/MathOnByteBuffers.c b/src/tpm2/TPMCmd/tpm/src/support/MathOnByteBuffers.c similarity index 100% rename from src/tpm2/MathOnByteBuffers.c rename to src/tpm2/TPMCmd/tpm/src/support/MathOnByteBuffers.c diff --git a/src/tpm2/Memory.c b/src/tpm2/TPMCmd/tpm/src/support/Memory.c similarity index 100% rename from src/tpm2/Memory.c rename to src/tpm2/TPMCmd/tpm/src/support/Memory.c diff --git a/src/tpm2/Power.c b/src/tpm2/TPMCmd/tpm/src/support/Power.c similarity index 100% rename from src/tpm2/Power.c rename to src/tpm2/TPMCmd/tpm/src/support/Power.c diff --git a/src/tpm2/PropertyCap.c b/src/tpm2/TPMCmd/tpm/src/support/PropertyCap.c similarity index 100% rename from src/tpm2/PropertyCap.c rename to src/tpm2/TPMCmd/tpm/src/support/PropertyCap.c diff --git a/src/tpm2/Response.c b/src/tpm2/TPMCmd/tpm/src/support/Response.c similarity index 100% rename from src/tpm2/Response.c rename to src/tpm2/TPMCmd/tpm/src/support/Response.c diff --git a/src/tpm2/ResponseCodeProcessing.c b/src/tpm2/TPMCmd/tpm/src/support/ResponseCodeProcessing.c similarity index 100% rename from src/tpm2/ResponseCodeProcessing.c rename to src/tpm2/TPMCmd/tpm/src/support/ResponseCodeProcessing.c diff --git a/src/tpm2/SecChannel.c b/src/tpm2/TPMCmd/tpm/src/support/SecChannel.c similarity index 100% rename from src/tpm2/SecChannel.c rename to src/tpm2/TPMCmd/tpm/src/support/SecChannel.c diff --git a/src/tpm2/TpmFail.c b/src/tpm2/TPMCmd/tpm/src/support/TpmFail.c similarity index 99% rename from src/tpm2/TpmFail.c rename to src/tpm2/TPMCmd/tpm/src/support/TpmFail.c index 89a5a813f..271227de5 100644 --- a/src/tpm2/TpmFail.c +++ b/src/tpm2/TPMCmd/tpm/src/support/TpmFail.c @@ -10,7 +10,7 @@ // structures is not important as this function does not use any of the structures // in TpmTypes.h and only include it for the #defines of the capabilities, // properties, and command code values. -#include "TpmTypes.h" +#include "tpm_public/TpmTypes.h" #define TPM_HAVE_TPM2_DECLARATIONS #include "tpm_library_intern.h" // libtpms added diff --git a/src/tpm2/TpmSizeChecks.c b/src/tpm2/TPMCmd/tpm/src/support/TpmSizeChecks.c similarity index 100% rename from src/tpm2/TpmSizeChecks.c rename to src/tpm2/TPMCmd/tpm/src/support/TpmSizeChecks.c diff --git a/src/tpm2/Unmarshal_fp.h b/src/tpm2/Unmarshal_fp.h index 4f48a3ad0..27643c659 100644 --- a/src/tpm2/Unmarshal_fp.h +++ b/src/tpm2/Unmarshal_fp.h @@ -64,7 +64,7 @@ #define UNMARSHAL_FP_H #include "Tpm.h" -#include "TpmTypes.h" +#include #ifdef __cplusplus extern "C" { diff --git a/src/tpm2/Utils.h b/src/tpm2/Utils.h index b9becef29..a8d4749fb 100644 --- a/src/tpm2/Utils.h +++ b/src/tpm2/Utils.h @@ -39,7 +39,7 @@ #ifndef UTILS_H #define UTILS_H -#include "Memory_fp.h" +#include "prototypes/Memory_fp.h" #define TPM2_ROUNDUP(VAL, SIZE) \ ( ( (VAL) + (SIZE) - 1) / (SIZE) ) * (SIZE) diff --git a/src/tpm2/Volatile.h b/src/tpm2/Volatile.h index 9913e8d91..512a46f44 100644 --- a/src/tpm2/Volatile.h +++ b/src/tpm2/Volatile.h @@ -39,7 +39,7 @@ #ifndef VOLATILE_H #define VOLATILE_H -#include "BaseTypes.h" +#include TPM_RC VolatileState_Load(BYTE **buffer, INT32 *size); UINT16 VolatileState_Save(BYTE **buffer, INT32 *size); diff --git a/src/tpm2/crypto/CryptSelfTest_fp.h b/src/tpm2/crypto/CryptSelfTest_fp.h deleted file mode 100644 index e91df04b2..000000000 --- a/src/tpm2/crypto/CryptSelfTest_fp.h +++ /dev/null @@ -1,127 +0,0 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CryptSelfTest_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ - -/*(Auto-generated) - * Created by TpmPrototypes; Version 3.0 July 18, 2017 - * Date: Mar 4, 2020 Time: 02:36:44PM - */ - -#ifndef _CRYPT_SELF_TEST_FP_H_ -#define _CRYPT_SELF_TEST_FP_H_ - -//*** CryptSelfTest() -// This function is called to start/complete a full self-test. -// If 'fullTest' is NO, then only the untested algorithms will be run. If -// 'fullTest' is YES, then 'g_untestedDecryptionAlgorithms' is reinitialized and then -// all tests are run. -// This implementation of the reference design does not support processing outside -// the framework of a TPM command. As a consequence, this command does not -// complete until all tests are done. Since this can take a long time, the TPM -// will check after each test to see if the command is canceled. If so, then the -// TPM will returned TPM_RC_CANCELLED. To continue with the self-tests, call -// TPM2_SelfTest(fullTest == No) and the TPM will complete the testing. -// Return Type: TPM_RC -// TPM_RC_CANCELED if the command is canceled -LIB_EXPORT -TPM_RC -CryptSelfTest(TPMI_YES_NO fullTest // IN: if full test is required -); - -//*** CryptIncrementalSelfTest() -// This function is used to perform an incremental self-test. This implementation -// will perform the toTest values before returning. That is, it assumes that the -// TPM cannot perform background tasks between commands. -// -// This command may be canceled. If it is, then there is no return result. -// However, this command can be run again and the incremental progress will not -// be lost. -// Return Type: TPM_RC -// TPM_RC_CANCELED processing of this command was canceled -// TPM_RC_TESTING if toTest list is not empty -// TPM_RC_VALUE an algorithm in the toTest list is not implemented -TPM_RC -CryptIncrementalSelfTest(TPML_ALG* toTest, // IN: list of algorithms to be tested - TPML_ALG* toDoList // OUT: list of algorithms needing test -); - -//*** CryptInitializeToTest() -// This function will initialize the data structures for testing all the -// algorithms. This should not be called unless CryptAlgsSetImplemented() has -// been called -void CryptInitializeToTest(void); - -//*** CryptTestAlgorithm() -// Only point of contact with the actual self tests. If a self-test fails, there -// is no return and the TPM goes into failure mode. -// The call to TestAlgorithm uses an algorithm selector and a bit vector. When the -// test is run, the corresponding bit in 'toTest' and in 'g_toTest' is CLEAR. If -// 'toTest' is NULL, then only the bit in 'g_toTest' is CLEAR. -// There is a special case for the call to TestAlgorithm(). When 'alg' is -// ALG_ERROR, TestAlgorithm() will CLEAR any bit in 'toTest' for which it has -// no test. This allows the knowledge about which algorithms have test to be -// accessed through the interface that provides the test. -// Return Type: TPM_RC -// TPM_RC_CANCELED test was canceled -LIB_EXPORT -TPM_RC -CryptTestAlgorithm(TPM_ALG_ID alg, ALGORITHM_VECTOR* toTest); - -#endif // _CRYPT_SELF_TEST_FP_H_ diff --git a/src/tpm2/crypto/openssl/ConsttimeUtils.h b/src/tpm2/crypto/openssl/ConsttimeUtils.h deleted file mode 100644 index 22d8a05ff..000000000 --- a/src/tpm2/crypto/openssl/ConsttimeUtils.h +++ /dev/null @@ -1,100 +0,0 @@ -/********************************************************************************/ -/* */ -/* Constant time debugging helper functions */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* (c) Copyright IBM Corporation, 2020-2025 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ - -#ifndef CONSTTIME_UTILS_H -#define CONSTTIME_UTILS_H - -#include -#include - -#include "BnValues.h" - -#include - -static __inline__ unsigned long long rdtsc() { - unsigned long h, l; - - __asm__ __volatile__ ("rdtsc" : "=a"(l), "=d"(h)); - - return (unsigned long long)l | - ((unsigned long long)h << 32 ); -} - -// Make sure that the given BIGNUM has the given number of expected bytes. -// Skip over any leading zeros the BIGNUM may have. -static inline void assert_ossl_num_bytes(const BIGNUM *a, - unsigned int num_bytes, - int verbose, - const char *caller) { - unsigned char buffer[LARGEST_NUMBER] = { 0, }; - int len, i; - - len = BN_bn2bin(a, buffer); - for (i = 0; i < len; i++) { - if (buffer[i]) - break; - } - len -= i; - if (num_bytes != (unsigned int)len) { - printf("%s: Expected %u bytes but found %d (caller: %s)\n", __func__, num_bytes, len, caller); - } else { - if (verbose) - printf("%s: check passed; num_bytes = %d (caller: %s)\n",__func__, num_bytes, caller); - } - assert(num_bytes == (unsigned int)len); -} - -// Make sure that the bigNum has the expected number of bytes after it was -// converted to an OpenSSL BIGNUM. -static inline void assert_bn_ossl_num_bytes(bigNum tpmb, - unsigned int num_bytes, - int verbose, - const char *caller) { - BIG_INITIALIZED(osslb, tpmb); - - assert_ossl_num_bytes(osslb, num_bytes, verbose, caller); - - BN_free(osslb); -} - -#endif /* CONSTTIME_UTILS_H */ diff --git a/src/tpm2/crypto/openssl/consttime.txt b/src/tpm2/crypto/openssl/consttime.txt deleted file mode 100644 index 6dd8328f2..000000000 --- a/src/tpm2/crypto/openssl/consttime.txt +++ /dev/null @@ -1,76 +0,0 @@ -The following (top level) OpenSSL public BIGNUM functions check for -the BN_FLG_CONSTTIME: - -bn_blind.c: - BN_BLINDING_new() - -bn_exp.c: - BN_exp : must not be set for input bignums -! BN_mod_exp : SHOULD be set for any one of input bignums (only) if m is odd - BN_mod_exp_recp: must NOT be set for input bignums - BN_mod_exp_mont: SHOULD be set for any one of input bignums - BN_mod_exp_mont_word: must NOT be set for input bignums - BN_mod_exp_simple: must NOT bet set for input bignums - -bn_gcd.c: -! BN_mod_inverse: SHOULD be set for any one of input bignums - -bn_lib: - BN_num_bits -! BN_copy - -bn_mont.c: - BN_MONT_CTX_set - -bn.h: -! BN_num_bytes: Calls BN_num_bits - - -Relevant files and functions in the files: -Helpers.c - ComputePrivateExponentD: - - BN_dup: -> BN_copy: YES, BN_FLG_CONSTTIME set by caller on P and Q - - BN_sub: no - - BN_add_word: no - - BN_mod_inverse: YES, DONE - InitOpenSSLRSAPublicKey: - - BN_set_word: no - - BN_bin2bn: no - InitOpenSSLRSAPrivateKey: - - BN_bin2bn: no - - BN_div: -> BN_copy: YES, DONE - - BN_is_zero: no - -TpmToOsslMath: - OsslToTpmBn: - - BN_num_bytes: need not - - BN_bn2bin: -> BN_num_bytes: need not - BigInitialized: - - BN_bin2bn: no - - BN_copy: YES, DONE - BnModMult: - - BN_mul: no - - BN_div: -> BN_copy: ? - BnMult: - - BN_mul: no - BnDiv: - - BN_div: -> BN_copy: ? - BnGcd: /* FUNCTION IS NOT USED */ - - BN_gcd: -> BN_copy, BN_num_bits: YES, DONE - BnModExp: - - BN_mod_exp: YES, DONE - BnModInverse: - - BN_mod_inverse: YES, DONE - - -Elliptic curve signing : - -CryptEccMain.c: - BnEccGenerateKeyPair: - - BnEccModMult: YES, DONE (we have control over random number bnD) - called by BnSignEcSchnorr - called by BnSignEcdsa (if OpenSSL function not used) - -CryptEccSignature.c: - BnEccSignSM2: - - BnEccModMult: YES, DONE (we have control over random number bnK) diff --git a/src/tpm2/crypto/openssl/consttime.txt' b/src/tpm2/crypto/openssl/consttime.txt' deleted file mode 100644 index b66708617..000000000 --- a/src/tpm2/crypto/openssl/consttime.txt' +++ /dev/null @@ -1,58 +0,0 @@ -The following OpenSSL public BIGNUM functions check for the BN_FLG_CONSTTIME: - -bn_blind.c: - BN_BLINDING_new() - -bn_exp.c: - BN_exp : must not be set for input bignums -! BN_mod_exp : SHOULD be set for any one of input bignums (only) if m is odd - BN_mod_exp_recp: must NOT be set for input bignums - BN_mod_exp_mont: SHOULD be set for any one of input bignums - BN_mod_exp_mont_word: must NOT be set for input bignums - BN_mod_exp_simple: must NOT bet set for input bignums - -bn_gcd.c: -! BN_mod_inverse: SHOULD be set for any one of input bignums - -bn_lib: - BN_num_bits -! BN_copy - -bn_mont.c: - BN_MONT_CTX_set - -bn.h: -! BN_num_bytes: Calls BN_num_bits - - -Relevant files and functions in the files: -Helpers.c - - BN_dup: - - BN_sub: - - BN_add_word: - - BN_mod_inverse: yes - - BN_set_word: - - BN_bin2bn: - - BN_div: - - BN_is_zero: - -TpmToOsslMath: - OsslToTpmBn: - - BN_num_bytes: - - BN_bn2bin: - BigInitialized: - - BN_bin2bn: - - BN_copy: - BnModMult: - - BN_mul: - - BN_div: - BnMult: - - BN_mul: - BnDiv: - - BN_div: - BnGcd: - - BN_gcd: - BnModExp: - - BN_mod_exp: YES - BnModInverse: - - BN_mod_inverse: YES diff --git a/src/tpm2/platform_to_tpm_interface.h b/src/tpm2/platform_to_tpm_interface.h deleted file mode 100644 index 71024c99c..000000000 --- a/src/tpm2/platform_to_tpm_interface.h +++ /dev/null @@ -1,72 +0,0 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ - -#ifndef _PLATFORM_TO_TPM_INTERFACE_H_ -#define _PLATFORM_TO_TPM_INTERFACE_H_ - -#include "_TPM_Hash_Data_fp.h" -#include "_TPM_Hash_End_fp.h" -#include "_TPM_Hash_Start_fp.h" -#include "_TPM_Init_fp.h" -#include "ExecCommand_fp.h" -#include "Manufacture_fp.h" -// TODO_RENAME_INC_FOLDER: public refers to the TPM_CoreLib public headers -#include "TpmFail_fp.h" -#endif diff --git a/src/tpm2/tpm_public.h b/src/tpm2/tpm_public.h deleted file mode 100644 index 589552f2a..000000000 --- a/src/tpm2/tpm_public.h +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: BSD-2-Clause - -#include "TpmBuildSwitches.h" -#include "TpmProfile.h" - -#include "VerifyConfiguration.h" -#include "BaseTypes.h" -#include "TPMB.h" -#include "MinMax.h" -#include "tpm_radix.h" -#include "TpmTypes.h" -#include "tpm_debug.h" diff --git a/src/tpm_tpm2_interface.c b/src/tpm_tpm2_interface.c index 89c181159..508a0338b 100644 --- a/src/tpm_tpm2_interface.c +++ b/src/tpm_tpm2_interface.c @@ -44,21 +44,15 @@ #ifndef LIB_EXPORT #define LIB_EXPORT #endif -#include "tpm2/Tpm.h" -#include "tpm2/Manufacture_fp.h" -#include "tpm2/Platform_fp.h" -#include "tpm2/ExecCommand_fp.h" -#include "tpm2/TpmTcpProtocol.h" -#include "tpm2/Simulator_fp.h" -#include "tpm2/_TPM_Hash_Data_fp.h" -#include "tpm2/_TPM_Init_fp.h" -#include "tpm2/StateMarshal.h" -#include "tpm2/PlatformACT.h" -#include "tpm2/PlatformData.h" -#include "tpm2/PlatformInternal.h" -#include "tpm2/Volatile.h" -#include "tpm2/crypto/openssl/ExpDCache_fp.h" -#include "tpm2/platform_failure_mode_fp.h" + +#include "Tpm.h" +#include +#include +#include "PlatformData.h" +#include "PlatformInternal.h" +#include "StateMarshal.h" +#include "Volatile.h" +#include "ExpDCache_fp.h" #define TPM_HAVE_TPM2_DECLARATIONS #include "tpm_nvfile.h" // TPM_NVRAM_Loaddata() diff --git a/src/tpm_tpm2_tis.c b/src/tpm_tpm2_tis.c index 08623eb10..b8bda48e3 100644 --- a/src/tpm_tpm2_tis.c +++ b/src/tpm_tpm2_tis.c @@ -40,15 +40,10 @@ #include -#include "tpm2/Tpm.h" -#include "tpm2/TpmTypes.h" -#include "tpm2/TpmBuildSwitches.h" -#include "tpm2/_TPM_Hash_Start_fp.h" -#include "tpm2/_TPM_Hash_Data_fp.h" -#include "tpm2/_TPM_Hash_End_fp.h" -#include "tpm2/TpmTcpProtocol.h" -#include "tpm2/Platform_fp.h" -#include "tpm2/Simulator_fp.h" +#include "Tpm.h" +#include "TpmTcpProtocol.h" +#include "Platform_fp.h" +#include "Simulator_fp.h" #define TPM_HAVE_TPM2_DECLARATIONS #include "tpm_library_intern.h" diff --git a/tests/Makefile.am b/tests/Makefile.am index 059aab555..3317f2cb7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,6 +13,26 @@ AM_CFLAGS = -I$(top_srcdir)/include $(SANITIZERS) AM_LDFLAGS = -no-undefined $(SANITIZERS) LDADD = $(top_builddir)/src/libtpms.la +HEADER_CFLAGS = \ + -I$(top_srcdir)/include/libtpms \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/tpm2 \ + -I$(top_srcdir)/src/tpm2/crypto/openssl \ + -I$(top_srcdir)/src/tpm2/TPMCmd/Platform/include/ \ + -I$(top_srcdir)/src/tpm2/TPMCmd/Simulator/include/ \ + -I$(top_srcdir)/src/tpm2/TPMCmd/Simulator/include/prototypes \ + -I$(top_srcdir)/src/tpm2/TPMCmd/TpmConfiguration \ + -I$(top_srcdir)/src/tpm2/TPMCmd/tpm/include/ \ + -I$(top_srcdir)/src/tpm2/TPMCmd/tpm/include/private \ + -I$(top_srcdir)/src/tpm2/TPMCmd/tpm/include/private/prototypes/ \ + -I$(top_srcdir)/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/ \ + -I$(top_srcdir)/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/ \ + -I$(top_srcdir)/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum/ \ + -I$(top_srcdir)/src/tpm2/TPMCmd/tpm/cryptolibs/ \ + -I$(top_srcdir)/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/ \ + -I$(top_srcdir)/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include \ + -I$(top_srcdir)/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl + check_PROGRAMS = \ base64decode @@ -42,11 +62,7 @@ endif nvram_offsets_SOURCES = nvram_offsets.c nvram_offsets_CFLAGS = $(AM_CFLAGS) \ - -I$(top_srcdir)/include/libtpms \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/tpm2 \ - -I$(top_srcdir)/src/tpm2/crypto \ - -I$(top_srcdir)/src/tpm2/crypto/openssl \ + $(HEADER_CFLAGS) \ -DTPM_POSIX nvram_offsets_LDFLAGS = $(AM_LDFLAGS) @@ -62,12 +78,8 @@ TESTS += \ object_size_SOURCES = object_size.c object_size_CFLAGS = $(AM_CFLAGS) \ + $(HEADER_CFLAGS) \ -static \ - -I$(top_srcdir)/include/libtpms \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/tpm2 \ - -I$(top_srcdir)/src/tpm2/crypto \ - -I$(top_srcdir)/src/tpm2/crypto/openssl \ -DTPM_POSIX object_size_LDFLAGS = $(AM_LDFLAGS) endif # ENABLE_STATIC_TESTS From ba2c0e2ed6c753f0c025961d77336b804b78cfaf Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 14 Aug 2025 18:12:33 -0400 Subject: [PATCH 45/52] Sync: Fix masking-out of unneeded bits in TpmMath_GetRandomBits Signed-off-by: Stefan Berger --- src/tpm2/TPMCmd/tpm/src/crypt/math/TpmMath_Util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/math/TpmMath_Util.c b/src/tpm2/TPMCmd/tpm/src/crypt/math/TpmMath_Util.c index 8f7da092e..5fc2f3e3f 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/math/TpmMath_Util.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/math/TpmMath_Util.c @@ -105,9 +105,9 @@ LIB_EXPORT BOOL TpmMath_GetRandomBits(BYTE* pBuffer, size_t bits, RAND_STATE* ra // 2 0x03 6 = (8 - 2) % 8 // ... etc ... // 7 0x7F 1 = (8 - 7) % 8 - int excessBits = bits % 8; - static const BYTE mask[8] = {0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f}; // libtpms changed: fix - pBuffer[0] &= mask[excessBits]; // libtpms changed: fix + static const BYTE mask[8] = {0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f}; + int excessBits = bits % 8; + pBuffer[0] = pBuffer[0] & mask[excessBits]; return TRUE; } return FALSE; From a4190b77e0271a2cbf5397370595940ca7c920c8 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 14 Aug 2025 18:23:49 -0400 Subject: [PATCH 46/52] Sync: Fix and extend compile-time testing of NUM_AUTHVALUE_PCR_GROUP Signed-off-by: Stefan Berger --- src/tpm2/TPMCmd/tpm/include/private/Global.h | 2 ++ src/tpm2/TPMCmd/tpm/src/subsystem/PCR.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/tpm2/TPMCmd/tpm/include/private/Global.h b/src/tpm2/TPMCmd/tpm/include/private/Global.h index 80d919d69..9517e08fd 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/Global.h +++ b/src/tpm2/TPMCmd/tpm/include/private/Global.h @@ -1014,12 +1014,14 @@ typedef struct state_clear_data // The set of PCR to be saved on Shutdown(STATE) PCR_SAVE pcrSave; // default reset is 0...0 +# if defined NUM_AUTHVALUE_PCR_GROUP && NUM_AUTHVALUE_PCR_GROUP > 0 // This structure hold the authorization values for those PCR that have an // update authorization. // This implementation only supports a single group of PCR controlled by // authorization. If more are required, then this structure would be changed to // an array. PCR_AUTHVALUE pcrAuthValues; +# endif #ifndef __ACT_DISABLED // libtpms added //***************************************************************************** diff --git a/src/tpm2/TPMCmd/tpm/src/subsystem/PCR.c b/src/tpm2/TPMCmd/tpm/src/subsystem/PCR.c index 9b8f9b551..82032ba35 100644 --- a/src/tpm2/TPMCmd/tpm/src/subsystem/PCR.c +++ b/src/tpm2/TPMCmd/tpm/src/subsystem/PCR.c @@ -17,6 +17,7 @@ //** Includes, Defines, and Data Definitions #define PCR_C #include "Tpm.h" +#include // verify values from pcrstruct.h. not <= because group #0 is reserved // indicating no auth/policy support @@ -59,7 +60,8 @@ BOOL PCRBelongsAuthGroup(TPMI_DH_PCR handle, // IN: handle of PCR pAssert_BOOL(*groupIndex < NUM_AUTHVALUE_PCR_GROUP); return TRUE; } - +#else + NOT_REFERENCED(handle); #endif return FALSE; } @@ -95,6 +97,8 @@ BOOL PCRBelongsPolicyGroup( pAssert_BOOL(*groupIndex < NUM_POLICY_PCR_GROUP); return TRUE; } +#else + NOT_REFERENCED(handle); #endif return FALSE; } @@ -114,6 +118,7 @@ static BOOL PCRBelongsTCBGroup(TPMI_DH_PCR handle // IN: handle of PCR _platPcr__GetPcrInitializationAttributes(pcr); return currentPcrAttributes.doNotIncrementPcrCounter; #else + NOT_REFERENCED(handle); return FALSE; #endif } @@ -137,6 +142,7 @@ BOOL PCRPolicyIsAvailable(TPMI_DH_PCR handle // IN: PCR handle TPM2B_AUTH* PCRGetAuthValue(TPMI_DH_PCR handle // IN: PCR handle ) { +#if defined NUM_AUTHVALUE_PCR_GROUP && NUM_AUTHVALUE_PCR_GROUP > 0 UINT32 groupIndex; if(PCRBelongsAuthGroup(handle, &groupIndex)) @@ -144,6 +150,9 @@ TPM2B_AUTH* PCRGetAuthValue(TPMI_DH_PCR handle // IN: PCR handle return &gc.pcrAuthValues.auth[groupIndex]; } else +#else + NOT_REFERENCED(handle); +#endif { return NULL; } @@ -158,6 +167,7 @@ PCRGetAuthPolicy(TPMI_DH_PCR handle, // IN: PCR handle TPM2B_DIGEST* policy // OUT: policy of PCR ) { +#if defined NUM_AUTHVALUE_PCR_GROUP && NUM_AUTHVALUE_PCR_GROUP > 0 UINT32 groupIndex; if(PCRBelongsPolicyGroup(handle, &groupIndex)) @@ -166,6 +176,9 @@ PCRGetAuthPolicy(TPMI_DH_PCR handle, // IN: PCR handle return gp.pcrPolicies.hashAlg[groupIndex]; } else +#else + NOT_REFERENCED(handle); +#endif { policy->t.size = 0; return TPM_ALG_NULL; @@ -213,7 +226,9 @@ void PCRManufacture(void) } // Store the initial configuration to NV +#if defined NUM_AUTHVALUE_PCR_GROUP && NUM_AUTHVALUE_PCR_GROUP > 0 NV_SYNC_PERSISTENT(pcrPolicies); +#endif NV_SYNC_PERSISTENT(pcrAllocated); return; From ed26e539260f6c55368a2284ce7be0fb1a5d6c6e Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 14 Aug 2025 19:03:43 -0400 Subject: [PATCH 47/52] Sync: Add include to simulator_sysheaders.h Signed-off-by: Stefan Berger --- src/tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h b/src/tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h index 1dbbbc5d2..bcb3a1e26 100644 --- a/src/tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h +++ b/src/tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h @@ -87,6 +87,7 @@ typedef int socklen_t; # include # include # include +# include # include # include // simulate certain windows APIs From 73ecdf1880fb64fd5288c92c33eb1561d1d01eaf Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 21 Jan 2026 11:21:39 -0500 Subject: [PATCH 48/52] tpm2: Split off TDES related parts from TpmToOsslSym.h and adjust licenses Sync the whitespace differences in TpmToOsslSym.h with upstream. Signed-off-by: Stefan Berger --- src/Makefile.am | 1 + .../Ossl/include/Ossl/TpmToOsslSym.h | 96 +++---------------- .../Ossl/include/Ossl/TpmToOsslSymTDES.h | 80 ++++++++++++++++ 3 files changed, 93 insertions(+), 84 deletions(-) create mode 100644 src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSymTDES.h diff --git a/src/Makefile.am b/src/Makefile.am index 3aa1ee800..0021fffcf 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -657,6 +657,7 @@ noinst_HEADERS += \ tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslHash.h \ tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSupport_fp.h \ tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSym.h \ + tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSymTDES.h \ tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum/TpmToTpmBigNumMath.h \ tpm2/TPMCmd/tpm/include/private/LibSupport.h \ tpm2/TPMCmd/tpm/include/tpm_public/tpm_radix.h diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSym.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSym.h index 654d2c05a..90d434a41 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSym.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSym.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Splice the OpenSSL() library into the TPM code. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // @@ -73,30 +15,27 @@ #define SYM_LIB_OSSL #include -#if ALG_TDES -#include -#endif #if ALG_SM4 # if defined(OPENSSL_NO_SM4) || OPENSSL_VERSION_NUMBER < 0x10101010L # error "Current version of OpenSSL doesn't support SM4" -# elif OPENSSL_VERSION_NUMBER >= 0x10200000L -# include -# else +# elif OPENSSL_VERSION_NUMBER >= 0x10200000L +# include +# else // OpenSSL 1.1.1 keeps smX.h headers in the include/crypto directory, // and they do not get installed as part of the libssl package -# define SM4_KEY_SCHEDULE 32 +# define SM4_KEY_SCHEDULE 32 -typedef struct SM4_KEY_st { +typedef struct SM4_KEY_st +{ uint32_t rk[SM4_KEY_SCHEDULE]; } SM4_KEY; -int SM4_set_key(const uint8_t *key, SM4_KEY *ks); +int SM4_set_key(const uint8_t* key, SM4_KEY* ks); void SM4_encrypt(const uint8_t* in, uint8_t* out, const SM4_KEY* ks); void SM4_decrypt(const uint8_t* in, uint8_t* out, const SM4_KEY* ks); -void SM4_final(const SM4_KEY *ks); -# endif // OpenSSL < 1.2 +# endif // OpenSSL < 1.2 #endif // ALG_SM4 #if ALG_CAMELLIA @@ -147,27 +86,16 @@ typedef void (*TpmCryptSetSymKeyCall_t)(const BYTE* in, BYTE* out, void* keySche #define TpmCryptDecryptAES AES_decrypt #define tpmKeyScheduleAES AES_KEY -#define TpmCryptSetEncryptKeyTDES(key, keySizeInBits, schedule) \ - TDES_set_encrypt_key((key), (keySizeInBits), (tpmKeyScheduleTDES *)(schedule)) -#define TpmCryptSetDecryptKeyTDES(key, keySizeInBits, schedule) \ - TDES_set_encrypt_key((key), (keySizeInBits), (tpmKeyScheduleTDES *)(schedule)) - -#define TpmCryptEncryptTDES TDES_encrypt -#define TpmCryptDecryptTDES TDES_decrypt -#define tpmKeyScheduleTDES DES_key_schedule - -#if ALG_TDES // libtpms added begin -#include "TpmToOsslDesSupport_fp.h" -#endif // libtpms added end +#include "TpmToOsslSymTDES.h" // libtpms added //*************************************************************** //** Links to the OpenSSL SM4 code //*************************************************************** // Macros to set up the encryption/decryption key schedules #define TpmCryptSetEncryptKeySM4(key, keySizeInBits, schedule) \ - SM4_set_key((key), (tpmKeyScheduleSM4 *)(schedule)) + SM4_set_key((key), (tpmKeyScheduleSM4*)(schedule)) #define TpmCryptSetDecryptKeySM4(key, keySizeInBits, schedule) \ - SM4_set_key((key), (tpmKeyScheduleSM4 *)(schedule)) + SM4_set_key((key), (tpmKeyScheduleSM4*)(schedule)) // Macros to alias encryption calls to specific algorithms. This should be used // sparingly. diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSymTDES.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSymTDES.h new file mode 100644 index 000000000..5d4abe5f1 --- /dev/null +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSymTDES.h @@ -0,0 +1,80 @@ +/********************************************************************************/ +/* */ +/* Splice the OpenSSL() library into the TPM code. */ +/* Written by Ken Goldman */ +/* IBM Thomas J. Watson Research Center */ +/* */ +/* Licenses and Notices */ +/* */ +/* 1. Copyright Licenses: */ +/* */ +/* - Trusted Computing Group (TCG) grants to the user of the source code in */ +/* this specification (the "Source Code") a worldwide, irrevocable, */ +/* nonexclusive, royalty free, copyright license to reproduce, create */ +/* derivative works, distribute, display and perform the Source Code and */ +/* derivative works thereof, and to grant others the rights granted herein. */ +/* */ +/* - The TCG grants to the user of the other parts of the specification */ +/* (other than the Source Code) the rights to reproduce, distribute, */ +/* display, and perform the specification solely for the purpose of */ +/* developing products based on such documents. */ +/* */ +/* 2. Source Code Distribution Conditions: */ +/* */ +/* - Redistributions of Source Code must retain the above copyright licenses, */ +/* this list of conditions and the following disclaimers. */ +/* */ +/* - Redistributions in binary form must reproduce the above copyright */ +/* licenses, this list of conditions and the following disclaimers in the */ +/* documentation and/or other materials provided with the distribution. */ +/* */ +/* 3. Disclaimers: */ +/* */ +/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ +/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ +/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ +/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ +/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ +/* information on specification licensing rights available through TCG */ +/* membership agreements. */ +/* */ +/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ +/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ +/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ +/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ +/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ +/* */ +/* - Without limitation, TCG and its members and licensors disclaim all */ +/* liability, including liability for infringement of any proprietary */ +/* rights, relating to use of information in this specification and to the */ +/* implementation of this specification, and TCG disclaims all liability for */ +/* cost of procurement of substitute goods or services, lost profits, loss */ +/* of use, loss of data or any incidental, consequential, direct, indirect, */ +/* or special damages, whether under contract, tort, warranty or otherwise, */ +/* arising in any way out of use or reliance upon this specification or any */ +/* information herein. */ +/* */ +/* (c) Copyright IBM Corp. and others, 2016 - 2026 */ +/* */ +/********************************************************************************/ + +#ifndef TPMTOOSSLSYMTDES_H +#define TPMTOOSSLSYMTDES_H + +#include + +#define TpmCryptSetEncryptKeyTDES(key, keySizeInBits, schedule) \ + TDES_set_encrypt_key((key), (keySizeInBits), (tpmKeyScheduleTDES *)(schedule)) +#define TpmCryptSetDecryptKeyTDES(key, keySizeInBits, schedule) \ + TDES_set_encrypt_key((key), (keySizeInBits), (tpmKeyScheduleTDES *)(schedule)) + +#define TpmCryptEncryptTDES TDES_encrypt +#define TpmCryptDecryptTDES TDES_decrypt +#define tpmKeyScheduleTDES DES_key_schedule + +#if ALG_TDES +# include "TpmToOsslDesSupport_fp.h" +#endif + +#endif /* TPMTOOSSLSYMTDES_H */ + From 7e579e0d62ec904cd2bf5d66ba66aeac55b937a1 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 21 Jan 2026 12:15:45 -0500 Subject: [PATCH 49/52] Sync: Sync minor changes in several files with upstream Signed-off-by: Stefan Berger --- .../prototypes/platform_public_interface.h | 8 ++++- .../include/prototypes/Simulator_fp.h | 9 +++-- src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c | 2 +- .../TpmConfiguration/TpmProfile_Common.h | 8 +++-- .../VendorCommands/VendorCommandList.h | 4 +++ .../common/include/EccConstantData.inl | 34 ------------------- .../tpm_to_platform_interface.h | 2 +- .../TPMCmd/tpm/include/private/CryptHash.h | 4 +-- .../TPMCmd/tpm/include/private/CryptSym.h | 8 ++--- .../include/private/prototypes/CryptRsa_fp.h | 5 --- .../TPMCmd/tpm/include/tpm_public/GpMacros.h | 2 -- .../TPMCmd/tpm/include/tpm_public/TpmTypes.h | 3 +- .../include/tpm_public/VerifyConfiguration.h | 6 ++++ .../TPMCmd/tpm/include/tpm_public/tpm_debug.h | 1 + .../src/command/NVStorage/NV_ReadPublic2.c | 1 - src/tpm2/TPMCmd/tpm/src/crypt/CryptSym.c | 1 - src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c | 1 - .../src/crypt/ecc/TpmEcc_Signature_ECDAA.c | 1 - .../src/crypt/ecc/TpmEcc_Signature_Schnorr.c | 1 - src/tpm2/TPMCmd/tpm/src/subsystem/Session.c | 2 +- src/tpm2/TPMCmd/tpm/src/support/PropertyCap.c | 16 +++------ 21 files changed, 42 insertions(+), 77 deletions(-) diff --git a/src/tpm2/TPMCmd/Platform/include/prototypes/platform_public_interface.h b/src/tpm2/TPMCmd/Platform/include/prototypes/platform_public_interface.h index 94fc5d443..51b947a6e 100644 --- a/src/tpm2/TPMCmd/Platform/include/prototypes/platform_public_interface.h +++ b/src/tpm2/TPMCmd/Platform/include/prototypes/platform_public_interface.h @@ -59,6 +59,7 @@ /********************************************************************************/ + // This file contains the interface into the platform layer from external callers. // External callers are expected to be implementation specific, and may be a simulator // or some other implementation @@ -68,8 +69,13 @@ #include -//** From Cancel.c +#if ALLOW_FORCE_FAILURE_MODE +// From Failure.c +// allow simulator to force the TPM into failure mode. +LIB_EXPORT void _plat__SetForceFailureMode(); +#endif +//** From Cancel.c // Set cancel flag. LIB_EXPORT void _plat__SetCancel(void); diff --git a/src/tpm2/TPMCmd/Simulator/include/prototypes/Simulator_fp.h b/src/tpm2/TPMCmd/Simulator/include/prototypes/Simulator_fp.h index f48191589..509fceadc 100644 --- a/src/tpm2/TPMCmd/Simulator/include/prototypes/Simulator_fp.h +++ b/src/tpm2/TPMCmd/Simulator/include/prototypes/Simulator_fp.h @@ -80,7 +80,7 @@ bool PlatformServer(SOCKET s); //*** PlatformSvcRoutine() // This function is called to set up the socket interfaces to listen for // commands. -int PlatformSvcRoutine(LPVOID port); +DWORD WINAPI PlatformSvcRoutine(LPVOID port); //*** PlatformSignalService() // This function starts a new thread waiting for platform signals. @@ -88,13 +88,13 @@ int PlatformSvcRoutine(LPVOID port); // received. // If PickPorts is true, the server finds the next available port if the specified // port was unavailable. -int PlatformSignalService(int *PortNumberPlatform); +int PlatformSignalService(int PortNumber, bool PickPorts); //*** RegularCommandService() // This function services regular commands. // If PickPorts is true, the server finds the next available port if the specified // port was unavailable. -int RegularCommandService(int *PortNumber); +int RegularCommandService(int PortNumber, bool PickPorts); //*** StartTcpServer() // This is the main entry-point to the TCP server. The server listens on the port @@ -103,8 +103,7 @@ int RegularCommandService(int *PortNumber); // port was unavailable. // // Note that there is no way to specify the network interface in this implementation. -int StartTcpServer(int *PortNumber, int *PortNumberPlatform); - +int StartTcpServer(int PortNumber, bool PickPorts); //*** ReadBytes() // This function reads the indicated number of bytes ('NumBytes') into buffer diff --git a/src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c b/src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c index 83dc6fcc0..67401e0af 100644 --- a/src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c +++ b/src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c @@ -126,7 +126,7 @@ void _rpc__Signal_PowerOff(void) void _rpc__ForceFailureMode(void) { #if SIMULATION - SetForceFailureMode(); + _plat__SetForceFailureMode(); #endif return; } diff --git a/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Common.h b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Common.h index 289a65c0c..9bf1c1292 100644 --- a/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Common.h +++ b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Common.h @@ -79,10 +79,10 @@ #define CAMELLIA_192 (YES * ALG_CAMELLIA) /* since libtpms v0.10 stateFormatLevel 4 */ #define CAMELLIA_256 (YES * ALG_CAMELLIA) -#define ALG_TDES ALG_YES /* libtpms enabled */ +#define ALG_TDES ALG_YES /* libtpms added begin; enabled */ #define TDES_128 (ALG_TDES && YES) -#define TDES_192 (ALG_TDES && YES) +#define TDES_192 (ALG_TDES && YES) /* libtpms added end */ // must be yes if any above are yes. #define ALG_SYMCIPHER (ALG_AES || ALG_SM4 || ALG_CAMELLIA) @@ -152,7 +152,7 @@ #define ALG_SHA256 ALG_YES #define ALG_SHA256_192 ALG_NO #define ALG_SHA384 ALG_YES -#define ALG_SHA512 ALG_YES +#define ALG_SHA512 ALG_YES // libtpms: enabled #define ALG_SHA3_256 ALG_NO #define ALG_SHA3_384 ALG_NO @@ -271,6 +271,8 @@ //*********************************************** // Defines controlling secure channel functionality //*********************************************** +// This flag enables support for PolicyTransportSPDM. +// See CC_PolicyTransportSPDM. #define SEC_CHANNEL_SUPPORT NO // libtpms: NO #endif // _TPM_PROFILE_COMMON_H_ diff --git a/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/VendorCommandList.h b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/VendorCommandList.h index b5ccc9a1e..15cd8708b 100644 --- a/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/VendorCommandList.h +++ b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/VendorCommands/VendorCommandList.h @@ -1,5 +1,9 @@ // SPDX-License-Identifier: BSD-2-Clause +// This file defines any Vendor command IDs, and must also define the +// VENDOR_COMMAND_ARRAY_COUNT which is consumed by the CoreLibrary. +// This file is included inside TpmProfile_CommandList.h and therefore +// has access to CC_YES and CC_NO for turning commands on and off. #ifndef _TPM_PROFILE_COMMAND_LIST_H_ # error This file should be included only within TpmProfile_CommandList.h diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/EccConstantData.inl b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/EccConstantData.inl index e444b66b0..e5093dd30 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/EccConstantData.inl +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/EccConstantData.inl @@ -58,40 +58,6 @@ /* */ /********************************************************************************/ -/* Microsoft Reference Implementation for TPM 2.0 - * - * The copyright in this software is being made available under the BSD License, - * included below. This software may be subject to other third party and - * contributor rights, including patent rights, and no such rights are granted - * under this license. - * - * Copyright (c) Microsoft Corporation - * - * All rights reserved. - * - * BSD License - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or - * other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS"" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ // This file contains the ECC curve data. The data is contained in macros so this // file can be included in other format-specific header files that reformat the diff --git a/src/tpm2/TPMCmd/tpm/include/platform_interface/tpm_to_platform_interface.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/tpm_to_platform_interface.h index 40bcd6608..8f44de363 100644 --- a/src/tpm2/TPMCmd/tpm/include/platform_interface/tpm_to_platform_interface.h +++ b/src/tpm2/TPMCmd/tpm/include/platform_interface/tpm_to_platform_interface.h @@ -86,7 +86,7 @@ uint64_t ClockGetTime(clockid_t clk_id); // libtpms: added end //** From DebugHelpers.c - + #if CERTIFYX509_DEBUG #if 0 // libtpms: added diff --git a/src/tpm2/TPMCmd/tpm/include/private/CryptHash.h b/src/tpm2/TPMCmd/tpm/include/private/CryptHash.h index 69a71610f..9e20e5688 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/CryptHash.h +++ b/src/tpm2/TPMCmd/tpm/include/private/CryptHash.h @@ -117,9 +117,9 @@ typedef union #if HASH_ALIGNMENT == 8 uint64_t align; #else -#if defined(__x86_64__) +#if defined(__x86_64__) // libtpms added begin # error Wrong HASH_ALIGNMENT -#endif +#endif // libtpms added end uint32_t align; #endif } ANY_HASH_STATE; diff --git a/src/tpm2/TPMCmd/tpm/include/private/CryptSym.h b/src/tpm2/TPMCmd/tpm/include/private/CryptSym.h index 31009eab6..4cd6bb936 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/CryptSym.h +++ b/src/tpm2/TPMCmd/tpm/include/private/CryptSym.h @@ -83,11 +83,11 @@ #else # define IF_IMPLEMENTED_CAMELLIA(op) #endif -#if ALG_TDES +#if ALG_TDES // libtpms added begin # define IF_IMPLEMENTED_TDES(op) op(TDES, tdes) #else # define IF_IMPLEMENTED_TDES(op) -#endif +#endif // libtpms added end #define FOR_EACH_SYM(op) \ IF_IMPLEMENTED_AES(op) \ @@ -112,9 +112,9 @@ typedef union tpmCryptKeySchedule_t { uint64_t alignment; #else uint32_t alignment; -# if defined(__x86_64__) +# if defined(__x86_64__) // libtpms added begin # error Bad SYMMETRIC_ALIGNMENT -# endif +# endif // libtpms added end #endif } tpmCryptKeySchedule_t; diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRsa_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRsa_fp.h index e9f59c266..e1dd80b11 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRsa_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRsa_fp.h @@ -58,11 +58,6 @@ /* */ /********************************************************************************/ -/*(Auto-generated) - * Created by TpmPrototypes; Version 3.0 July 18, 2017 - * Date: Apr 2, 2019 Time: 03:18:00PM - */ - #ifndef _CRYPT_RSA_FP_H_ #define _CRYPT_RSA_FP_H_ diff --git a/src/tpm2/TPMCmd/tpm/include/tpm_public/GpMacros.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/GpMacros.h index 38b361bd9..1f316af91 100644 --- a/src/tpm2/TPMCmd/tpm/include/tpm_public/GpMacros.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/GpMacros.h @@ -362,8 +362,6 @@ goto Error; \ } while(0) -#include "MinMax.h" - #ifndef IsOdd # define IsOdd(a) (((a) & 1) != 0) #endif diff --git a/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmTypes.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmTypes.h index c79583954..9decf0580 100644 --- a/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmTypes.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmTypes.h @@ -993,6 +993,7 @@ typedef UINT32 TPMA_ALGORITHM; typedef UINT32 TPMA_OBJECT; #define TPMA_OBJECT_fixedTPM (TPMA_OBJECT)(1 << 1) #define TPMA_OBJECT_stClear (TPMA_OBJECT)(1 << 2) +#define TPMA_OBJECT_fixedFirmware (TPMA_OBJECT)(1 << 3) #define TPMA_OBJECT_fixedParent (TPMA_OBJECT)(1 << 4) #define TPMA_OBJECT_sensitiveDataOrigin (TPMA_OBJECT)(1 << 5) #define TPMA_OBJECT_userWithAuth (TPMA_OBJECT)(1 << 6) @@ -1778,7 +1779,7 @@ typedef struct TPM2B_AUTH hmac; } TPMS_AUTH_RESPONSE; -typedef TPM_KEY_BITS TPMI_TDES_KEY_BITS; +typedef TPM_KEY_BITS TPMI_TDES_KEY_BITS; // libtpms added typedef TPM_KEY_BITS TPMI_AES_KEY_BITS; // (Part 2: Structures) typedef TPM_KEY_BITS TPMI_SM4_KEY_BITS; // (Part 2: Structures) typedef TPM_KEY_BITS TPMI_CAMELLIA_KEY_BITS; // (Part 2: Structures) diff --git a/src/tpm2/TPMCmd/tpm/include/tpm_public/VerifyConfiguration.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/VerifyConfiguration.h index e9f324a28..31e37986d 100644 --- a/src/tpm2/TPMCmd/tpm/include/tpm_public/VerifyConfiguration.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/VerifyConfiguration.h @@ -95,4 +95,10 @@ MUST_BE_0_OR_1(VENDOR_PERMANENT_AUTH_ENABLED); # endif #endif +MUST_BE_0_OR_1(SEC_CHANNEL_SUPPORT); +MUST_BE_0_OR_1(CC_PolicyTransportSPDM); +#if SEC_CHANNEL_SUPPORT != CC_PolicyTransportSPDM +# error SEC_CHANNEL_SUPPORT and CC_PolicyTransportSPDM must have the same value +#endif + #endif // _VERIFY_CONFIGURATION_H diff --git a/src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_debug.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_debug.h index 009463890..3337e6d76 100644 --- a/src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_debug.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/tpm_debug.h @@ -1,5 +1,6 @@ // SPDX-License-Identifier: BSD-2-Clause + #ifndef _TPM_DEBUG_H_ #define _TPM_DEBUG_H_ diff --git a/src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic2.c b/src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic2.c index b47b26139..1e0560e56 100644 --- a/src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic2.c +++ b/src/tpm2/TPMCmd/tpm/src/command/NVStorage/NV_ReadPublic2.c @@ -45,4 +45,3 @@ TPM2_NV_ReadPublic2(NV_ReadPublic2_In* in, // IN: input parameter list } #endif // CC_NV_ReadPublic2 - diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/CryptSym.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptSym.c index 1a1dbf3cd..dd3533a56 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/CryptSym.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/CryptSym.c @@ -45,7 +45,6 @@ BOOL CryptSymStartup(void) // Return Type: INT16 // <= 0 cipher not supported // > 0 the cipher block size in bytes - LIB_EXPORT INT16 CryptGetSymmetricBlockSize( TPM_ALG_ID symmetricAlg, // IN: the symmetric algorithm UINT16 keySizeInBits // IN: the key size diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c index a88e9882b..ee29082a5 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c @@ -1369,7 +1369,6 @@ BOOL CryptIsAsymSignScheme(TPMI_ALG_PUBLIC publicType, // IN: Type of the # endif switch(scheme) { - // Support for ECDSA is required for ECC case TPM_ALG_ECDSA: # if ALG_ECDAA // ECDAA is optional case TPM_ALG_ECDAA: diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_ECDAA.c b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_ECDAA.c index 7e6fadfc9..db171ccf5 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_ECDAA.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_ECDAA.c @@ -136,7 +136,6 @@ TPM_RC TpmEcc_SignEcdaa( CryptDigestUpdate2B(&state, &digest->b); CryptHashEnd2B(&state, &T.b); TpmMath_IntFrom2B(bnT, &T.b); - // libtpms: Note: T is NOT a concern for constant-timeness // Watch out for the name collisions in this call!! retVal = TpmEcc_SchnorrCalculateS( bnS, diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Schnorr.c b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Schnorr.c index 9c6733268..ffdca59a2 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Schnorr.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Schnorr.c @@ -148,7 +148,6 @@ TPM_RC TpmEcc_SignEcSchnorr( SchnorrReduce(e, order); // Convert hash to number TpmMath_IntFrom2B(bnR, e); - // libtpms: Note: e is NOT a concern for constant-timeness // Do the Schnorr computation retVal = TpmEcc_SchnorrCalculateS( bnS, bnK, bnR, bnD, ExtEcc_CurveGetOrder(ExtEcc_CurveGetCurveId(E))); diff --git a/src/tpm2/TPMCmd/tpm/src/subsystem/Session.c b/src/tpm2/TPMCmd/tpm/src/subsystem/Session.c index 1b45a3649..f13308816 100644 --- a/src/tpm2/TPMCmd/tpm/src/subsystem/Session.c +++ b/src/tpm2/TPMCmd/tpm/src/subsystem/Session.c @@ -643,7 +643,7 @@ SessionContextLoad(SESSION_BUF* session, // IN: session structure from saved co break; // if no spot found, then this is an internal error - pAssert(slotIndex < MAX_LOADED_SESSIONS); + pAssert_RC(slotIndex < MAX_LOADED_SESSIONS); // libtpms: besides the s_freeSessionSlots guard add another array index guard if (slotIndex >= MAX_LOADED_SESSIONS) { // libtpms added begin; cppcheck diff --git a/src/tpm2/TPMCmd/tpm/src/support/PropertyCap.c b/src/tpm2/TPMCmd/tpm/src/support/PropertyCap.c index 2febd5fdb..1a36751f9 100644 --- a/src/tpm2/TPMCmd/tpm/src/support/PropertyCap.c +++ b/src/tpm2/TPMCmd/tpm/src/support/PropertyCap.c @@ -292,10 +292,7 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property case TPM_PT_TOTAL_COMMANDS: // total number of commands implemented in the TPM { -#if COMPRESSED_LISTS // libtpms changed begin - (*value) = RuntimeCommandsCountEnabled(&g_RuntimeProfile.RuntimeCommands); // libtpms changed: was COMMAND_COUNT -#else - COMMAND_INDEX commandIndex; + COMMAND_INDEX commandIndex; // libtpms changed begin *value = 0; // scan all implemented commands @@ -304,17 +301,13 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property commandIndex = GetNextCommandIndex(commandIndex)) { (*value)++; // count of all implemented - } -#endif // libtpms changed end + } // libtpms changed end break; } case TPM_PT_LIBRARY_COMMANDS: // number of commands from the TPM library that are implemented { -#if COMPRESSED_LISTS // libtpms changed begin - *value = RuntimeCommandsCountEnabled(&g_RuntimeProfile.RuntimeCommands); // libtpms changed: was LIBRARY_COMMAND_ARRAY_SIZE -#else - COMMAND_INDEX commandIndex; + COMMAND_INDEX commandIndex; // libtpms changed begin *value = 0; // scan all implemented commands @@ -323,8 +316,7 @@ static BOOL TPMPropertyIsDefined(TPM_PT property, // IN: property commandIndex = GetNextCommandIndex(commandIndex)) { (*value)++; - } -#endif // libtpms changed end + } // libtpms changed end break; } case TPM_PT_VENDOR_COMMANDS: From b5228b0485e996ee3e909ab9e4c99d1198c5d6bf Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 21 Jan 2026 15:27:06 -0500 Subject: [PATCH 50/52] Sync: Move many files to BSD-2-Clause license Move many files to the BSD-2-clause license that either - have no modifications in them at all - where all modifictions are from 'me' - where I have permission to move the modifications by 3rd parties under the new license Signed-off-by: Stefan Berger --- src/tpm2/BackwardsCompatibility.h | 40 +-------- src/tpm2/BackwardsCompatibilityBitArray.c | 40 +-------- src/tpm2/BackwardsCompatibilityBitArray.h | 40 +-------- src/tpm2/BackwardsCompatibilityObject.c | 40 +-------- src/tpm2/BackwardsCompatibilityObject.h | 40 +-------- src/tpm2/LibtpmsCallbacks.c | 40 +-------- src/tpm2/LibtpmsCallbacks.h | 40 +-------- src/tpm2/NVMarshal.c | 40 +-------- src/tpm2/NVMarshal.h | 40 +-------- src/tpm2/RuntimeAlgorithm.c | 43 +--------- src/tpm2/RuntimeAlgorithm_fp.h | 43 +--------- src/tpm2/RuntimeAttributes.c | 43 +--------- src/tpm2/RuntimeAttributes_fp.h | 43 +--------- src/tpm2/RuntimeCommands.c | 43 +--------- src/tpm2/RuntimeCommands_fp.h | 43 +--------- src/tpm2/RuntimeProfile.c | 43 +--------- src/tpm2/RuntimeProfile_fp.h | 43 +--------- src/tpm2/StateMarshal.c | 41 +-------- src/tpm2/StateMarshal.h | 40 +-------- .../TPMCmd/Platform/include/PlatformClock.h | 61 +------------- .../Platform/include/PlatformInternal.h | 2 +- .../prototypes/platform_public_interface.h | 61 +------------- src/tpm2/TPMCmd/Platform/src/Cancel.c | 61 +------------- src/tpm2/TPMCmd/Platform/src/Entropy.c | 61 +------------- src/tpm2/TPMCmd/Platform/src/ExtraData.c | 60 +------------- src/tpm2/TPMCmd/Platform/src/LocalityPlat.c | 61 +------------- src/tpm2/TPMCmd/Platform/src/PPPlat.c | 61 +------------- src/tpm2/TPMCmd/Platform/src/PlatformACT.c | 61 +------------- src/tpm2/TPMCmd/Platform/src/PlatformData.c | 61 +------------- src/tpm2/TPMCmd/Platform/src/PowerPlat.c | 61 +------------- src/tpm2/TPMCmd/Platform/src/Unique.c | 60 +------------- src/tpm2/TPMCmd/Platform/src/VendorInfo.c | 60 +------------- .../include/prototypes/Simulator_fp.h | 60 +------------- src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c | 60 +------------- .../TPMCmd/Simulator/src/simulatorPrivate.h | 57 +------------ .../Simulator/src/simulator_sysheaders.h | 60 +------------- .../TpmConfiguration/TpmProfile_Misc.h | 60 +------------- .../Vendor_TCG_Test.c | 1 + .../EccRef/TpmEcc_Signature_ECDSA.c | 62 +------------- .../TPMCmd/tpm/cryptolibs/Ossl/ExpDCache.c | 43 +--------- src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/Helpers.c | 43 +--------- .../tpm/cryptolibs/Ossl/TpmToOsslSupport.c | 60 +------------- .../tpm/cryptolibs/Ossl/include/BnOssl.h | 60 +------------- .../Ossl/include/Ossl/BnToOsslMath.h | 60 +------------- .../Ossl/include/Ossl/BnToOsslMath_fp.h | 60 +------------- .../Ossl/include/Ossl/ExpDCache_fp.h | 43 +--------- .../cryptolibs/Ossl/include/Ossl/Helpers_fp.h | 42 +--------- .../Ossl/include/Ossl/TpmToOsslSupport_fp.h | 60 +------------- .../TPMCmd/tpm/cryptolibs/RsaRef/PrimeData.c | 60 +------------- .../tpm/cryptolibs/TpmBigNum/BnMemory.c | 61 +------------- .../tpm/cryptolibs/TpmBigNum/TpmBigNum.h | 60 +------------- .../cryptolibs/TpmBigNum/TpmBigNumThunks.c | 60 +------------- .../TpmBigNum/include/BnConvert_fp.h | 60 +------------- .../cryptolibs/TpmBigNum/include/BnMath_fp.h | 60 +------------- .../TpmBigNum/include/BnMemory_fp.h | 60 +------------- .../TpmBigNum/include/BnSupport_Interface.h | 60 +------------- .../cryptolibs/TpmBigNum/include/BnUtil_fp.h | 60 +------------- .../include/TpmBigNum/TpmToTpmBigNumMath.h | 60 +------------- .../common/include/CryptoInterface.h | 38 +-------- .../common/include/EccConstantData.inl | 60 +------------- .../common/include/MathLibraryInterface.h | 60 +------------- .../include/platform_interface/pcrstruct.h | 60 +------------- .../prototypes/Manufacture_fp.h | 61 +------------- .../prototypes/_TPM_Init_fp.h | 61 +------------- .../prototypes/platform_pcr_fp.h | 60 +------------- .../TPMCmd/tpm/include/private/CryptSym.h | 60 +------------- .../TPMCmd/tpm/include/private/CryptTest.h | 60 +------------- .../TPMCmd/tpm/include/private/EccTestData.h | 61 +------------- .../TPMCmd/tpm/include/private/HashTestData.h | 61 +------------- .../TPMCmd/tpm/include/private/KdfTestData.h | 61 +------------- .../TPMCmd/tpm/include/private/LibSupport.h | 60 +------------- src/tpm2/TPMCmd/tpm/include/private/Marshal.h | 61 +------------- src/tpm2/TPMCmd/tpm/include/private/NV.h | 61 +------------- .../TPMCmd/tpm/include/private/RsaTestData.h | 61 +------------- .../TPMCmd/tpm/include/private/SelfTest.h | 60 +------------- .../tpm/include/private/SymmetricTest.h | 60 +------------- .../tpm/include/private/SymmetricTestData.h | 60 +------------- src/tpm2/TPMCmd/tpm/include/private/Tpm.h | 60 +------------- src/tpm2/TPMCmd/tpm/include/private/X509.h | 61 +------------- .../private/prototypes/ACT_SetTimeout_fp.h | 61 +------------- .../include/private/prototypes/ACT_spt_fp.h | 60 +------------- .../prototypes/ActivateCredential_fp.h | 61 +------------- .../private/prototypes/AlgorithmCap_fp.h | 60 +------------- .../private/prototypes/AlgorithmTests_fp.h | 60 +------------- .../private/prototypes/Attest_spt_fp.h | 61 +------------- .../tpm/include/private/prototypes/Bits_fp.h | 61 +------------- .../private/prototypes/CertifyCreation_fp.h | 61 +------------- .../private/prototypes/CertifyX509_fp.h | 61 +------------- .../include/private/prototypes/Certify_fp.h | 61 +------------- .../include/private/prototypes/ChangeEPS_fp.h | 61 +------------- .../include/private/prototypes/ChangePPS_fp.h | 61 +------------- .../private/prototypes/ClearControl_fp.h | 61 +------------- .../tpm/include/private/prototypes/Clear_fp.h | 61 +------------- .../private/prototypes/ClockRateAdjust_fp.h | 61 +------------- .../include/private/prototypes/ClockSet_fp.h | 61 +------------- .../private/prototypes/CommandAudit_fp.h | 60 +------------- .../prototypes/CommandCodeAttributes_fp.h | 1 + .../private/prototypes/CommandDispatcher_fp.h | 61 +------------- .../include/private/prototypes/Commit_fp.h | 61 +------------- .../private/prototypes/ContextLoad_fp.h | 61 +------------- .../private/prototypes/ContextSave_fp.h | 61 +------------- .../private/prototypes/Context_spt_fp.h | 60 +------------- .../private/prototypes/CreateLoaded_fp.h | 61 +------------- .../private/prototypes/CreatePrimary_fp.h | 61 +------------- .../include/private/prototypes/Create_fp.h | 61 +------------- .../include/private/prototypes/CryptCmac_fp.h | 60 +------------- .../private/prototypes/CryptEccCrypt_fp.h | 61 +------------- .../prototypes/CryptEccKeyExchange_fp.h | 60 +------------- .../private/prototypes/CryptEccMain_fp.h | 60 +------------- .../private/prototypes/CryptEccSignature_fp.h | 60 +------------- .../private/prototypes/CryptPrimeSieve_fp.h | 61 +------------- .../private/prototypes/CryptPrime_fp.h | 60 +------------- .../include/private/prototypes/CryptRand_fp.h | 61 +------------- .../include/private/prototypes/CryptRsa_fp.h | 60 +------------- .../private/prototypes/CryptSelfTest_fp.h | 61 +------------- .../include/private/prototypes/CryptSmac_fp.h | 61 +------------- .../include/private/prototypes/CryptSym_fp.h | 61 +------------- .../tpm/include/private/prototypes/DA_fp.h | 61 +------------- .../prototypes/DictionaryAttackLockReset_fp.h | 61 +------------- .../DictionaryAttackParameters_fp.h | 61 +------------- .../include/private/prototypes/Duplicate_fp.h | 61 +------------- .../private/prototypes/ECC_Decrypt_fp.h | 61 +------------- .../private/prototypes/ECC_Encrypt_fp.h | 61 +------------- .../private/prototypes/ECC_Parameters_fp.h | 61 +------------- .../private/prototypes/ECDH_KeyGen_fp.h | 61 +------------- .../include/private/prototypes/ECDH_ZGen_fp.h | 61 +------------- .../private/prototypes/EC_Ephemeral_fp.h | 61 +------------- .../private/prototypes/EncryptDecrypt2_fp.h | 61 +------------- .../private/prototypes/EncryptDecrypt_fp.h | 61 +------------- .../prototypes/EncryptDecrypt_spt_fp.h | 61 +------------- .../include/private/prototypes/Entity_fp.h | 61 +------------- .../prototypes/EventSequenceComplete_fp.h | 61 +------------- .../private/prototypes/EvictControl_fp.h | 61 +------------- .../private/prototypes/FlushContext_fp.h | 61 +------------- .../private/prototypes/GetCapability_fp.h | 61 +------------- .../prototypes/GetCommandAuditDigest_fp.h | 61 +------------- .../include/private/prototypes/GetRandom_fp.h | 61 +------------- .../prototypes/GetSessionAuditDigest_fp.h | 61 +------------- .../private/prototypes/GetTestResult_fp.h | 61 +------------- .../include/private/prototypes/GetTime_fp.h | 61 +------------- .../private/prototypes/HMAC_Start_fp.h | 61 +------------- .../tpm/include/private/prototypes/HMAC_fp.h | 61 +------------- .../include/private/prototypes/Handle_fp.h | 60 +------------- .../private/prototypes/HashSequenceStart_fp.h | 61 +------------- .../tpm/include/private/prototypes/Hash_fp.h | 61 +------------- .../prototypes/HierarchyChangeAuth_fp.h | 61 +------------- .../private/prototypes/HierarchyControl_fp.h | 61 +------------- .../include/private/prototypes/Hierarchy_fp.h | 60 +------------- .../include/private/prototypes/Import_fp.h | 61 +------------- .../prototypes/IncrementalSelfTest_fp.h | 61 +------------- .../private/prototypes/LoadExternal_fp.h | 61 +------------- .../tpm/include/private/prototypes/Load_fp.h | 61 +------------- .../include/private/prototypes/Locality_fp.h | 61 +------------- .../include/private/prototypes/MAC_Start_fp.h | 61 +------------- .../tpm/include/private/prototypes/MAC_fp.h | 61 +------------- .../private/prototypes/MakeCredential_fp.h | 61 +------------- .../include/private/prototypes/Marshal_fp.h | 82 +++++++----------- .../private/prototypes/MathOnByteBuffers_fp.h | 60 +------------- .../include/private/prototypes/Memory_fp.h | 61 +------------- .../private/prototypes/NV_Certify_fp.h | 61 +------------- .../private/prototypes/NV_ChangeAuth_fp.h | 61 +------------- .../private/prototypes/NV_DefineSpace2_fp.h | 60 +------------- .../private/prototypes/NV_DefineSpace_fp.h | 61 +------------- .../include/private/prototypes/NV_Extend_fp.h | 61 +------------- .../prototypes/NV_GlobalWriteLock_fp.h | 61 +------------- .../private/prototypes/NV_Increment_fp.h | 61 +------------- .../private/prototypes/NV_ReadLock_fp.h | 61 +------------- .../private/prototypes/NV_ReadPublic2_fp.h | 60 +------------- .../private/prototypes/NV_ReadPublic_fp.h | 61 +------------- .../include/private/prototypes/NV_Read_fp.h | 61 +------------- .../private/prototypes/NV_SetBits_fp.h | 61 +------------- .../prototypes/NV_UndefineSpaceSpecial_fp.h | 61 +------------- .../private/prototypes/NV_UndefineSpace_fp.h | 61 +------------- .../private/prototypes/NV_WriteLock_fp.h | 61 +------------- .../include/private/prototypes/NV_Write_fp.h | 61 +------------- .../private/prototypes/NvReserved_fp.h | 61 +------------- .../private/prototypes/ObjectChangeAuth_fp.h | 61 +------------- .../private/prototypes/PCR_Allocate_fp.h | 61 +------------- .../include/private/prototypes/PCR_Event_fp.h | 61 +------------- .../private/prototypes/PCR_Extend_fp.h | 61 +------------- .../include/private/prototypes/PCR_Read_fp.h | 61 +------------- .../include/private/prototypes/PCR_Reset_fp.h | 61 +------------- .../private/prototypes/PCR_SetAuthPolicy_fp.h | 61 +------------- .../private/prototypes/PCR_SetAuthValue_fp.h | 61 +------------- .../private/prototypes/PP_Commands_fp.h | 61 +------------- .../tpm/include/private/prototypes/PP_fp.h | 60 +------------- .../private/prototypes/PolicyAuthValue_fp.h | 61 +------------- .../private/prototypes/PolicyAuthorizeNV_fp.h | 61 +------------- .../private/prototypes/PolicyAuthorize_fp.h | 61 +------------- .../private/prototypes/PolicyCapability_fp.h | 60 +------------- .../private/prototypes/PolicyCommandCode_fp.h | 61 +------------- .../prototypes/PolicyCounterTimer_fp.h | 61 +------------- .../private/prototypes/PolicyCpHash_fp.h | 61 +------------- .../prototypes/PolicyDuplicationSelect_fp.h | 61 +------------- .../private/prototypes/PolicyGetDigest_fp.h | 61 +------------- .../private/prototypes/PolicyLocality_fp.h | 61 +------------- .../include/private/prototypes/PolicyNV_fp.h | 61 +------------- .../private/prototypes/PolicyNameHash_fp.h | 61 +------------- .../private/prototypes/PolicyNvWritten_fp.h | 61 +------------- .../include/private/prototypes/PolicyOR_fp.h | 61 +------------- .../include/private/prototypes/PolicyPCR_fp.h | 61 +------------- .../private/prototypes/PolicyParameters_fp.h | 60 +------------- .../private/prototypes/PolicyPassword_fp.h | 61 +------------- .../prototypes/PolicyPhysicalPresence_fp.h | 61 +------------- .../private/prototypes/PolicyRestart_fp.h | 61 +------------- .../private/prototypes/PolicySecret_fp.h | 61 +------------- .../private/prototypes/PolicySigned_fp.h | 61 +------------- .../private/prototypes/PolicyTemplate_fp.h | 61 +------------- .../private/prototypes/PolicyTicket_fp.h | 61 +------------- .../tpm/include/private/prototypes/Power_fp.h | 61 +------------- .../private/prototypes/PropertyCap_fp.h | 60 +------------- .../tpm/include/private/prototypes/Quote_fp.h | 61 +------------- .../private/prototypes/RSA_Decrypt_fp.h | 61 +------------- .../private/prototypes/RSA_Encrypt_fp.h | 61 +------------- .../include/private/prototypes/ReadClock_fp.h | 61 +------------- .../private/prototypes/ReadPublic_fp.h | 61 +------------- .../prototypes/ResponseCodeProcessing_fp.h | 61 +------------- .../include/private/prototypes/Response_fp.h | 61 +------------- .../include/private/prototypes/Rewrap_fp.h | 61 +------------- .../include/private/prototypes/SelfTest_fp.h | 61 +------------- .../private/prototypes/SequenceComplete_fp.h | 61 +------------- .../private/prototypes/SequenceUpdate_fp.h | 61 +------------- .../include/private/prototypes/Session_fp.h | 60 +------------- .../private/prototypes/SetAlgorithmSet_fp.h | 62 +------------- .../private/prototypes/SetCapability_fp.h | 60 +------------- .../prototypes/SetCommandCodeAuditStatus_fp.h | 61 +------------- .../private/prototypes/SetPrimaryPolicy_fp.h | 61 +------------- .../include/private/prototypes/Shutdown_fp.h | 61 +------------- .../tpm/include/private/prototypes/Sign_fp.h | 61 +------------- .../private/prototypes/StartAuthSession_fp.h | 61 +------------- .../include/private/prototypes/Startup_fp.h | 61 +------------- .../private/prototypes/StirRandom_fp.h | 61 +------------- .../include/private/prototypes/TestParms_fp.h | 61 +------------- .../include/private/prototypes/Ticket_fp.h | 60 +------------- .../tpm/include/private/prototypes/Time_fp.h | 60 +------------- .../include/private/prototypes/TpmASN1_fp.h | 60 +------------- .../prototypes/TpmEcc_Signature_ECDAA_fp.h | 60 +------------- .../prototypes/TpmEcc_Signature_SM2_fp.h | 60 +------------- .../prototypes/TpmEcc_Signature_Schnorr_fp.h | 60 +------------- .../prototypes/TpmEcc_Signature_Util_fp.h | 60 +------------- .../private/prototypes/TpmEcc_Util_fp.h | 60 +------------- .../private/prototypes/TpmMath_Debug_fp.h | 60 +------------- .../private/prototypes/TpmMath_Util_fp.h | 60 +------------- .../private/prototypes/TpmSizeChecks_fp.h | 61 +------------- .../include/private/prototypes/Unseal_fp.h | 61 +------------- .../private/prototypes/VerifySignature_fp.h | 61 +------------- .../include/private/prototypes/X509_ECC_fp.h | 61 +------------- .../include/private/prototypes/X509_RSA_fp.h | 61 +------------- .../include/private/prototypes/X509_spt_fp.h | 61 +------------- .../private/prototypes/ZGen_2Phase_fp.h | 61 +------------- .../TPMCmd/tpm/include/tpm_public/MinMax.h | 60 +------------- .../tpm_public/TpmCalculatedAttributes.h | 60 +------------- .../tpm/src/command/Attestation/Attest_spt.c | 61 +------------- .../tpm/src/command/ClockTimer/ACT_spt.c | 60 +------------- src/tpm2/TPMCmd/tpm/src/crypt/CryptEccCrypt.c | 60 +------------- src/tpm2/TPMCmd/tpm/src/crypt/CryptEccData.c | 60 +------------- src/tpm2/TPMCmd/tpm/src/crypt/CryptSmac.c | 61 +------------- src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c | 60 +------------- src/tpm2/TPMCmd/tpm/src/crypt/Ticket.c | 60 +------------- .../src/crypt/ecc/TpmEcc_Signature_ECDAA.c | 60 +------------- .../src/crypt/ecc/TpmEcc_Signature_Schnorr.c | 60 +------------- .../TPMCmd/tpm/src/subsystem/CommandAudit.c | 60 +------------- src/tpm2/TPMCmd/tpm/src/subsystem/DA.c | 61 +------------- .../TPMCmd/tpm/src/support/AlgorithmCap.c | 60 +------------- src/tpm2/TPMCmd/tpm/src/support/Marshal.c | 83 +++++++------------ .../tpm/src/support/MathOnByteBuffers.c | 60 +------------- src/tpm2/TPMCmd/tpm/src/support/Power.c | 61 +------------- src/tpm2/TPMCmd/tpm/src/support/Response.c | 61 +------------- .../tpm/src/support/ResponseCodeProcessing.c | 61 +------------- src/tpm2/Unmarshal.c | 46 ++-------- src/tpm2/Unmarshal_fp.h | 82 +++++++----------- src/tpm2/Utils.h | 40 +-------- src/tpm2/Volatile.c | 40 +-------- src/tpm2/Volatile.h | 40 +-------- src/tpm2/gensymtestsdata.sh | 1 + 275 files changed, 426 insertions(+), 15548 deletions(-) diff --git a/src/tpm2/BackwardsCompatibility.h b/src/tpm2/BackwardsCompatibility.h index b2a6a9e5a..0f7e6a1f6 100644 --- a/src/tpm2/BackwardsCompatibility.h +++ b/src/tpm2/BackwardsCompatibility.h @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Backwards compatibility related stuff */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2017,2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2017,2018. #ifndef BACKWARDS_COMPATIBILITY_H #define BACKWARDS_COMPATIBILITY_H diff --git a/src/tpm2/BackwardsCompatibilityBitArray.c b/src/tpm2/BackwardsCompatibilityBitArray.c index 0809db693..fa7db9eb1 100644 --- a/src/tpm2/BackwardsCompatibilityBitArray.c +++ b/src/tpm2/BackwardsCompatibilityBitArray.c @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Backwards compatibility support related to command code arrays */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2023. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2023. #include diff --git a/src/tpm2/BackwardsCompatibilityBitArray.h b/src/tpm2/BackwardsCompatibilityBitArray.h index f9d5170c4..55e00aa38 100644 --- a/src/tpm2/BackwardsCompatibilityBitArray.h +++ b/src/tpm2/BackwardsCompatibilityBitArray.h @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Backwards compatibility support related to command code arrays */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2023. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2023. #ifndef BACKWARDS_COMPATIBILITY_BIT_ARRAY_H #define BACKWARDS_COMPATIBILITY_BIT_ARRAY_H diff --git a/src/tpm2/BackwardsCompatibilityObject.c b/src/tpm2/BackwardsCompatibilityObject.c index 14531bf3c..32bfd0aff 100644 --- a/src/tpm2/BackwardsCompatibilityObject.c +++ b/src/tpm2/BackwardsCompatibilityObject.c @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Backwards compatibility stuff related to OBJECT */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2017,2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2017,2018. #include diff --git a/src/tpm2/BackwardsCompatibilityObject.h b/src/tpm2/BackwardsCompatibilityObject.h index 098d7746f..88e94770f 100644 --- a/src/tpm2/BackwardsCompatibilityObject.h +++ b/src/tpm2/BackwardsCompatibilityObject.h @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Backwards compatibility stuff related to OBJECT */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2017,2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2017,2018. #ifndef BACKWARDS_COMPATIBILITY_OBJECT_H #define BACKWARDS_COMPATIBILITY_OBJECT_H diff --git a/src/tpm2/LibtpmsCallbacks.c b/src/tpm2/LibtpmsCallbacks.c index 5d2214792..ea7444344 100644 --- a/src/tpm2/LibtpmsCallbacks.c +++ b/src/tpm2/LibtpmsCallbacks.c @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Libtpms Callbacks */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2018. #include #include diff --git a/src/tpm2/LibtpmsCallbacks.h b/src/tpm2/LibtpmsCallbacks.h index e262b9d65..d4c05a0ee 100644 --- a/src/tpm2/LibtpmsCallbacks.h +++ b/src/tpm2/LibtpmsCallbacks.h @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Libtpms Callbacks */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2018. #ifndef LIBTPMS_CALLBACKS_H #define LIBTPMS_CALLBACKS_H diff --git a/src/tpm2/NVMarshal.c b/src/tpm2/NVMarshal.c index f94c5a52f..1a275e536 100644 --- a/src/tpm2/NVMarshal.c +++ b/src/tpm2/NVMarshal.c @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Marshalling and unmarshalling of state */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2017,2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2017,2018. #include #include diff --git a/src/tpm2/NVMarshal.h b/src/tpm2/NVMarshal.h index 0ff265f67..43a14b365 100644 --- a/src/tpm2/NVMarshal.h +++ b/src/tpm2/NVMarshal.h @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Marshalling and unmarshalling of state */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2017,2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2017,2018. #ifndef NVMARSHAL_H #define NVMARSHAL_H diff --git a/src/tpm2/RuntimeAlgorithm.c b/src/tpm2/RuntimeAlgorithm.c index ba81bd611..af8fcfb9f 100644 --- a/src/tpm2/RuntimeAlgorithm.c +++ b/src/tpm2/RuntimeAlgorithm.c @@ -1,43 +1,6 @@ -/********************************************************************************/ -/* */ -/* Algorithm Runtime Disablement */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2022 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation, 2022 #define _GNU_SOURCE #include diff --git a/src/tpm2/RuntimeAlgorithm_fp.h b/src/tpm2/RuntimeAlgorithm_fp.h index 4cbece99b..9f3226bcb 100644 --- a/src/tpm2/RuntimeAlgorithm_fp.h +++ b/src/tpm2/RuntimeAlgorithm_fp.h @@ -1,43 +1,6 @@ -/********************************************************************************/ -/* */ -/* Algorithm Runtime Disablement */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2022 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation, 2022 #ifndef RUNTIME_ALGORITHM_H #define RUNTIME_ALGORITHM_H diff --git a/src/tpm2/RuntimeAttributes.c b/src/tpm2/RuntimeAttributes.c index e2e5b8ad1..529cb6d2b 100644 --- a/src/tpm2/RuntimeAttributes.c +++ b/src/tpm2/RuntimeAttributes.c @@ -1,43 +1,6 @@ -/********************************************************************************/ -/* */ -/* Runtime Attributes */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2023 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation, 2023 #define _GNU_SOURCE #include diff --git a/src/tpm2/RuntimeAttributes_fp.h b/src/tpm2/RuntimeAttributes_fp.h index b61b090ec..436ba3189 100644 --- a/src/tpm2/RuntimeAttributes_fp.h +++ b/src/tpm2/RuntimeAttributes_fp.h @@ -1,43 +1,6 @@ -/********************************************************************************/ -/* */ -/* Runtime Attributes */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2022 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation, 2022 #ifndef RUNTIME_ATTRIBUTES_H #define RUNTIME_ATTRIBUTES_H diff --git a/src/tpm2/RuntimeCommands.c b/src/tpm2/RuntimeCommands.c index 099201867..799b511e6 100644 --- a/src/tpm2/RuntimeCommands.c +++ b/src/tpm2/RuntimeCommands.c @@ -1,43 +1,6 @@ -/********************************************************************************/ -/* */ -/* TPM 2 Commands Runtime Disablement */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2022 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation, 2022 #define _GNU_SOURCE #include diff --git a/src/tpm2/RuntimeCommands_fp.h b/src/tpm2/RuntimeCommands_fp.h index 520f1ce47..3a5a681b2 100644 --- a/src/tpm2/RuntimeCommands_fp.h +++ b/src/tpm2/RuntimeCommands_fp.h @@ -1,43 +1,6 @@ -/********************************************************************************/ -/* */ -/* TPM 2 Commands Runtime Disablement */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2022 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation, 2022 #ifndef RUNTIME_COMMANDS_H #define RUNTIME_COMMANDS_H diff --git a/src/tpm2/RuntimeProfile.c b/src/tpm2/RuntimeProfile.c index ffd95c38c..b4909e7fe 100644 --- a/src/tpm2/RuntimeProfile.c +++ b/src/tpm2/RuntimeProfile.c @@ -1,43 +1,6 @@ -/********************************************************************************/ -/* */ -/* Runtime Profile */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2022 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation, 2022 #define _GNU_SOURCE #include diff --git a/src/tpm2/RuntimeProfile_fp.h b/src/tpm2/RuntimeProfile_fp.h index ae3ac28ca..62694ac2d 100644 --- a/src/tpm2/RuntimeProfile_fp.h +++ b/src/tpm2/RuntimeProfile_fp.h @@ -1,43 +1,6 @@ -/********************************************************************************/ -/* */ -/* Runtime Profile */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2022 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation, 2022 #ifndef RUNTIME_PROFILE_H #define RUNTIME_PROFILE_H diff --git a/src/tpm2/StateMarshal.c b/src/tpm2/StateMarshal.c index fbb26620d..a902257ff 100644 --- a/src/tpm2/StateMarshal.c +++ b/src/tpm2/StateMarshal.c @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Marshalling and unmarshalling of state */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2017,2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2017,2018. #include @@ -96,3 +62,4 @@ VolatileLoad(BOOL *restored) return rc; } + diff --git a/src/tpm2/StateMarshal.h b/src/tpm2/StateMarshal.h index 29bed70ad..ae3ceccbe 100644 --- a/src/tpm2/StateMarshal.h +++ b/src/tpm2/StateMarshal.h @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Marshalling and unmarshalling of state */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2017,2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2017,2018. #ifndef STATE_MARSHAL_H #define STATE_MARSHAL_H diff --git a/src/tpm2/TPMCmd/Platform/include/PlatformClock.h b/src/tpm2/TPMCmd/Platform/include/PlatformClock.h index 306aeb8c7..075a572b4 100644 --- a/src/tpm2/TPMCmd/Platform/include/PlatformClock.h +++ b/src/tpm2/TPMCmd/Platform/include/PlatformClock.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Platform Clock . */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PlatformClock.h 1594 2020-03-26 22:15:48Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2020 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This file contains the instance data for the Platform module. It is collected // in this file so that the state of the module is easier to manage. diff --git a/src/tpm2/TPMCmd/Platform/include/PlatformInternal.h b/src/tpm2/TPMCmd/Platform/include/PlatformInternal.h index 46744de51..c3503eff5 100644 --- a/src/tpm2/TPMCmd/Platform/include/PlatformInternal.h +++ b/src/tpm2/TPMCmd/Platform/include/PlatformInternal.h @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause // Private platform internal functions diff --git a/src/tpm2/TPMCmd/Platform/include/prototypes/platform_public_interface.h b/src/tpm2/TPMCmd/Platform/include/prototypes/platform_public_interface.h index 51b947a6e..818ead952 100644 --- a/src/tpm2/TPMCmd/Platform/include/prototypes/platform_public_interface.h +++ b/src/tpm2/TPMCmd/Platform/include/prototypes/platform_public_interface.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ - +// SPDX-License-Identifier: BSD-2-Clause // This file contains the interface into the platform layer from external callers. diff --git a/src/tpm2/TPMCmd/Platform/src/Cancel.c b/src/tpm2/TPMCmd/Platform/src/Cancel.c index 0d0359fe1..005a6e59b 100644 --- a/src/tpm2/TPMCmd/Platform/src/Cancel.c +++ b/src/tpm2/TPMCmd/Platform/src/Cancel.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Simulates the cancel pins on the TPM. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Cancel.c 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // diff --git a/src/tpm2/TPMCmd/Platform/src/Entropy.c b/src/tpm2/TPMCmd/Platform/src/Entropy.c index 7a0c4b122..01e8fb5ea 100644 --- a/src/tpm2/TPMCmd/Platform/src/Entropy.c +++ b/src/tpm2/TPMCmd/Platform/src/Entropy.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Entropy */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Entropy.c 1661 2021-03-18 19:00:58Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes and Local Values diff --git a/src/tpm2/TPMCmd/Platform/src/ExtraData.c b/src/tpm2/TPMCmd/Platform/src/ExtraData.c index 7e8da7605..80f3d87da 100644 --- a/src/tpm2/TPMCmd/Platform/src/ExtraData.c +++ b/src/tpm2/TPMCmd/Platform/src/ExtraData.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // diff --git a/src/tpm2/TPMCmd/Platform/src/LocalityPlat.c b/src/tpm2/TPMCmd/Platform/src/LocalityPlat.c index cf297d1d9..e6fc14a72 100644 --- a/src/tpm2/TPMCmd/Platform/src/LocalityPlat.c +++ b/src/tpm2/TPMCmd/Platform/src/LocalityPlat.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Platform Locality Support */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: LocalityPlat.c 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes #include "Platform.h" diff --git a/src/tpm2/TPMCmd/Platform/src/PPPlat.c b/src/tpm2/TPMCmd/Platform/src/PPPlat.c index 3354cbfd4..f547afe35 100644 --- a/src/tpm2/TPMCmd/Platform/src/PPPlat.c +++ b/src/tpm2/TPMCmd/Platform/src/PPPlat.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Simulates the Physical Present Interface */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PPPlat.c 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description diff --git a/src/tpm2/TPMCmd/Platform/src/PlatformACT.c b/src/tpm2/TPMCmd/Platform/src/PlatformACT.c index dde2026fc..32223098e 100644 --- a/src/tpm2/TPMCmd/Platform/src/PlatformACT.c +++ b/src/tpm2/TPMCmd/Platform/src/PlatformACT.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Platform Authenticated Countdown Timer */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PlatformACT.c 1594 2020-03-26 22:15:48Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2020 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes #include "Platform.h" diff --git a/src/tpm2/TPMCmd/Platform/src/PlatformData.c b/src/tpm2/TPMCmd/Platform/src/PlatformData.c index f02a53672..68c0f03a3 100644 --- a/src/tpm2/TPMCmd/Platform/src/PlatformData.c +++ b/src/tpm2/TPMCmd/Platform/src/PlatformData.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM variables that are not stack allocated */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PlatformData.c 1519 2019-11-15 20:43:51Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // This file will instance the TPM variables that are not stack allocated. The diff --git a/src/tpm2/TPMCmd/Platform/src/PowerPlat.c b/src/tpm2/TPMCmd/Platform/src/PowerPlat.c index c9b4a098c..088343ece 100644 --- a/src/tpm2/TPMCmd/Platform/src/PowerPlat.c +++ b/src/tpm2/TPMCmd/Platform/src/PowerPlat.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Platform Power Support */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PowerPlat.c 1529 2019-11-21 23:29:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes and Function Prototypes diff --git a/src/tpm2/TPMCmd/Platform/src/Unique.c b/src/tpm2/TPMCmd/Platform/src/Unique.c index 23d50b67b..71871762c 100644 --- a/src/tpm2/TPMCmd/Platform/src/Unique.c +++ b/src/tpm2/TPMCmd/Platform/src/Unique.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Secret Value to the TPM */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // In some implementations of the TPM, the hardware can provide a secret diff --git a/src/tpm2/TPMCmd/Platform/src/VendorInfo.c b/src/tpm2/TPMCmd/Platform/src/VendorInfo.c index e37c2a14c..972bfd44c 100644 --- a/src/tpm2/TPMCmd/Platform/src/VendorInfo.c +++ b/src/tpm2/TPMCmd/Platform/src/VendorInfo.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // Provide vendor-specific version and identifiers to core TPM library for diff --git a/src/tpm2/TPMCmd/Simulator/include/prototypes/Simulator_fp.h b/src/tpm2/TPMCmd/Simulator/include/prototypes/Simulator_fp.h index 509fceadc..d76b4c08b 100644 --- a/src/tpm2/TPMCmd/Simulator/include/prototypes/Simulator_fp.h +++ b/src/tpm2/TPMCmd/Simulator/include/prototypes/Simulator_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c b/src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c index 67401e0af..32a6a9dd4 100644 --- a/src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c +++ b/src/tpm2/TPMCmd/Simulator/src/TPMCmdp.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Process the commands */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // This file contains the functions that process the commands received on the diff --git a/src/tpm2/TPMCmd/Simulator/src/simulatorPrivate.h b/src/tpm2/TPMCmd/Simulator/src/simulatorPrivate.h index c578f9296..1eded505a 100644 --- a/src/tpm2/TPMCmd/Simulator/src/simulatorPrivate.h +++ b/src/tpm2/TPMCmd/Simulator/src/simulatorPrivate.h @@ -1,59 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* (c) Copyright IBM Corporation, 2020-2025 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // common headers for simulator implementation files diff --git a/src/tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h b/src/tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h index bcb3a1e26..0d9e45993 100644 --- a/src/tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h +++ b/src/tpm2/TPMCmd/Simulator/src/simulator_sysheaders.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // system headers for the simulator, both Windows and Linux diff --git a/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Misc.h b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Misc.h index 9696a9e88..044e63afc 100644 --- a/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Misc.h +++ b/src/tpm2/TPMCmd/TpmConfiguration/TpmConfiguration/TpmProfile_Misc.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // Misc profile settings that don't currently have a better home. // These are rarely changed, but available for vendor customization. diff --git a/src/tpm2/TPMCmd/TpmConfiguration/TpmVendorCommandHandlers/Vendor_TCG_Test.c b/src/tpm2/TPMCmd/TpmConfiguration/TpmVendorCommandHandlers/Vendor_TCG_Test.c index c6233510b..bc3678bba 100644 --- a/src/tpm2/TPMCmd/TpmConfiguration/TpmVendorCommandHandlers/Vendor_TCG_Test.c +++ b/src/tpm2/TPMCmd/TpmConfiguration/TpmVendorCommandHandlers/Vendor_TCG_Test.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-2-Clause #include diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/EccRef/TpmEcc_Signature_ECDSA.c b/src/tpm2/TPMCmd/tpm/cryptolibs/EccRef/TpmEcc_Signature_ECDSA.c index 5a6fe14d7..e8cf55b2f 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/EccRef/TpmEcc_Signature_ECDSA.c +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/EccRef/TpmEcc_Signature_ECDSA.c @@ -1,68 +1,10 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #include "Tpm.h" #include "TpmEcc_Signature_ECDSA_fp.h" #include "TpmMath_Debug_fp.h" #include "TpmMath_Util_fp.h" -#include "BnToOsslMath_fp.h" +#include "BnToOsslMath_fp.h" // libtpms added #if ALG_ECC && ALG_ECDSA //*** TpmEcc_AdjustEcdsaDigest() diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/ExpDCache.c b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/ExpDCache.c index 8e6a8d279..f995e4aa6 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/ExpDCache.c +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/ExpDCache.c @@ -1,43 +1,6 @@ -/********************************************************************************/ -/* */ -/* Private Exponent D cache functions */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2021-2025 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation, 2021-2025 #include "Tpm.h" #include "ExpDCache_fp.h" diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/Helpers.c b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/Helpers.c index b4eeb3d9e..a637abfb6 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/Helpers.c +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/Helpers.c @@ -1,43 +1,6 @@ -/********************************************************************************/ -/* */ -/* OpenSSL helper functions */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2019-2025 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation, 2019-2025 #include "Tpm.h" #include "ExpDCache_fp.h" diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/TpmToOsslSupport.c b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/TpmToOsslSupport.c index 8965d607a..8e0be9c54 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/TpmToOsslSupport.c +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/TpmToOsslSupport.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Initialization of the Interface to the OpenSSL Library. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/BnOssl.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/BnOssl.h index 660d2cd5b..b856eb120 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/BnOssl.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/BnOssl.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the headers necessary to build the Open SSL support for diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath.h index 4bd9cc75d..142695ec1 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains OpenSSL specific functions called by TpmBigNum library to provide diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath_fp.h index 64406e331..87e0f88d2 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath_fp.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/BnToOsslMath_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/ExpDCache_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/ExpDCache_fp.h index e7db0580d..69f946a04 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/ExpDCache_fp.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/ExpDCache_fp.h @@ -1,43 +1,6 @@ -/********************************************************************************/ -/* */ -/* Private Exponent D cache functions */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2021-2025 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation, 2021-2025 #ifndef DCACHE_FP_H #define DCACHE_FP_H diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/Helpers_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/Helpers_fp.h index 56614cc4d..37abfd9c9 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/Helpers_fp.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/Helpers_fp.h @@ -1,44 +1,6 @@ -/********************************************************************************/ -/* */ -/* OpenSSL helper functions */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* (c) Copyright IBM Corporation, 2019-2025 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause +// (c) Copyright IBM Corporation, 2019-2025 #ifndef HELPERS_FP_H #define HELPERS_FP_H diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSupport_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSupport_fp.h index b509b25d2..84bfcc7bc 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSupport_fp.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/Ossl/include/Ossl/TpmToOsslSupport_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Initialization of the Interface to the OpenSSL Library */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/RsaRef/PrimeData.c b/src/tpm2/TPMCmd/tpm/cryptolibs/RsaRef/PrimeData.c index 0b5f5ca2c..3993a8b97 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/RsaRef/PrimeData.c +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/RsaRef/PrimeData.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Product of all of the Primes up to 1000 */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #include "Tpm.h" diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnMemory.c b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnMemory.c index 280327778..2b8c7785a 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnMemory.c +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/BnMemory.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: BnMemory.c 1262 2018-07-11 21:03:43Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the memory setup functions used by the bigNum functions diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNum.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNum.h index bc90c9729..3b64d20f7 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNum.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNum.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the headers necessary to build the tpm big num library. diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNumThunks.c b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNumThunks.c index f27254e36..add3b897c 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNumThunks.c +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/TpmBigNumThunks.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains BN Thunks between the MathInterfaceLibrary types and the diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnConvert_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnConvert_fp.h index db8108463..b0321a1cd 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnConvert_fp.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnConvert_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMath_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMath_fp.h index 0f6609af1..87e6cac2d 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMath_fp.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMath_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMemory_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMemory_fp.h index 4b8269ce7..e4414aa83 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMemory_fp.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnMemory_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnSupport_Interface.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnSupport_Interface.h index 376c98cd8..e99cbe0fb 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnSupport_Interface.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnSupport_Interface.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // Prototypes for functions the bignum library requires diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnUtil_fp.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnUtil_fp.h index 832010ef2..be35e5885 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnUtil_fp.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/BnUtil_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // Utility functions to support TpmBigNum library diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum/TpmToTpmBigNumMath.h b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum/TpmToTpmBigNumMath.h index 55879aad6..24a2bf0b7 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum/TpmToTpmBigNumMath.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/TpmBigNum/include/TpmBigNum/TpmToTpmBigNumMath.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains OpenSSL specific functions called by TpmBigNum library to provide diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/CryptoInterface.h b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/CryptoInterface.h index 15fc5b199..a342f01cb 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/CryptoInterface.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/CryptoInterface.h @@ -1,40 +1,4 @@ -/********************************************************************************/ -/* */ -/* CryptoInterface header file */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2017,2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/EccConstantData.inl b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/EccConstantData.inl index e5093dd30..c19a8b039 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/EccConstantData.inl +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/EccConstantData.inl @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This file contains the ECC curve data. The data is contained in macros so this diff --git a/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/MathLibraryInterface.h b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/MathLibraryInterface.h index b1544807f..5a3d0cd44 100644 --- a/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/MathLibraryInterface.h +++ b/src/tpm2/TPMCmd/tpm/cryptolibs/common/include/MathLibraryInterface.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // diff --git a/src/tpm2/TPMCmd/tpm/include/platform_interface/pcrstruct.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/pcrstruct.h index 2970a8850..34efcfa2d 100644 --- a/src/tpm2/TPMCmd/tpm/include/platform_interface/pcrstruct.h +++ b/src/tpm2/TPMCmd/tpm/include/platform_interface/pcrstruct.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // // This file defines the PCR and PCR_Attributes structures and diff --git a/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/Manufacture_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/Manufacture_fp.h index 835ab9e96..94dd4befe 100644 --- a/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/Manufacture_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/Manufacture_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Performs the manufacturing of the TPM */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ - +// SPDX-License-Identifier: BSD-2-Clause #ifndef _MANUFACTURE_FP_H_ #define _MANUFACTURE_FP_H_ diff --git a/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Init_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Init_fp.h index 944da553f..e84faf3cc 100644 --- a/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Init_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/_TPM_Init_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: _TPM_Init_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_pcr_fp.h b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_pcr_fp.h index 579e5a24c..b06425539 100644 --- a/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_pcr_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/platform_interface/prototypes/platform_pcr_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // platform PCR functions called by the TPM library diff --git a/src/tpm2/TPMCmd/tpm/include/private/CryptSym.h b/src/tpm2/TPMCmd/tpm/include/private/CryptSym.h index 4cd6bb936..4ed786e39 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/CryptSym.h +++ b/src/tpm2/TPMCmd/tpm/include/private/CryptSym.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Implementation of the symmetric block cipher modes */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2017 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // diff --git a/src/tpm2/TPMCmd/tpm/include/private/CryptTest.h b/src/tpm2/TPMCmd/tpm/include/private/CryptTest.h index 3d2136026..b88767e1b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/CryptTest.h +++ b/src/tpm2/TPMCmd/tpm/include/private/CryptTest.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* constant definitions used for self-test. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This file contains constant definitions used for self-test. diff --git a/src/tpm2/TPMCmd/tpm/include/private/EccTestData.h b/src/tpm2/TPMCmd/tpm/include/private/EccTestData.h index a68a14172..b3ee558e4 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/EccTestData.h +++ b/src/tpm2/TPMCmd/tpm/include/private/EccTestData.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Parameter data for ECC testing */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: EccTestData.h 1259 2018-07-10 19:11:09Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This file contains the parameter data for ECC testing. diff --git a/src/tpm2/TPMCmd/tpm/include/private/HashTestData.h b/src/tpm2/TPMCmd/tpm/include/private/HashTestData.h index 7fcd52d49..4bd174bed 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/HashTestData.h +++ b/src/tpm2/TPMCmd/tpm/include/private/HashTestData.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Hash Test Vectors */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: HashTestData.h 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2021 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // // Hash Test Vectors diff --git a/src/tpm2/TPMCmd/tpm/include/private/KdfTestData.h b/src/tpm2/TPMCmd/tpm/include/private/KdfTestData.h index a632fd759..b886b2774 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/KdfTestData.h +++ b/src/tpm2/TPMCmd/tpm/include/private/KdfTestData.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Hash Test Vectors */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: KdfTestData.h 1311 2018-08-23 21:39:29Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // diff --git a/src/tpm2/TPMCmd/tpm/include/private/LibSupport.h b/src/tpm2/TPMCmd/tpm/include/private/LibSupport.h index 523849687..69a8e0ef4 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/LibSupport.h +++ b/src/tpm2/TPMCmd/tpm/include/private/LibSupport.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* select the library code that gets included in the TPM build */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This header file is used to select the library code that gets included in the // TPM build. diff --git a/src/tpm2/TPMCmd/tpm/include/private/Marshal.h b/src/tpm2/TPMCmd/tpm/include/private/Marshal.h index 65bd1e5b2..430fccd62 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/Marshal.h +++ b/src/tpm2/TPMCmd/tpm/include/private/Marshal.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ - +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file is used to provide the things needed by a module that uses the marshaling diff --git a/src/tpm2/TPMCmd/tpm/include/private/NV.h b/src/tpm2/TPMCmd/tpm/include/private/NV.h index 3eaa156a4..5a5069bb5 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/NV.h +++ b/src/tpm2/TPMCmd/tpm/include/private/NV.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Index Type Definitions diff --git a/src/tpm2/TPMCmd/tpm/include/private/RsaTestData.h b/src/tpm2/TPMCmd/tpm/include/private/RsaTestData.h index 27cb5c62c..772f59c10 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/RsaTestData.h +++ b/src/tpm2/TPMCmd/tpm/include/private/RsaTestData.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* RSA Test Vectors */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: RsaTestData.h 1259 2018-07-10 19:11:09Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // // RSA Test Vectors diff --git a/src/tpm2/TPMCmd/tpm/include/private/SelfTest.h b/src/tpm2/TPMCmd/tpm/include/private/SelfTest.h index 2a833b00d..39faca3c4 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/SelfTest.h +++ b/src/tpm2/TPMCmd/tpm/include/private/SelfTest.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Structure definitions for the self-test */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the structure definitions for the self-test. It also contains diff --git a/src/tpm2/TPMCmd/tpm/include/private/SymmetricTest.h b/src/tpm2/TPMCmd/tpm/include/private/SymmetricTest.h index c79ef1f67..6163be74b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/SymmetricTest.h +++ b/src/tpm2/TPMCmd/tpm/include/private/SymmetricTest.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction diff --git a/src/tpm2/TPMCmd/tpm/include/private/SymmetricTestData.h b/src/tpm2/TPMCmd/tpm/include/private/SymmetricTestData.h index c2a167f43..e1b766f0b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/SymmetricTestData.h +++ b/src/tpm2/TPMCmd/tpm/include/private/SymmetricTestData.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Vector for testing Either Encrypt or Decrypt */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // This is a vector for testing either encrypt or decrypt. The premise for decrypt // is that the IV for decryption is the same as the IV for encryption. However, diff --git a/src/tpm2/TPMCmd/tpm/include/private/Tpm.h b/src/tpm2/TPMCmd/tpm/include/private/Tpm.h index 90472a410..16aefdacc 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/Tpm.h +++ b/src/tpm2/TPMCmd/tpm/include/private/Tpm.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Root header file for building any TPM.lib code */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // Root header file for building any TPM.lib code diff --git a/src/tpm2/TPMCmd/tpm/include/private/X509.h b/src/tpm2/TPMCmd/tpm/include/private/X509.h index d5839a8e0..396d739e6 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/X509.h +++ b/src/tpm2/TPMCmd/tpm/include/private/X509.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Macro and Structure Definitions for the X509 Commands and Functions. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: X509.h 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2021 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the macro and structure definitions for the X509 commands and diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_SetTimeout_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_SetTimeout_fp.h index af84262fb..3ea3f8c9c 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_SetTimeout_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_SetTimeout_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM2_ACT_SetTimeout Header */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id$ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_spt_fp.h index 368bb4cd3..dd7cae3ce 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_spt_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ACT_spt_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* ACT Command Support */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes 1.00 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ActivateCredential_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ActivateCredential_fp.h index 0083e2e72..c6e28ea31 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ActivateCredential_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ActivateCredential_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ActivateCredential_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmCap_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmCap_fp.h index b37ad4a0a..5e19a0fc2 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmCap_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmCap_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmTests_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmTests_fp.h index 5e76d3735..392fa8bab 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmTests_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/AlgorithmTests_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2024 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Attest_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Attest_spt_fp.h index fbb4a538d..36d13431b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Attest_spt_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Attest_spt_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Attest_spt_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Bits_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Bits_fp.h index 2b4810e97..858738777 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Bits_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Bits_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Bit Handling */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Bits_fp.h 803 2016-11-15 20:19:26Z kgoldman */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyCreation_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyCreation_fp.h index 12093c8aa..164cdbaf3 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyCreation_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyCreation_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CertifyCreation_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyX509_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyX509_fp.h index 2a74407c1..96d4576ee 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyX509_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CertifyX509_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM2_CertifyX509 Command Header */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CertifyX509_fp.h 1519 2019-11-15 20:43:51Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Certify_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Certify_fp.h index 2549b05f5..8be033486 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Certify_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Certify_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Certify_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangeEPS_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangeEPS_fp.h index 51cdda33e..29c7edca7 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangeEPS_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangeEPS_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ChangeEPS_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangePPS_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangePPS_fp.h index db60e3ee6..e705e66b1 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangePPS_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ChangePPS_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ChangePPS_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClearControl_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClearControl_fp.h index a993b8879..2d929a0d4 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClearControl_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClearControl_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ClearControl_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Clear_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Clear_fp.h index 2cd97355c..07f12bfb2 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Clear_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Clear_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Clear_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockRateAdjust_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockRateAdjust_fp.h index 4d4317c7a..fa78ada9f 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockRateAdjust_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockRateAdjust_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ClockRateAdjust_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockSet_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockSet_fp.h index 73bc52171..e48643ef1 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockSet_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ClockSet_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ClockSet_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandAudit_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandAudit_fp.h index ed6dd60cf..e05544c58 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandAudit_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandAudit_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandCodeAttributes_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandCodeAttributes_fp.h index 38e499a6b..7b7b090c7 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandCodeAttributes_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandCodeAttributes_fp.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandDispatcher_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandDispatcher_fp.h index 9eec0666c..27ca42848 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandDispatcher_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CommandDispatcher_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CommandDispatcher_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Commit_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Commit_fp.h index bafb37bf8..b88e4229c 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Commit_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Commit_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Commit_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextLoad_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextLoad_fp.h index ec49cd6dc..39e8b7ace 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextLoad_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextLoad_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ContextLoad_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextSave_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextSave_fp.h index 1f6dc2ec6..1ef6c05f9 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextSave_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ContextSave_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ContextSave_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Context_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Context_spt_fp.h index 5b7e892e8..f7e61e13b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Context_spt_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Context_spt_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CreateLoaded_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CreateLoaded_fp.h index 0198c5bad..81b9ccadc 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CreateLoaded_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CreateLoaded_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CreateLoaded_fp.h 1600 2020-03-30 22:08:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CreatePrimary_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CreatePrimary_fp.h index 6fcf801a3..4620fb7ce 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CreatePrimary_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CreatePrimary_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CreatePrimary_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Create_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Create_fp.h index 6e509166a..54b1a753d 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Create_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Create_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Create_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptCmac_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptCmac_fp.h index f61b26cee..993ac3abf 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptCmac_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptCmac_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* Message Authentication Codes Based on a Symmetric Block Cipher */ -/* Implementation of cryptographic functions for hashing. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2018 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccCrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccCrypt_fp.h index 872114f8f..c82db9c37 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccCrypt_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccCrypt_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Include Headers for Internal Routines */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CryptEccCrypt_fp.h 1594 2020-03-26 22:15:48Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2020 - 2022 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccKeyExchange_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccKeyExchange_fp.h index 2edfed2d9..8a38f5c72 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccKeyExchange_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccKeyExchange_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccMain_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccMain_fp.h index 99e8a816b..76d04ddb7 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccMain_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccMain_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* ECC Main */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccSignature_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccSignature_fp.h index 3851f82c1..223b78c10 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccSignature_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptEccSignature_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 -2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrimeSieve_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrimeSieve_fp.h index 1cfee9ccc..349913b2d 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrimeSieve_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrimeSieve_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ - +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrime_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrime_fp.h index a2e317810..748d082b8 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrime_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptPrime_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Code for prime validation */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRand_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRand_fp.h index 04ae9a637..e75468993 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRand_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRand_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* DRBG with a behavior according to SP800-90A */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CryptRand_fp.h 1476 2019-06-10 19:32:03Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRsa_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRsa_fp.h index e1dd80b11..01890db12 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRsa_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptRsa_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Implementation of cryptographic primitives for RSA */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _CRYPT_RSA_FP_H_ #define _CRYPT_RSA_FP_H_ diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSelfTest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSelfTest_fp.h index e91df04b2..13e24f043 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSelfTest_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSelfTest_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CryptSelfTest_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSmac_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSmac_fp.h index de5e0df95..9fde0a2ef 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSmac_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSmac_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* Message Authentication Codes Based on a Symmetric Block Cipher */ -/* Implementation of cryptographic functions for hashing. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CryptSmac_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSym_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSym_fp.h index fef3dd151..da2b55886 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSym_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/CryptSym_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CryptSym_fp.h 1047 2017-07-20 18:27:34Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/DA_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/DA_fp.h index 68c7c4441..8b43dec1b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/DA_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/DA_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: DA_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackLockReset_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackLockReset_fp.h index 571114c62..1db2068de 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackLockReset_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackLockReset_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: DictionaryAttackLockReset_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackParameters_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackParameters_fp.h index cdf7c165b..374373e5c 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackParameters_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/DictionaryAttackParameters_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: DictionaryAttackParameters_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Duplicate_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Duplicate_fp.h index 72d4539a8..2ff3fa800 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Duplicate_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Duplicate_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Duplicate_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Decrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Decrypt_fp.h index 0d5d3d1e8..10c3aaf45 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Decrypt_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Decrypt_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id$ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2022 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Encrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Encrypt_fp.h index 8ad4fc716..4a37f23cd 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Encrypt_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Encrypt_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id$ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2022 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Parameters_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Parameters_fp.h index 1314bd9e3..62eef6ec9 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Parameters_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECC_Parameters_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ECC_Parameters_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_KeyGen_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_KeyGen_fp.h index 1ec59874e..19e7fbdf6 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_KeyGen_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_KeyGen_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ECDH_KeyGen_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_ZGen_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_ZGen_fp.h index c7af17adb..45a6b347b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_ZGen_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ECDH_ZGen_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ECDH_ZGen_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EC_Ephemeral_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EC_Ephemeral_fp.h index dc004fab4..09f5184a7 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EC_Ephemeral_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EC_Ephemeral_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: EC_Ephemeral_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt2_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt2_fp.h index 71fb7df66..a25432713 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt2_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt2_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: EncryptDecrypt2_fp.h 1047 2017-07-20 18:27:34Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_fp.h index 37cf77342..2fbdf61e5 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: EncryptDecrypt_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_spt_fp.h index bca20b703..b74c86392 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_spt_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EncryptDecrypt_spt_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: EncryptDecrypt_spt_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Entity_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Entity_fp.h index e93f9c207..042eea66b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Entity_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Entity_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Entity_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EventSequenceComplete_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EventSequenceComplete_fp.h index 6ca9ef9d5..177aa2e48 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EventSequenceComplete_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EventSequenceComplete_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: EventSequenceComplete_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EvictControl_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EvictControl_fp.h index 57b9a91ec..2e7a00011 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/EvictControl_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/EvictControl_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: EvictControl_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/FlushContext_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/FlushContext_fp.h index 015b1e775..b408d84b2 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/FlushContext_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/FlushContext_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: FlushContext_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCapability_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCapability_fp.h index 01f9fb2a8..57bcfeb50 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCapability_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCapability_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: GetCapability_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCommandAuditDigest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCommandAuditDigest_fp.h index cd95554e1..2c5e4c0e5 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCommandAuditDigest_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetCommandAuditDigest_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: GetCommandAuditDigest_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetRandom_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetRandom_fp.h index bf72c5383..80e03b80e 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetRandom_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetRandom_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: GetRandom_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetSessionAuditDigest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetSessionAuditDigest_fp.h index 9264b1c0d..7be21aeb5 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetSessionAuditDigest_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetSessionAuditDigest_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: GetSessionAuditDigest_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTestResult_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTestResult_fp.h index d82cb792d..6913e71b0 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTestResult_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTestResult_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: GetTestResult_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTime_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTime_fp.h index 2d3ec13e1..07816d7f0 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTime_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/GetTime_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: GetTime_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_Start_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_Start_fp.h index 687200c8a..c1249be92 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_Start_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_Start_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: HMAC_Start_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_fp.h index e483005eb..a2f26157a 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HMAC_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: HMAC_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Handle_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Handle_fp.h index a746a4756..4179afa71 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Handle_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Handle_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 -2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/HashSequenceStart_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HashSequenceStart_fp.h index fc3fbfed6..cf59f95e6 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/HashSequenceStart_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HashSequenceStart_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: HashSequenceStart_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Hash_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Hash_fp.h index a1a7bd82f..bf434efbe 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Hash_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Hash_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Hash_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyChangeAuth_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyChangeAuth_fp.h index 4c615c613..140d608d4 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyChangeAuth_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyChangeAuth_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: HierarchyChangeAuth_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyControl_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyControl_fp.h index 469a5a02f..44700e285 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyControl_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/HierarchyControl_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: HierarchyControl_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Hierarchy_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Hierarchy_fp.h index 49a5dcd66..c878b3666 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Hierarchy_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Hierarchy_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Import_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Import_fp.h index 67d1e9829..b4d2d5206 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Import_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Import_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Import_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/IncrementalSelfTest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/IncrementalSelfTest_fp.h index 4cecbb0d1..5db9c1270 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/IncrementalSelfTest_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/IncrementalSelfTest_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: IncrementalSelfTest_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/LoadExternal_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/LoadExternal_fp.h index ee7c2a152..72794644e 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/LoadExternal_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/LoadExternal_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: LoadExternal_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Load_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Load_fp.h index 304b30625..f440c65d3 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Load_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Load_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Load_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Locality_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Locality_fp.h index b0a3056c4..06898c293 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Locality_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Locality_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Locality_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_Start_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_Start_fp.h index 5d4879a36..8baf4549e 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_Start_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_Start_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: MAC_Start_fp.h 1047 2017-07-20 18:27:34Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2017 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_fp.h index 588a6e225..9e9d8a7f5 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MAC_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: MAC_fp.h 1259 2018-07-10 19:11:09Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/MakeCredential_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MakeCredential_fp.h index 4ba7b0af1..0658b71f1 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/MakeCredential_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MakeCredential_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: MakeCredential_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Marshal_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Marshal_fp.h index 31ca655a6..9fea6705f 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Marshal_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Marshal_fp.h @@ -1,61 +1,41 @@ +// SPDX-License-Identifier: BSD-2-Clause + /********************************************************************************/ /* */ /* Parameter Marshaling */ /* Written by Ken Goldman */ /* IBM Thomas J. Watson Research Center */ /* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ +/* (c) Copyright IBM Corporation 2015 - 2026 */ /* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are */ +/* met: */ +/* */ +/* Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the following disclaimer. */ +/* */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the names of the IBM Corporation nor the names of its */ +/* contributors may be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ +/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ +/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ +/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ +/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ +/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ +/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /********************************************************************************/ #ifndef MARSHAL_FP_H diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/MathOnByteBuffers_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MathOnByteBuffers_fp.h index b4a29f3fb..e9d051d9d 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/MathOnByteBuffers_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/MathOnByteBuffers_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Math functions performed with canonical integers in byte buffers */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Memory_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Memory_fp.h index 03aaebd4d..9e6358e47 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Memory_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Memory_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Miscellaneous Memory Manipulation Routines */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Memory_fp.h 1476 2019-06-10 19:32:03Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Certify_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Certify_fp.h index 99028f37a..593709ce2 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Certify_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Certify_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_Certify_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ChangeAuth_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ChangeAuth_fp.h index 4b3bd7f78..96f48b9de 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ChangeAuth_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ChangeAuth_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_ChangeAuth_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace2_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace2_fp.h index 428313d91..d17d81014 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace2_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace2_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace_fp.h index 9c15f1840..d02305921 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_DefineSpace_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_DefineSpace_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Extend_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Extend_fp.h index aadebaea2..4845b4a53 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Extend_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Extend_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_Extend_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_GlobalWriteLock_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_GlobalWriteLock_fp.h index 0cb04bb57..16e89d0b5 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_GlobalWriteLock_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_GlobalWriteLock_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_GlobalWriteLock_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Increment_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Increment_fp.h index 84414e01f..8e51daced 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Increment_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Increment_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_Increment_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadLock_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadLock_fp.h index 93df04f61..1eaa5fccb 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadLock_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadLock_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_ReadLock_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic2_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic2_fp.h index df1d43f49..d5d4eb7ea 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic2_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic2_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic_fp.h index 1dad1440c..b88c2606f 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_ReadPublic_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_ReadPublic_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Read_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Read_fp.h index 154ad83e8..940a2bd91 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Read_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Read_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_Read_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_SetBits_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_SetBits_fp.h index 50263a45f..5fe15d935 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_SetBits_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_SetBits_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_SetBits_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpaceSpecial_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpaceSpecial_fp.h index 5409f7ccb..db9b84f92 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpaceSpecial_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpaceSpecial_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_UndefineSpaceSpecial_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpace_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpace_fp.h index 52d09b1cc..cbde53e15 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpace_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_UndefineSpace_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_UndefineSpace_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_WriteLock_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_WriteLock_fp.h index 68a8d344e..21ae5d95d 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_WriteLock_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_WriteLock_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_WriteLock_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Write_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Write_fp.h index de0b76f3d..9480c774a 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Write_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NV_Write_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NV_Write_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NvReserved_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NvReserved_fp.h index e2e1cf310..908daa5c4 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/NvReserved_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/NvReserved_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: NVReserved_fp.h 1476 2019-06-10 19:32:03Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ObjectChangeAuth_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ObjectChangeAuth_fp.h index f9deff382..3953a3826 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ObjectChangeAuth_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ObjectChangeAuth_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ObjectChangeAuth_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Allocate_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Allocate_fp.h index dab75c6e5..d66978f18 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Allocate_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Allocate_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PCR_Allocate_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Event_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Event_fp.h index 130fbb8c3..89b877ec9 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Event_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Event_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PCR_Event_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Extend_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Extend_fp.h index 0b38058cd..2799ab672 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Extend_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Extend_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PCR_Extend_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Read_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Read_fp.h index ac94cc9f4..fbc1ef898 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Read_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Read_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PCR_Read_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Reset_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Reset_fp.h index e7c581eae..55cb9621a 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Reset_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_Reset_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PCR_Reset_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthPolicy_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthPolicy_fp.h index 8c1b43bb5..cae53b885 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthPolicy_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthPolicy_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PCR_SetAuthPolicy_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthValue_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthValue_fp.h index 00073ad32..3cfc9df13 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthValue_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PCR_SetAuthValue_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PCR_SetAuthValue_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_Commands_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_Commands_fp.h index 1af15abc2..b75f8f77b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_Commands_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_Commands_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PP_Commands_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_fp.h index df7daf540..5a9cb9581 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PP_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthValue_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthValue_fp.h index 81993b369..6864a112c 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthValue_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthValue_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyAuthValue_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorizeNV_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorizeNV_fp.h index f1b71629b..31aff24b2 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorizeNV_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorizeNV_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyAuthorizeNV_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorize_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorize_fp.h index ed8fd4528..962266993 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorize_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyAuthorize_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyAuthorize_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCapability_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCapability_fp.h index a1581568c..bb924bee2 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCapability_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCapability_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCommandCode_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCommandCode_fp.h index b83057a1e..3c8f1fb6f 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCommandCode_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCommandCode_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyCommandCode_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCounterTimer_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCounterTimer_fp.h index 8f1b0fcd8..03ab1972e 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCounterTimer_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCounterTimer_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyCounterTimer_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCpHash_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCpHash_fp.h index 4ae2a1ae2..e8e2d93f7 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCpHash_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyCpHash_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyCpHash_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyDuplicationSelect_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyDuplicationSelect_fp.h index 5dd4a9e35..ffad1b384 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyDuplicationSelect_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyDuplicationSelect_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyDuplicationSelect_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyGetDigest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyGetDigest_fp.h index 341d7e25c..ba2852e28 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyGetDigest_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyGetDigest_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyGetDigest_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyLocality_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyLocality_fp.h index 20426c3ae..bece261e1 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyLocality_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyLocality_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyLocality_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNV_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNV_fp.h index ad3f56356..9b52a7184 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNV_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNV_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyNV_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNameHash_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNameHash_fp.h index e12be208e..4fda016b7 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNameHash_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNameHash_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyNameHash_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNvWritten_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNvWritten_fp.h index d0d54e55b..4905de165 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNvWritten_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyNvWritten_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyNvWritten_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyOR_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyOR_fp.h index 1eb6dc7b2..d470477c0 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyOR_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyOR_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyOR_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPCR_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPCR_fp.h index ab6f14df7..e19d03c9f 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPCR_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPCR_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyPCR_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyParameters_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyParameters_fp.h index 0fc77e5ad..32f1acb7f 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyParameters_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyParameters_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPassword_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPassword_fp.h index 35f1e5ba4..d47c6a286 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPassword_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPassword_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyPassword_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPhysicalPresence_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPhysicalPresence_fp.h index 57973f260..d09e69ae9 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPhysicalPresence_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyPhysicalPresence_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyPhysicalPresence_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyRestart_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyRestart_fp.h index 0bf8ae81a..ccabc183e 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyRestart_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyRestart_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyRestart_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySecret_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySecret_fp.h index 87bde53ca..113628597 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySecret_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySecret_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicySecret_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySigned_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySigned_fp.h index faae23db6..e7c251637 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySigned_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicySigned_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicySigned_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTemplate_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTemplate_fp.h index 372cc43fe..9cee56046 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTemplate_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTemplate_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyTemplate_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTicket_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTicket_fp.h index d591ca1ba..dcbb83fdd 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTicket_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PolicyTicket_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PolicyTicket_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Power_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Power_fp.h index e19a5f2c7..acbaa1465 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Power_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Power_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Functions That Receive the Simulated Power State Transitions of the TPM */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Power_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PropertyCap_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PropertyCap_fp.h index 7a012f6c3..bb32c935b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/PropertyCap_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/PropertyCap_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Quote_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Quote_fp.h index 991a529da..bf63c8132 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Quote_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Quote_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Quote_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Decrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Decrypt_fp.h index 52bd5b7e8..64aa9bffe 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Decrypt_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Decrypt_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: RSA_Decrypt_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Encrypt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Encrypt_fp.h index ace0c11c9..b82ab4307 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Encrypt_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/RSA_Encrypt_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: RSA_Encrypt_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadClock_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadClock_fp.h index a6c6f0afd..405f9befa 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadClock_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadClock_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ReadClock_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadPublic_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadPublic_fp.h index 4b95ebdfd..8604580cf 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadPublic_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ReadPublic_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ReadPublic_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ResponseCodeProcessing_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ResponseCodeProcessing_fp.h index 1f97c20be..227ccff8b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ResponseCodeProcessing_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ResponseCodeProcessing_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ResponseCodeProcessing_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Response_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Response_fp.h index 77e75a792..7fd9d3744 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Response_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Response_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Response_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Rewrap_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Rewrap_fp.h index 201e67852..fae583343 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Rewrap_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Rewrap_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Rewrap_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SelfTest_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SelfTest_fp.h index e1ba1a5ac..f5f9306bf 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SelfTest_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SelfTest_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: SelfTest_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceComplete_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceComplete_fp.h index 574db088a..644ab12ac 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceComplete_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceComplete_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: SequenceComplete_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceUpdate_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceUpdate_fp.h index 1bcc0ba15..919f2a9be 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceUpdate_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SequenceUpdate_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: SequenceUpdate_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Session_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Session_fp.h index ba3e9050a..22648315d 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Session_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Session_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetAlgorithmSet_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetAlgorithmSet_fp.h index a11b8a43c..5b074ae3a 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetAlgorithmSet_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetAlgorithmSet_fp.h @@ -1,64 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: SetAlgorithmSet_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPO -SE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCapability_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCapability_fp.h index 8821053be..a12921f0c 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCapability_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCapability_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #if CC_SetCapability // Command must be enabled diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCommandCodeAuditStatus_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCommandCodeAuditStatus_fp.h index aaa94c46b..800033313 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCommandCodeAuditStatus_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetCommandCodeAuditStatus_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: SetCommandCodeAuditStatus_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetPrimaryPolicy_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetPrimaryPolicy_fp.h index 05ec3331b..4aed86bfb 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetPrimaryPolicy_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/SetPrimaryPolicy_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM2_SetPrimaryPolicy Command Header */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: SetPrimaryPolicy_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Shutdown_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Shutdown_fp.h index ed04e5ce2..87ac70a0a 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Shutdown_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Shutdown_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Shutdown_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Sign_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Sign_fp.h index 35fc8c900..913382485 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Sign_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Sign_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Sign_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/StartAuthSession_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/StartAuthSession_fp.h index bcf530783..6337f28f4 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/StartAuthSession_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/StartAuthSession_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: StartAuthSession_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Startup_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Startup_fp.h index 0699022d9..82922bf1b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Startup_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Startup_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Startup_fp.h 1521 2019-11-15 21:00:47Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/StirRandom_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/StirRandom_fp.h index a05139d82..7f43c6c6d 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/StirRandom_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/StirRandom_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: StirRandom_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TestParms_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TestParms_fp.h index f744f80cd..3dd3abe40 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TestParms_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TestParms_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: TestParms_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Ticket_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Ticket_fp.h index 2cc80b45c..e7ce4d7e6 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Ticket_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Ticket_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Time_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Time_fp.h index 56f74a275..53dc89c16 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Time_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Time_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Functions relating to the TPM's time functions */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmASN1_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmASN1_fp.h index 0d1f2ae95..91bba7c8e 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmASN1_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmASN1_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM ASN.1 */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_ECDAA_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_ECDAA_fp.h index 4be2058d9..9b1765fa1 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_ECDAA_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_ECDAA_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _TPMECC_SIGNATURE_ECDAA_FP_H_ #define _TPMECC_SIGNATURE_ECDAA_FP_H_ diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_SM2_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_SM2_fp.h index 303c3a996..e66d14dc5 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_SM2_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_SM2_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _TPMECC_SIGNATURE_SM2_FP_H_ #define _TPMECC_SIGNATURE_SM2_FP_H_ diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Schnorr_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Schnorr_fp.h index c7c4b46af..19d89cd49 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Schnorr_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Schnorr_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _TPMECC_SIGNATURE_SCHNORR_FP_H_ #define _TPMECC_SIGNATURE_SCHNORR_FP_H_ diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Util_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Util_fp.h index f36249247..6fb88ee70 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Util_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Signature_Util_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // functions shared by multiple signature algorithms #ifndef _TPMECC_SIGNATURE_UTIL_FP_H_ diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Util_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Util_fp.h index a2ca3e093..9c9aa1f89 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Util_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmEcc_Util_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _TPMECC_UTIL_FP_H_ #define _TPMECC_UTIL_FP_H_ diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Debug_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Debug_fp.h index 14314de4a..449a24610 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Debug_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Debug_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // // debug and test utilities. Not expected to be compiled into final products diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Util_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Util_fp.h index 7072816f0..a34cbadfe 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Util_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmMath_Util_fp.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _TPM_MATH_FP_H_ #define _TPM_MATH_FP_H_ diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmSizeChecks_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmSizeChecks_fp.h index 695a63be7..eac18c859 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmSizeChecks_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/TpmSizeChecks_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Check COmpiler Options */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: TpmSizeChecks_fp.h 1519 2019-11-15 20:43:51Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Unseal_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Unseal_fp.h index 83a3ad945..afce5fe7b 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/Unseal_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/Unseal_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Unseal_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/VerifySignature_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/VerifySignature_fp.h index 17719e1dd..4365202fc 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/VerifySignature_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/VerifySignature_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: VerifySignature_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_ECC_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_ECC_fp.h index e570c3dcc..c19ffcee8 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_ECC_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_ECC_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM X509 ECC */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: X509_ECC_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_RSA_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_RSA_fp.h index 6f4cd1ee7..392f5ab34 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_RSA_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_RSA_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* TPM X509 RSA */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: X509_RSA_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_spt_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_spt_fp.h index 268feafcc..22b3b52a3 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_spt_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/X509_spt_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* X509 Support */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: X509_spt_fp.h 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019. */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmPrototypes; Version 3.0 July 18, 2017 diff --git a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ZGen_2Phase_fp.h b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ZGen_2Phase_fp.h index 252d2e8e4..0cc9842f1 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/prototypes/ZGen_2Phase_fp.h +++ b/src/tpm2/TPMCmd/tpm/include/private/prototypes/ZGen_2Phase_fp.h @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ZGen_2Phase_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012-2015 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause // FILE GENERATED BY TpmExtractCode: DO NOT EDIT diff --git a/src/tpm2/TPMCmd/tpm/include/tpm_public/MinMax.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/MinMax.h index e7e693f71..b108beaf9 100644 --- a/src/tpm2/TPMCmd/tpm/include/tpm_public/MinMax.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/MinMax.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Min Max Macros */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _MIN_MAX_H_ diff --git a/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmCalculatedAttributes.h b/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmCalculatedAttributes.h index e1b7eac53..c9541c1fb 100644 --- a/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmCalculatedAttributes.h +++ b/src/tpm2/TPMCmd/tpm/include/tpm_public/TpmCalculatedAttributes.h @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #ifndef _TPM_CALCULATED_ATTRIBUTES_H_ #define _TPM_CALCULATED_ATTRIBUTES_H_ diff --git a/src/tpm2/TPMCmd/tpm/src/command/Attestation/Attest_spt.c b/src/tpm2/TPMCmd/tpm/src/command/Attestation/Attest_spt.c index 12bccad56..8414c9b60 100644 --- a/src/tpm2/TPMCmd/tpm/src/command/Attestation/Attest_spt.c +++ b/src/tpm2/TPMCmd/tpm/src/command/Attestation/Attest_spt.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Attest_spt.c 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes #include "Tpm.h" diff --git a/src/tpm2/TPMCmd/tpm/src/command/ClockTimer/ACT_spt.c b/src/tpm2/TPMCmd/tpm/src/command/ClockTimer/ACT_spt.c index c3bcef070..bf3254306 100644 --- a/src/tpm2/TPMCmd/tpm/src/command/ClockTimer/ACT_spt.c +++ b/src/tpm2/TPMCmd/tpm/src/command/ClockTimer/ACT_spt.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* ACT Command Support */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This code implements the ACT update code. It does not use a mutex. This code uses diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccCrypt.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccCrypt.c index 6fa62aca1..10aef195b 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccCrypt.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccCrypt.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Asymmetric ECC Commands */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2022 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Includes and Defines #include "Tpm.h" diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccData.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccData.c index 658f7da0f..c1b6afeed 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccData.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/CryptEccData.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* ECC curve data */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2018 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause /*(Auto-generated) * Created by TpmStructures; Version 4.4 Mar 26, 2019 diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/CryptSmac.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptSmac.c index 2c8809935..4d6af6d0f 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/CryptSmac.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/CryptSmac.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Message Authentication Codes Based on a Symmetric Block Cipher */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: CryptSmac.c 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2018 - 2021 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c b/src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c index ee29082a5..e1975645a 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/CryptUtil.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Interfaces to the Crypto Engine */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/Ticket.c b/src/tpm2/TPMCmd/tpm/src/crypt/Ticket.c index 6776841f4..f8f9d56e0 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/Ticket.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/Ticket.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Functions used for ticket computations. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction /* diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_ECDAA.c b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_ECDAA.c index db171ccf5..dc13f3d36 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_ECDAA.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_ECDAA.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #include "Tpm.h" #include "TpmEcc_Signature_ECDAA_fp.h" diff --git a/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Schnorr.c b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Schnorr.c index ffdca59a2..b310b5e3e 100644 --- a/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Schnorr.c +++ b/src/tpm2/TPMCmd/tpm/src/crypt/ecc/TpmEcc_Signature_Schnorr.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause #include "Tpm.h" #include "TpmEcc_Signature_Schnorr_fp.h" diff --git a/src/tpm2/TPMCmd/tpm/src/subsystem/CommandAudit.c b/src/tpm2/TPMCmd/tpm/src/subsystem/CommandAudit.c index c546dd117..2138efda5 100644 --- a/src/tpm2/TPMCmd/tpm/src/subsystem/CommandAudit.c +++ b/src/tpm2/TPMCmd/tpm/src/subsystem/CommandAudit.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Functions That Support Command Audit */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the functions that support command audit. diff --git a/src/tpm2/TPMCmd/tpm/src/subsystem/DA.c b/src/tpm2/TPMCmd/tpm/src/subsystem/DA.c index 07262aafd..ca5372a98 100644 --- a/src/tpm2/TPMCmd/tpm/src/subsystem/DA.c +++ b/src/tpm2/TPMCmd/tpm/src/subsystem/DA.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Dictionary Attack Logic. */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: DA.c 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // This file contains the functions and data definitions relating to the diff --git a/src/tpm2/TPMCmd/tpm/src/support/AlgorithmCap.c b/src/tpm2/TPMCmd/tpm/src/support/AlgorithmCap.c index d2becd807..2caf9ba26 100644 --- a/src/tpm2/TPMCmd/tpm/src/support/AlgorithmCap.c +++ b/src/tpm2/TPMCmd/tpm/src/support/AlgorithmCap.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Algorithm Property Definitions */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // This file contains the algorithm property definitions for the algorithms and the diff --git a/src/tpm2/TPMCmd/tpm/src/support/Marshal.c b/src/tpm2/TPMCmd/tpm/src/support/Marshal.c index ef4b3cb27..23d1eb600 100644 --- a/src/tpm2/TPMCmd/tpm/src/support/Marshal.c +++ b/src/tpm2/TPMCmd/tpm/src/support/Marshal.c @@ -1,64 +1,43 @@ +// SPDX-License-Identifier: BSD-2-Clause + /********************************************************************************/ /* */ /* Parameter Marshaling */ /* Written by Ken Goldman */ /* IBM Thomas J. Watson Research Center */ /* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ +/* (c) Copyright IBM Corporation 2015 - 2026. */ /* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are */ +/* met: */ +/* */ +/* Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the following disclaimer. */ +/* */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the names of the IBM Corporation nor the names of its */ +/* contributors may be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ +/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ +/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ +/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ +/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ +/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ +/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /********************************************************************************/ - #include // libtpms added #include diff --git a/src/tpm2/TPMCmd/tpm/src/support/MathOnByteBuffers.c b/src/tpm2/TPMCmd/tpm/src/support/MathOnByteBuffers.c index da7d0a9ed..ece710147 100644 --- a/src/tpm2/TPMCmd/tpm/src/support/MathOnByteBuffers.c +++ b/src/tpm2/TPMCmd/tpm/src/support/MathOnByteBuffers.c @@ -1,62 +1,4 @@ -/********************************************************************************/ -/* */ -/* Math functions performed with canonical integers in byte buffers */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Introduction // diff --git a/src/tpm2/TPMCmd/tpm/src/support/Power.c b/src/tpm2/TPMCmd/tpm/src/support/Power.c index 5c313ea8d..e9b0c9531 100644 --- a/src/tpm2/TPMCmd/tpm/src/support/Power.c +++ b/src/tpm2/TPMCmd/tpm/src/support/Power.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Simulated Power State Transitions of the TPM */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Power.c 1490 2019-07-26 21:13:22Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2019 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description diff --git a/src/tpm2/TPMCmd/tpm/src/support/Response.c b/src/tpm2/TPMCmd/tpm/src/support/Response.c index a7f67ba46..e3be4f474 100644 --- a/src/tpm2/TPMCmd/tpm/src/support/Response.c +++ b/src/tpm2/TPMCmd/tpm/src/support/Response.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: Response.c 1259 2018-07-10 19:11:09Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // This file contains the common code for building a response header, including diff --git a/src/tpm2/TPMCmd/tpm/src/support/ResponseCodeProcessing.c b/src/tpm2/TPMCmd/tpm/src/support/ResponseCodeProcessing.c index c8a704052..aa2a5daf9 100644 --- a/src/tpm2/TPMCmd/tpm/src/support/ResponseCodeProcessing.c +++ b/src/tpm2/TPMCmd/tpm/src/support/ResponseCodeProcessing.c @@ -1,63 +1,4 @@ -/********************************************************************************/ -/* */ -/* Miscellaneous Functions For Processing Response Codes */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: ResponseCodeProcessing.c 1259 2018-07-10 19:11:09Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2018 */ -/* */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause //** Description // This file contains the miscellaneous functions for processing response codes. diff --git a/src/tpm2/Unmarshal.c b/src/tpm2/Unmarshal.c index 2e319e165..32cb30ef7 100644 --- a/src/tpm2/Unmarshal.c +++ b/src/tpm2/Unmarshal.c @@ -1,40 +1,12 @@ -/********************************************************************************/ -/* */ -/* Parameter Unmarshaling */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2015 - 2024 */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2015 - 2024 +// +// All rights reserved. +// +// Neither the names of the IBM Corporation nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. /* rev 136 */ diff --git a/src/tpm2/Unmarshal_fp.h b/src/tpm2/Unmarshal_fp.h index 27643c659..8a28e6f8e 100644 --- a/src/tpm2/Unmarshal_fp.h +++ b/src/tpm2/Unmarshal_fp.h @@ -1,61 +1,41 @@ +// SPDX-License-Identifier: BSD-2-Clause + /********************************************************************************/ /* */ /* Unmarshal Prototypes */ /* Written by Ken Goldman */ /* IBM Thomas J. Watson Research Center */ /* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2012 - 2023 */ +/* (c) Copyright IBM Corporation 2015 - 2026 */ /* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are */ +/* met: */ +/* */ +/* Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the following disclaimer. */ +/* */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the names of the IBM Corporation nor the names of its */ +/* contributors may be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ +/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ +/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ +/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ +/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ +/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ +/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /********************************************************************************/ /* rev 136 */ diff --git a/src/tpm2/Utils.h b/src/tpm2/Utils.h index a8d4749fb..e79072d63 100644 --- a/src/tpm2/Utils.h +++ b/src/tpm2/Utils.h @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Utility functions */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2017,2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2017,2018. #ifndef UTILS_H #define UTILS_H diff --git a/src/tpm2/Volatile.c b/src/tpm2/Volatile.c index 4a50d6b05..c0d30f3a3 100644 --- a/src/tpm2/Volatile.c +++ b/src/tpm2/Volatile.c @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Marshalling and unmarshalling of state */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2017,2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2017,2018. #if defined __FreeBSD__ || defined __DragonFly__ # include diff --git a/src/tpm2/Volatile.h b/src/tpm2/Volatile.h index 512a46f44..3fd704c18 100644 --- a/src/tpm2/Volatile.h +++ b/src/tpm2/Volatile.h @@ -1,40 +1,6 @@ -/********************************************************************************/ -/* */ -/* Marshalling and unmarshalling of state */ -/* Written by Stefan Berger */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* (c) Copyright IBM Corporation 2017,2018. */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following conditions are */ -/* met: */ -/* */ -/* Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the following disclaimer. */ -/* */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the names of the IBM Corporation nor the names of its */ -/* contributors may be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ -/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ -/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ -/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/********************************************************************************/ +// SPDX-License-Identifier: BSD-2-Clause + +// (c) Copyright IBM Corporation 2017,2018. #ifndef VOLATILE_H #define VOLATILE_H diff --git a/src/tpm2/gensymtestsdata.sh b/src/tpm2/gensymtestsdata.sh index 1c51c2f53..742c48a2a 100755 --- a/src/tpm2/gensymtestsdata.sh +++ b/src/tpm2/gensymtestsdata.sh @@ -1,4 +1,5 @@ #!/bin/bash +# SPDX-License-Identifier: BSD-2-Clause function do_aes() { local data="$1" From 023ca08f969ab4f82b9c215a933a196d2c1e7eb7 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 27 Jan 2026 15:56:47 -0500 Subject: [PATCH 51/52] Sync: Remove some unused files Signed-off-by: Stefan Berger --- src/Makefile.am | 4 -- src/tpm2/DebugHelpers_fp.h | 83 ---------------------- src/tpm2/PlatformACT_fp.h | 104 --------------------------- src/tpm2/Platform_fp.h | 62 ----------------- src/tpm2/TcpServerPosix_fp.h | 131 ----------------------------------- src/tpm_tpm2_tis.c | 2 +- 6 files changed, 1 insertion(+), 385 deletions(-) delete mode 100644 src/tpm2/DebugHelpers_fp.h delete mode 100644 src/tpm2/PlatformACT_fp.h delete mode 100644 src/tpm2/Platform_fp.h delete mode 100644 src/tpm2/TcpServerPosix_fp.h diff --git a/src/Makefile.am b/src/Makefile.am index 0021fffcf..338751182 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -333,10 +333,6 @@ noinst_HEADERS += \ compiler.h \ tpm2/TPMCmd/tpm/include/private/prototypes/CryptCmac_fp.h \ tpm2/CryptDes_fp.h \ - tpm2/DebugHelpers_fp.h \ - tpm2/PlatformACT_fp.h \ - tpm2/Platform_fp.h \ - tpm2/TcpServerPosix_fp.h \ tpm2/TPMCmd/Platform/include/PlatformACT.h \ tpm2/TPMCmd/Platform/include/PlatformClock.h \ tpm2/TPMCmd/Platform/include/PlatformData.h \ diff --git a/src/tpm2/DebugHelpers_fp.h b/src/tpm2/DebugHelpers_fp.h deleted file mode 100644 index 6e74cd449..000000000 --- a/src/tpm2/DebugHelpers_fp.h +++ /dev/null @@ -1,83 +0,0 @@ -/********************************************************************************/ -/* */ -/* Debug Helper */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: DebugHelpers_fp.h 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 - 2021 */ -/* */ -/********************************************************************************/ -#ifndef DEBUGHELPERS_FP_H -#define DEBUGHELPERS_FP_H - -int -DebugFileInit( - void - ); -void -DebugFileClose( - void - ); -void -DebugDumpBuffer( - int size, - unsigned char *buf, - const char *identifier - ); - - - - - -#endif diff --git a/src/tpm2/PlatformACT_fp.h b/src/tpm2/PlatformACT_fp.h deleted file mode 100644 index 5d2caf517..000000000 --- a/src/tpm2/PlatformACT_fp.h +++ /dev/null @@ -1,104 +0,0 @@ -/********************************************************************************/ -/* */ -/* Platform Authenticated Countdown Timer */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: PlatformACT_fp.h 1531 2019-11-21 23:54:38Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2019 */ -/* */ -/********************************************************************************/ - -#ifndef PLATFORMACT_FP_H -#define PLATFORMACT_FP_H - -LIB_EXPORT int -_plat__ACT_GetImplemented( - uint32_t act - ); -LIB_EXPORT uint32_t -_plat__ACT_GetRemaining( - uint32_t act //IN: the ACT selector - ); -LIB_EXPORT int -_plat__ACT_GetSignaled( - uint32_t act //IN: number of ACT to check - ); -LIB_EXPORT void -_plat__ACT_SetSignaled( - uint32_t act, - int on - ); -LIB_EXPORT int -_plat__ACT_GetPending( - uint32_t act //IN: number of ACT to check - ); -LIB_EXPORT int -_plat__ACT_UpdateCounter( - uint32_t act, // IN: ACT to update - uint32_t newValue // IN: the value to post - ); -LIB_EXPORT void -_plat__ACT_EnableTicks( - int enable - ); -LIB_EXPORT void -_plat__ACT_Tick( - void - ); -LIB_EXPORT int -_plat__ACT_Initialize( - void - ); - -#endif diff --git a/src/tpm2/Platform_fp.h b/src/tpm2/Platform_fp.h deleted file mode 100644 index a428cc7b7..000000000 --- a/src/tpm2/Platform_fp.h +++ /dev/null @@ -1,62 +0,0 @@ -/********************************************************************************/ -/* */ -/* NV read and write access methods */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2023 */ -/* */ -/********************************************************************************/ - -#include // libtpms added - diff --git a/src/tpm2/TcpServerPosix_fp.h b/src/tpm2/TcpServerPosix_fp.h deleted file mode 100644 index d984130ae..000000000 --- a/src/tpm2/TcpServerPosix_fp.h +++ /dev/null @@ -1,131 +0,0 @@ -/********************************************************************************/ -/* */ -/* Socket Interface to a TPM Simulator */ -/* Written by Ken Goldman */ -/* IBM Thomas J. Watson Research Center */ -/* $Id: TcpServerPosix_fp.h 1658 2021-01-22 23:14:01Z kgoldman $ */ -/* */ -/* Licenses and Notices */ -/* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp. and others, 2016 - 2021 */ -/* */ -/********************************************************************************/ - -#ifndef TCPSERVERPOSIX_FP_H -#define TCPSERVERPOSIX_FP_H - -#include -#include -#include -#include -#include - -#include "CompilerDependencies.h" -#include "BaseTypes.h" - -bool -PlatformServer( - SOCKET s - ); -int -PlatformSvcRoutine( - void *port - ); -int -PlatformSignalService( - int *PortNumberPlatform - ); -int -RegularCommandService( - int *PortNumber - ); -int -StartTcpServer( - int *PortNumber, - int *PortNumberPlatform - ); -bool -ReadBytes( - SOCKET s, - char *buffer, - int NumBytes - ); -bool -WriteBytes( - SOCKET s, - char *buffer, - int NumBytes - ); -bool -WriteUINT32( - SOCKET s, - UINT32 val - ); -bool -ReadVarBytes( - SOCKET s, - char *buffer, - UINT32 *BytesReceived, - int MaxLen - ); -bool -WriteVarBytes( - SOCKET s, - char *buffer, - int BytesToSend - ); -bool -TpmServer( - SOCKET s - ); - - -#endif diff --git a/src/tpm_tpm2_tis.c b/src/tpm_tpm2_tis.c index b8bda48e3..50676315a 100644 --- a/src/tpm_tpm2_tis.c +++ b/src/tpm_tpm2_tis.c @@ -42,8 +42,8 @@ #include "Tpm.h" #include "TpmTcpProtocol.h" -#include "Platform_fp.h" #include "Simulator_fp.h" +#include "prototypes/platform_public_interface.h" #define TPM_HAVE_TPM2_DECLARATIONS #include "tpm_library_intern.h" From 307d1a916b8a1687df355d98678cd8dc17c7b607 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 11 Feb 2026 17:01:01 -0500 Subject: [PATCH 52/52] Sync: Sync up the order of some #define's to match 'upstream' Signed-off-by: Stefan Berger --- .../tpm/include/private/CommandDispatchData.h | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/tpm2/TPMCmd/tpm/include/private/CommandDispatchData.h b/src/tpm2/TPMCmd/tpm/include/private/CommandDispatchData.h index efc80f896..9823eac2c 100644 --- a/src/tpm2/TPMCmd/tpm/include/private/CommandDispatchData.h +++ b/src/tpm2/TPMCmd/tpm/include/private/CommandDispatchData.h @@ -81,7 +81,19 @@ const _UNMARSHAL_T_ unmarshalArray[] = { UNMARSHAL_DISPATCH(TPMI_RH_HIERARCHY), // PARAMETER_FIRST_TYPE marks the end of the handle list. #define PARAMETER_FIRST_TYPE (TPMI_RH_HIERARCHY_H_UNMARSHAL + 1) -#define TPM2B_DATA_P_UNMARSHAL (TPMI_RH_HIERARCHY_H_UNMARSHAL + 1) +#define TPM_AT_P_UNMARSHAL (TPMI_RH_HIERARCHY_H_UNMARSHAL + 1) + UNMARSHAL_DISPATCH(TPM_AT), +#define TPM_CAP_P_UNMARSHAL (TPM_AT_P_UNMARSHAL + 1) + UNMARSHAL_DISPATCH(TPM_CAP), +#define TPM_CLOCK_ADJUST_P_UNMARSHAL (TPM_CAP_P_UNMARSHAL + 1) + UNMARSHAL_DISPATCH(TPM_CLOCK_ADJUST), +#define TPM_EO_P_UNMARSHAL (TPM_CLOCK_ADJUST_P_UNMARSHAL + 1) + UNMARSHAL_DISPATCH(TPM_EO), +#define TPM_SE_P_UNMARSHAL (TPM_EO_P_UNMARSHAL + 1) + UNMARSHAL_DISPATCH(TPM_SE), +#define TPM_SU_P_UNMARSHAL (TPM_SE_P_UNMARSHAL + 1) + UNMARSHAL_DISPATCH(TPM_SU), +#define TPM2B_DATA_P_UNMARSHAL (TPM_SU_P_UNMARSHAL + 1) UNMARSHAL_DISPATCH(TPM2B_DATA), #define TPM2B_DIGEST_P_UNMARSHAL (TPM2B_DATA_P_UNMARSHAL + 1) UNMARSHAL_DISPATCH(TPM2B_DIGEST), @@ -150,21 +162,9 @@ const _UNMARSHAL_T_ unmarshalArray[] = { #define TPMT_TK_HASHCHECK_P_UNMARSHAL (TPMT_TK_CREATION_P_UNMARSHAL + 1) UNMARSHAL_DISPATCH(TPMT_TK_HASHCHECK), #define TPMT_TK_VERIFIED_P_UNMARSHAL (TPMT_TK_HASHCHECK_P_UNMARSHAL + 1) - UNMARSHAL_DISPATCH(TPMT_TK_VERIFIED), -#define TPM_AT_P_UNMARSHAL (TPMT_TK_VERIFIED_P_UNMARSHAL + 1) - UNMARSHAL_DISPATCH(TPM_AT), -#define TPM_CAP_P_UNMARSHAL (TPM_AT_P_UNMARSHAL + 1) - UNMARSHAL_DISPATCH(TPM_CAP), -#define TPM_CLOCK_ADJUST_P_UNMARSHAL (TPM_CAP_P_UNMARSHAL + 1) - UNMARSHAL_DISPATCH(TPM_CLOCK_ADJUST), -#define TPM_EO_P_UNMARSHAL (TPM_CLOCK_ADJUST_P_UNMARSHAL + 1) - UNMARSHAL_DISPATCH(TPM_EO), -#define TPM_SE_P_UNMARSHAL (TPM_EO_P_UNMARSHAL + 1) - UNMARSHAL_DISPATCH(TPM_SE), -#define TPM_SU_P_UNMARSHAL (TPM_SE_P_UNMARSHAL + 1) - UNMARSHAL_DISPATCH(TPM_SU), -#define UINT16_P_UNMARSHAL (TPM_SU_P_UNMARSHAL + 1) - UNMARSHAL_DISPATCH(UINT16), + UNMARSHAL_DISPATCH(TPMT_TK_VERIFIED), +#define UINT16_P_UNMARSHAL (TPMT_TK_VERIFIED_P_UNMARSHAL + 1) + UNMARSHAL_DISPATCH(UINT16), #define UINT32_P_UNMARSHAL (UINT16_P_UNMARSHAL + 1) UNMARSHAL_DISPATCH(UINT32), #define UINT64_P_UNMARSHAL (UINT32_P_UNMARSHAL + 1) @@ -195,11 +195,11 @@ const _UNMARSHAL_T_ unmarshalArray[] = { UNMARSHAL_DISPATCH(TPMT_KDF_SCHEME), #define TPMT_RSA_DECRYPT_P_UNMARSHAL (TPMT_KDF_SCHEME_P_UNMARSHAL + 1) UNMARSHAL_DISPATCH(TPMT_RSA_DECRYPT), -#define TPMT_SIGNATURE_P_UNMARSHAL (TPMT_RSA_DECRYPT_P_UNMARSHAL + 1) - UNMARSHAL_DISPATCH(TPMT_SIGNATURE), -#define TPMT_SIG_SCHEME_P_UNMARSHAL (TPMT_SIGNATURE_P_UNMARSHAL + 1) +#define TPMT_SIG_SCHEME_P_UNMARSHAL (TPMT_RSA_DECRYPT_P_UNMARSHAL + 1) UNMARSHAL_DISPATCH(TPMT_SIG_SCHEME), -#define TPMT_SYM_DEF_P_UNMARSHAL (TPMT_SIG_SCHEME_P_UNMARSHAL + 1) +#define TPMT_SIGNATURE_P_UNMARSHAL (TPMT_SIG_SCHEME_P_UNMARSHAL + 1) + UNMARSHAL_DISPATCH(TPMT_SIGNATURE), +#define TPMT_SYM_DEF_P_UNMARSHAL (TPMT_SIGNATURE_P_UNMARSHAL + 1) UNMARSHAL_DISPATCH(TPMT_SYM_DEF), #define TPMT_SYM_DEF_OBJECT_P_UNMARSHAL (TPMT_SYM_DEF_P_UNMARSHAL + 1) UNMARSHAL_DISPATCH(TPMT_SYM_DEF_OBJECT) @@ -251,9 +251,7 @@ const _MARSHAL_T_ marshalArray[] = { MARSHAL_DISPATCH(TPM2B_SENSITIVE_DATA), #define TPM2B_TIMEOUT_P_MARSHAL (TPM2B_SENSITIVE_DATA_P_MARSHAL + 1) MARSHAL_DISPATCH(TPM2B_TIMEOUT), -#define UINT8_P_MARSHAL (TPM2B_TIMEOUT_P_MARSHAL + 1) - MARSHAL_DISPATCH(UINT8), -#define TPML_AC_CAPABILITIES_P_MARSHAL (UINT8_P_MARSHAL + 1) +#define TPML_AC_CAPABILITIES_P_MARSHAL (TPM2B_TIMEOUT_P_MARSHAL + 1) MARSHAL_DISPATCH(TPML_AC_CAPABILITIES), #define TPML_ALG_P_MARSHAL (TPML_AC_CAPABILITIES_P_MARSHAL + 1) MARSHAL_DISPATCH(TPML_ALG), @@ -285,12 +283,14 @@ const _MARSHAL_T_ marshalArray[] = { MARSHAL_DISPATCH(TPMT_TK_HASHCHECK), #define TPMT_TK_VERIFIED_P_MARSHAL (TPMT_TK_HASHCHECK_P_MARSHAL + 1) MARSHAL_DISPATCH(TPMT_TK_VERIFIED), -#define UINT32_P_MARSHAL (TPMT_TK_VERIFIED_P_MARSHAL + 1) +#define UINT16_P_MARSHAL (TPMT_TK_VERIFIED_P_MARSHAL + 1) + MARSHAL_DISPATCH(UINT16), +#define UINT32_P_MARSHAL (UINT16_P_MARSHAL + 1) MARSHAL_DISPATCH(UINT32), -#define UINT16_P_MARSHAL (UINT32_P_MARSHAL + 1) - MARSHAL_DISPATCH(UINT16) +#define UINT8_P_MARSHAL (UINT32_P_MARSHAL + 1) + MARSHAL_DISPATCH(UINT8) // RESPONSE_PARAMETER_LAST_TYPE is the index of the last response parameter. -#define RESPONSE_PARAMETER_LAST_TYPE (UINT16_P_MARSHAL) +#define RESPONSE_PARAMETER_LAST_TYPE (UINT8_P_MARSHAL) }; // This list of aliases allows the types in the _COMMAND_DESCRIPTOR_t to match