Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
14cbd1e
scripts: Implement meld-commit to meld by commit Id
stefanberger Aug 13, 2025
f2bb958
scripts: Add help screen to meld-all and display if file is 'not upst…
stefanberger Feb 11, 2026
a8f62e5
LICENSE: Add copyright notices and BSD license for newer TPM 2 code
stefanberger Dec 3, 2025
d6e7d65
Sync: Remove USE_BIT_FIELD_STRUCTURES build switch and bit fields
stefanberger Jul 22, 2025
c1bea7e
Sync: Remove USE_MARSHALING_DEFINES build switch
stefanberger Jul 22, 2025
ce789eb
tpm2: Get rid of IS_IMPLEMENTED flag for CC attributes
stefanberger Jul 24, 2025
9fa3ee5
Sync: Remove TABLE_DRIVEN_DISPATCH build switch
stefanberger Jul 22, 2025
bcc973c
Sync: Sync on white space changes
stefanberger Aug 6, 2025
761ac79
Sync: Introduce ReadOnlyControl command but do not activate it
stefanberger Jul 22, 2025
917bd67
Sync: Introduce PolicyTransportSPDM command but do not activate it
stefanberger Jul 23, 2025
a3af469
Sync: Reformat some files
stefanberger Aug 6, 2025
cd5e791
Sync: Use clang-format 19.1.4 to reformat sources
stefanberger Aug 6, 2025
3a06cb6
Sync: Fix some build issues, reformat code and add more comments
stefanberger Jul 23, 2025
84e1aaa
tpm2: Include stdint.h/def.h in BaseTypes.h and some other changes
stefanberger Jul 23, 2025
cad61cd
Sync: Move vendor commands support into own directory
stefanberger Jul 23, 2025
26a7505
Sync: Add options for simulator (unused)
stefanberger Aug 6, 2025
c45fbf4
Sync: Improve platform initialization
stefanberger Jul 23, 2025
c709781
Sync: Implemented debugging macros and enable with build switch
stefanberger Aug 6, 2025
64f155d
Sync: Have _TPM_Hash_Start/Data/End and FlushObject return error codes
stefanberger Jul 23, 2025
1038e5b
Sync: Have several crypto functions return TPM_RC now
stefanberger Jul 23, 2025
efec01a
Sync: Put pAssert after every SessionGet
stefanberger Jul 23, 2025
09d2851
Sync: Add pAsserts after many HandleToObject calls
stefanberger Jul 23, 2025
c3e7a1f
Sync: Rework some NVRAM functions to return TPM_RC and adjust pAsserts
stefanberger Jul 23, 2025
54afc26
Sync: Have ComputeCommandHMAC return TPM_RC
stefanberger Aug 6, 2025
cfb121b
Sync: Have Object and PCR related functions return TPM_RC
stefanberger Aug 6, 2025
6c36f02
Sync: Have PolicyContextUpdate return TPM_RC
stefanberger Aug 7, 2025
82e982e
Sync: Adjust pAssert variant being used depending on function return …
stefanberger Jul 23, 2025
f0a2f66
Sync: Rework failure handling and replace g_inFailureMode
stefanberger Aug 7, 2025
38f17a7
Sync: Fix code comments and function descriptions and trivial changes
stefanberger Aug 7, 2025
7bdbee5
Sync: Add checks for locator == (NV_REF)0
stefanberger Aug 8, 2025
7ac4062
Sync: Check for NULL pointers in CommandDispatcher
stefanberger Aug 8, 2025
cf8eefc
Sync: Report versioning information using a structe passed to a function
stefanberger Aug 7, 2025
2d42189
Sync: Format TpmProfile_CommandList.h
stefanberger Aug 7, 2025
ce8fad9
Sync: Reformat comments in Global.h
stefanberger Aug 7, 2025
10ea432
Sync: Throw a build error if CC_AC_GetCapability is enabled
stefanberger Aug 7, 2025
8fe2c57
Sync: Add NOT_REFERENCED to avoid build error
stefanberger Aug 7, 2025
5d5b61e
Sync: Add more buffer size checks to CryptParameterDecryption
stefanberger Aug 7, 2025
dd0efdf
Sync: Only build x509 related functions if CC_CertifyX509 is '1'
stefanberger Aug 7, 2025
f9e2154
Sync: Fix comments
stefanberger Aug 7, 2025
22902e4
Sync: Add another fallthrough hint for static analysis tools
stefanberger Aug 7, 2025
9b149b1
Sync: Replace a printf with DEBUG_PRINT in BnToOsslMath.c
stefanberger Aug 7, 2025
a446639
Sync: Introduce platform functions for accessing NV indices
stefanberger Aug 8, 2025
a1d42dd
Sync: Implement platform function to determine enabled self tests
stefanberger Aug 8, 2025
e1bf687
tpm2: Adopt the directory structure of upstream code repo
stefanberger Aug 11, 2025
ba2c0e2
Sync: Fix masking-out of unneeded bits in TpmMath_GetRandomBits
stefanberger Aug 14, 2025
a4190b7
Sync: Fix and extend compile-time testing of NUM_AUTHVALUE_PCR_GROUP
stefanberger Aug 14, 2025
ed26e53
Sync: Add include to simulator_sysheaders.h
stefanberger Aug 14, 2025
73ecdf1
tpm2: Split off TDES related parts from TpmToOsslSym.h and adjust lic…
stefanberger Jan 21, 2026
7e579e0
Sync: Sync minor changes in several files with upstream
stefanberger Jan 21, 2026
b5228b0
Sync: Move many files to BSD-2-Clause license
stefanberger Jan 21, 2026
023ca08
Sync: Remove some unused files
stefanberger Jan 27, 2026
307d1a9
Sync: Sync up the order of some #define's to match 'upstream'
stefanberger Feb 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 42 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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}'`
Expand Down
35 changes: 31 additions & 4 deletions scripts/meld-all
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -65,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
Expand All @@ -74,14 +97,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
Expand Down
43 changes: 43 additions & 0 deletions scripts/meld-commit
Original file line number Diff line number Diff line change
@@ -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
Loading