From 211103557fcaf7b79532af40c585c632f45fdbc4 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Sun, 14 Dec 2025 13:39:49 -0500 Subject: [PATCH 1/5] tpm2: Revert some minor comment changes (clean files) To get some files into the state so that they can be easily replaced with the BSD-licensed code, revert: - spelling changes that were introduced by nicolas.iooss@ledger.fr in bbd7b75d71. Many of the changes introduced in that change were replaced in subsequence changes with the original spelling errors in the upstream code. - LibreSSL support introduced by orbea in 95fff22c9b and 7310725524. Signed-off-by: Stefan Berger --- src/tpm2/Global.h | 2 +- src/tpm2/crypto/openssl/BnToOsslMath.c | 2 +- src/tpm2/crypto/openssl/CryptPrime.c | 2 +- src/tpm2/crypto/openssl/tpm_radix.h | 12 ++++++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/tpm2/Global.h b/src/tpm2/Global.h index b225cb46e..b9b2a35d9 100644 --- a/src/tpm2/Global.h +++ b/src/tpm2/Global.h @@ -992,7 +992,7 @@ typedef struct orderly_data # endif // ACCUMULATE_SELF_HEAL_TIMER #ifndef __ACT_DISABLED // libtpms added -#error ACT not supported in ORDERLY_DATA! +#error ACT not suported in ORDERLY_DATA! // These are the ACT Timeout values. They are saved with the other timers # define DefineActData(N) ACT_STATE ACT_##N; FOR_EACH_ACT(DefineActData) diff --git a/src/tpm2/crypto/openssl/BnToOsslMath.c b/src/tpm2/crypto/openssl/BnToOsslMath.c index 290f9fa3a..d305f3063 100644 --- a/src/tpm2/crypto/openssl/BnToOsslMath.c +++ b/src/tpm2/crypto/openssl/BnToOsslMath.c @@ -622,7 +622,7 @@ LIB_EXPORT BOOL BnEccModMult2(bigPoint R, // OUT: computed point EC_POINT_mul(E->G, pR, bnD, pQ, bnU, E->CTX); else { -#if OPENSSL_VERSION_NUMBER >= 0x30000000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x4010000fL) +#if OPENSSL_VERSION_NUMBER >= 0x30000000L EC_POINT *pR1 = EC_POINT_new(E->G); EC_POINT *pR2 = EC_POINT_new(E->G); int OK; diff --git a/src/tpm2/crypto/openssl/CryptPrime.c b/src/tpm2/crypto/openssl/CryptPrime.c index 46dc39d9d..e2087343e 100644 --- a/src/tpm2/crypto/openssl/CryptPrime.c +++ b/src/tpm2/crypto/openssl/CryptPrime.c @@ -479,7 +479,7 @@ TPM_RC TpmRsa_GeneratePrimeForRSA( while(!found) { // 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 endianness or word size of the CPU. + // 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 // libtpms changed begin diff --git a/src/tpm2/crypto/openssl/tpm_radix.h b/src/tpm2/crypto/openssl/tpm_radix.h index d5932a685..c8b69754d 100644 --- a/src/tpm2/crypto/openssl/tpm_radix.h +++ b/src/tpm2/crypto/openssl/tpm_radix.h @@ -64,10 +64,18 @@ #ifdef TPM_POSIX // libtpms added begin # include -# define RADIX_BITS BN_BITS2 +# ifdef THIRTY_TWO_BIT +# define RADIX_BITS 32 +# endif +# ifdef SIXTY_FOUR_BIT_LONG +# define RADIX_BITS 64 +# endif +# ifndef RADIX_BITS +# error Need to determine RADIX_BITS value +# endif #else # error Target platform is not supported -#endif +#endif // libtpms added end #ifndef RADIX_BITS # if defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) \ From 5ef9e30bdf38358a37d3475a0134c06f0a36b18c Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Sun, 28 Dec 2025 21:45:45 -0500 Subject: [PATCH 2/5] tpm2: Remove retrieval of IV after crypto operations (clean file) Signed-off-by: Stefan Berger --- src/tpm2/crypto/openssl/CryptSym.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/tpm2/crypto/openssl/CryptSym.c b/src/tpm2/crypto/openssl/CryptSym.c index 6e8185d33..1e928b6ec 100644 --- a/src/tpm2/crypto/openssl/CryptSym.c +++ b/src/tpm2/crypto/openssl/CryptSym.c @@ -552,7 +552,6 @@ CryptSymmetricEncrypt( BYTE keyToUse[MAX_SYM_KEY_BYTES]; UINT16 keyToUseLen = (UINT16)sizeof(keyToUse); TPM_RC retVal = TPM_RC_SUCCESS; - int ivLen; pAssert(dOut != NULL && key != NULL && dIn != NULL); if(dSize == 0) @@ -617,15 +616,6 @@ CryptSymmetricEncrypt( if (EVP_EncryptFinal_ex(ctx, pOut + outlen1, &outlen2) != 1) ERROR_EXIT(TPM_RC_FAILURE); - if (ivInOut) { - ivLen = EVP_CIPHER_CTX_iv_length(ctx); - if (ivLen < 0 || (size_t)ivLen > sizeof(ivInOut->t.buffer)) - ERROR_EXIT(TPM_RC_FAILURE); - - ivInOut->t.size = ivLen; - if (ivLen > 0 && DoEVPGetIV(ctx, ivInOut->t.buffer, ivInOut->t.size)) - ERROR_EXIT(TPM_RC_FAILURE); - } Exit: if (retVal == TPM_RC_SUCCESS && pOut != dOut) memcpy(dOut, pOut, outlen1 + outlen2); @@ -667,7 +657,6 @@ CryptSymmetricDecrypt( BYTE keyToUse[MAX_SYM_KEY_BYTES]; UINT16 keyToUseLen = (UINT16)sizeof(keyToUse); TPM_RC retVal = TPM_RC_SUCCESS; - int ivLen; // These are used but the compiler can't tell because they are initialized // in case statements and it can't tell if they are always initialized @@ -740,16 +729,6 @@ CryptSymmetricDecrypt( pAssert((int)buffersize >= outlen1 + outlen2); - if (ivInOut) { - ivLen = EVP_CIPHER_CTX_iv_length(ctx); - if (ivLen < 0 || (size_t)ivLen > sizeof(ivInOut->t.buffer)) - ERROR_EXIT(TPM_RC_FAILURE); - - ivInOut->t.size = ivLen; - if (ivLen > 0 && DoEVPGetIV(ctx, ivInOut->t.buffer, ivInOut->t.size)) - ERROR_EXIT(TPM_RC_FAILURE); - } - Exit: if (retVal == TPM_RC_SUCCESS) { pAssert(dSize >= outlen1 + outlen2); From 013356a723875201d126f20b0c63d2992d15c4ac Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Sun, 28 Dec 2025 22:07:08 -0500 Subject: [PATCH 3/5] tpm2: Implement retrieval of updated IV after crypto operation Implement the retrieval of the updated IV in a single function which is to be called after a symmetric key encryption or decryption operation. Signed-off-by: Stefan Berger --- src/tpm2/crypto/openssl/CryptSym.c | 18 ++++++++++++++++++ src/tpm2/crypto/openssl/Helpers.c | 9 ++++----- src/tpm2/crypto/openssl/Helpers_fp.h | 9 ++++----- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/tpm2/crypto/openssl/CryptSym.c b/src/tpm2/crypto/openssl/CryptSym.c index 1e928b6ec..70d52f286 100644 --- a/src/tpm2/crypto/openssl/CryptSym.c +++ b/src/tpm2/crypto/openssl/CryptSym.c @@ -520,6 +520,18 @@ static void TDES_CTR(const BYTE *key, // IN } #endif +static TPM_RC CryptSymmetricGetUpdatedIV(EVP_CIPHER_CTX *ctx, TPM2B_IV *ivOut) +{ + int len = EVP_CIPHER_CTX_get_iv_length(ctx); + + if (len < 0 || (size_t)len > sizeof(ivOut->t.buffer)) + return TPM_RC_FAILURE; + + ivOut->t.size = len; + + return DoEVPGetUpdatedIV(ctx, ivOut->t.buffer, ivOut->t.size); +} + /* 10.2.20.5 Symmetric Encryption */ /* This function performs symmetric encryption based on the mode. */ /* Error Returns Meaning */ @@ -616,6 +628,9 @@ CryptSymmetricEncrypt( if (EVP_EncryptFinal_ex(ctx, pOut + outlen1, &outlen2) != 1) ERROR_EXIT(TPM_RC_FAILURE); + if (ivInOut) + retVal = CryptSymmetricGetUpdatedIV(ctx, ivInOut); + Exit: if (retVal == TPM_RC_SUCCESS && pOut != dOut) memcpy(dOut, pOut, outlen1 + outlen2); @@ -729,6 +744,9 @@ CryptSymmetricDecrypt( pAssert((int)buffersize >= outlen1 + outlen2); + if (ivInOut) + retVal = CryptSymmetricGetUpdatedIV(ctx, ivInOut); + Exit: if (retVal == TPM_RC_SUCCESS) { pAssert(dSize >= outlen1 + outlen2); diff --git a/src/tpm2/crypto/openssl/Helpers.c b/src/tpm2/crypto/openssl/Helpers.c index a81bd248a..010655510 100644 --- a/src/tpm2/crypto/openssl/Helpers.c +++ b/src/tpm2/crypto/openssl/Helpers.c @@ -346,11 +346,10 @@ GetEVPCipher(TPM_ALG_ID algorithm, // IN return GetCachedEVPCipher(evpfn, algIdx, mode, i); } -TPM_RC DoEVPGetIV( - EVP_CIPHER_CTX *ctx, // IN: required context - unsigned char *iv, // IN: pointer to buffer for IV - size_t iv_len // IN: size of the buffer - ) +TPM_RC DoEVPGetUpdatedIV(EVP_CIPHER_CTX *ctx, // IN: required context + unsigned char *iv, // IN: pointer to buffer for IV + size_t iv_len // IN: size of the buffer + ) { #if OPENSSL_VERSION_NUMBER >= 0x30000000L OSSL_PARAM params[] = { diff --git a/src/tpm2/crypto/openssl/Helpers_fp.h b/src/tpm2/crypto/openssl/Helpers_fp.h index 446f638aa..be56b3821 100644 --- a/src/tpm2/crypto/openssl/Helpers_fp.h +++ b/src/tpm2/crypto/openssl/Helpers_fp.h @@ -79,11 +79,10 @@ const EVP_CIPHER *GetEVPCipher(TPM_ALG_ID algorithm, // IN UINT16 *keyToUseLen // IN/OUT ); -TPM_RC DoEVPGetIV( - EVP_CIPHER_CTX *ctx, // IN: required context - unsigned char *iv, // IN: pointer to buffer for IV - size_t iv_len // IN: size of the buffer - ); +TPM_RC DoEVPGetUpdatedIV(EVP_CIPHER_CTX *ctx, // IN: required context + unsigned char *iv, // IN: pointer to buffer for IV + size_t iv_len // IN: size of the buffer + ); #endif From 819c021228f24b843fbe61df06c079ddcee21a0f Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Fri, 26 Dec 2025 08:27:51 -0500 Subject: [PATCH 4/5] tpm2: Remove ALG_TDES conditional compilation (clean files) Remove the contributed conditional compilation of a TDES related function and fields in a structure based on definition of ALG_TDES. Signed-off-by: Stefan Berger --- src/tpm2/crypto/CryptSym.h | 2 -- src/tpm2/crypto/openssl/Helpers.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/tpm2/crypto/CryptSym.h b/src/tpm2/crypto/CryptSym.h index dd45acabe..31009eab6 100644 --- a/src/tpm2/crypto/CryptSym.h +++ b/src/tpm2/crypto/CryptSym.h @@ -106,9 +106,7 @@ typedef union tpmCryptKeySchedule_t { FOR_EACH_SYM_WITHOUT_TDES(KEY_SCHEDULE) /* libtpms changed from FOR_EACH_SYM */ -#if ALG_TDES // libtpms added tpmKeyScheduleTDES tdes[3]; /* libtpms added */ -#endif // libtpms added #if SYMMETRIC_ALIGNMENT == 8 uint64_t alignment; diff --git a/src/tpm2/crypto/openssl/Helpers.c b/src/tpm2/crypto/openssl/Helpers.c index 010655510..47607138f 100644 --- a/src/tpm2/crypto/openssl/Helpers.c +++ b/src/tpm2/crypto/openssl/Helpers.c @@ -97,7 +97,6 @@ BuildRSAKey(EVP_PKEY **ppkey, // OUT #if USE_OPENSSL_FUNCTIONS_SYMMETRIC -#if ALG_TDES TPM_RC OpenSSLCryptGenerateKeyDes( TPMT_SENSITIVE *sensitive // OUT: sensitive area @@ -121,7 +120,6 @@ OpenSSLCryptGenerateKeyDes( return retVal; } -#endif // ALG_TDES #define __NUM_ALGS 4 /* AES, TDES, Camellia, SM4 */ #define __NUM_MODES 5 /* CTR, OFB, CBC, CFB, ECB */ From 9c3b346d98e8cfc7e97d21ddbec4f47e4d13ea5b Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Fri, 26 Dec 2025 08:32:18 -0500 Subject: [PATCH 5/5] tpm2: Change license of some non-TCG files to BSD-2-clause Now that Helpers.c is clean of contributions, change its license to BSD-2-clause. Change license in some other files as well. Signed-off-by: Stefan Berger --- src/tpm2/crypto/openssl/ConsttimeUtils.h | 65 +++++++------------ src/tpm2/crypto/openssl/ExpDCache.c | 67 +++++++------------- src/tpm2/crypto/openssl/ExpDCache_fp.h | 79 +++++++++--------------- src/tpm2/crypto/openssl/Helpers.c | 67 +++++++------------- src/tpm2/crypto/openssl/Helpers_fp.h | 68 ++++++++------------ 5 files changed, 127 insertions(+), 219 deletions(-) diff --git a/src/tpm2/crypto/openssl/ConsttimeUtils.h b/src/tpm2/crypto/openssl/ConsttimeUtils.h index 3364bee32..22d8a05ff 100644 --- a/src/tpm2/crypto/openssl/ConsttimeUtils.h +++ b/src/tpm2/crypto/openssl/ConsttimeUtils.h @@ -8,53 +8,36 @@ /* */ /* 1. Copyright Licenses: */ /* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license 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 */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty 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 */ +/* 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. */ /* */ /********************************************************************************/ diff --git a/src/tpm2/crypto/openssl/ExpDCache.c b/src/tpm2/crypto/openssl/ExpDCache.c index 5aeaf1456..8e6a8d279 100644 --- a/src/tpm2/crypto/openssl/ExpDCache.c +++ b/src/tpm2/crypto/openssl/ExpDCache.c @@ -6,55 +6,36 @@ /* */ /* Licenses and Notices */ /* */ -/* 1. Copyright Licenses: */ +/* (c) Copyright IBM Corporation, 2021-2025 */ /* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ +/* All rights reserved. */ /* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are */ +/* met: */ /* */ -/* 2. Source Code Distribution Conditions: */ +/* Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the following disclaimer. */ /* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ +/* 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. */ /* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers 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. */ /* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp., 2021 */ +/* 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. */ /* */ /********************************************************************************/ diff --git a/src/tpm2/crypto/openssl/ExpDCache_fp.h b/src/tpm2/crypto/openssl/ExpDCache_fp.h index b8ee9d75b..e7db0580d 100644 --- a/src/tpm2/crypto/openssl/ExpDCache_fp.h +++ b/src/tpm2/crypto/openssl/ExpDCache_fp.h @@ -6,55 +6,36 @@ /* */ /* Licenses and Notices */ /* */ -/* 1. Copyright Licenses: */ -/* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ -/* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ -/* */ -/* 2. Source Code Distribution Conditions: */ -/* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ -/* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers in the */ -/* documentation and/or other materials provided with the distribution. */ -/* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty or otherwise, */ -/* arising in any way out of use or reliance upon this specification or any */ -/* information herein. */ -/* */ -/* (c) Copyright IBM Corp., 2021 */ +/* (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. */ /* */ /********************************************************************************/ diff --git a/src/tpm2/crypto/openssl/Helpers.c b/src/tpm2/crypto/openssl/Helpers.c index 47607138f..b4eeb3d9e 100644 --- a/src/tpm2/crypto/openssl/Helpers.c +++ b/src/tpm2/crypto/openssl/Helpers.c @@ -6,55 +6,36 @@ /* */ /* Licenses and Notices */ /* */ -/* 1. Copyright Licenses: */ +/* (c) Copyright IBM Corporation, 2019-2025 */ /* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ +/* All rights reserved. */ /* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are */ +/* met: */ /* */ -/* 2. Source Code Distribution Conditions: */ +/* Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the following disclaimer. */ /* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ +/* 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. */ /* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers 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. */ /* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty 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 */ +/* 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. */ /* */ /********************************************************************************/ diff --git a/src/tpm2/crypto/openssl/Helpers_fp.h b/src/tpm2/crypto/openssl/Helpers_fp.h index be56b3821..7cc86169a 100644 --- a/src/tpm2/crypto/openssl/Helpers_fp.h +++ b/src/tpm2/crypto/openssl/Helpers_fp.h @@ -6,58 +6,40 @@ /* */ /* Licenses and Notices */ /* */ -/* 1. Copyright Licenses: */ +/* (c) Copyright IBM Corporation, 2019-2025 */ /* */ -/* - Trusted Computing Group (TCG) grants to the user of the source code in */ -/* this specification (the "Source Code") a worldwide, irrevocable, */ -/* nonexclusive, royalty free, copyright license to reproduce, create */ -/* derivative works, distribute, display and perform the Source Code and */ -/* derivative works thereof, and to grant others the rights granted herein. */ +/* All rights reserved. */ /* */ -/* - The TCG grants to the user of the other parts of the specification */ -/* (other than the Source Code) the rights to reproduce, distribute, */ -/* display, and perform the specification solely for the purpose of */ -/* developing products based on such documents. */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions are */ +/* met: */ /* */ -/* 2. Source Code Distribution Conditions: */ +/* Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the following disclaimer. */ /* */ -/* - Redistributions of Source Code must retain the above copyright licenses, */ -/* this list of conditions and the following disclaimers. */ +/* 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. */ /* */ -/* - Redistributions in binary form must reproduce the above copyright */ -/* licenses, this list of conditions and the following disclaimers 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. */ /* */ -/* 3. Disclaimers: */ -/* */ -/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */ -/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */ -/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */ -/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */ -/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */ -/* information on specification licensing rights available through TCG */ -/* membership agreements. */ -/* */ -/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */ -/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */ -/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */ -/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */ -/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */ -/* */ -/* - Without limitation, TCG and its members and licensors disclaim all */ -/* liability, including liability for infringement of any proprietary */ -/* rights, relating to use of information in this specification and to the */ -/* implementation of this specification, and TCG disclaims all liability for */ -/* cost of procurement of substitute goods or services, lost profits, loss */ -/* of use, loss of data or any incidental, consequential, direct, indirect, */ -/* or special damages, whether under contract, tort, warranty 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 */ +/* 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 HELPERS_FP_H #define HELPERS_FP_H