Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
eb359d3
F-5097 F-5103 F-5831 - Enforce decrypt attribute on ECDH commands
aidangarske Jun 2, 2026
d7beca2
F-5120 - Reject TPM_RH_NULL and non-storage newParent in Rewrap
aidangarske Jun 2, 2026
a62c5b1
F-5104 - Require restricted signing key in fwTPM Quote
aidangarske Jun 2, 2026
991ae59
F-4841 F-5832 - Enforce NV read authorization in PolicyNV and PolicyA…
aidangarske Jun 2, 2026
cb32e61
F-5654 F-5655 - Validate selftest params and report test status
aidangarske Jun 2, 2026
84705f0
F-5721 - Enforce DRTM PCR locality in fwTPM PCR_Event
aidangarske Jun 2, 2026
9245b19
F-5719 - Bind and enforce PolicyLocality constraint on policy sessions
aidangarske Jun 2, 2026
b1a4528
F-5677 - Reject newMaxTries=0 in DictionaryAttackParameters
aidangarske Jun 2, 2026
4e7c88b
F-5722 - Enforce per-hierarchy persistent sub-range in EvictControl
aidangarske Jun 2, 2026
6f3c20f
F-4953 F-5095 - Enforce key-declared signing scheme over wire scheme
aidangarske Jun 2, 2026
ef59e32
F-5280 - Reject non-session response tag for sessioned commands
aidangarske Jun 2, 2026
9df47ef
F-5647 - Reject negative authSz in key auth wrapper APIs
aidangarske Jun 2, 2026
b8cdf54
F-4840 - Require non-empty session key for parameter encryption
aidangarske Jun 2, 2026
6ee4582
F-4842 F-5098 - Sanitize NV journal DA maxTries and object handle
aidangarske Jun 2, 2026
c03db2d
F-5678 - Populate attestation clockInfo from live TPM state
aidangarske Jun 2, 2026
60aef67
F-4673 - Bind context sequence counter to blob and reject replay
aidangarske Jun 2, 2026
2f059c3
F-5101 F-5108 - Flush transient state on command client change
aidangarske Jun 2, 2026
6c9a64e
F-5102 F-5119 F-5833 - Authenticate NV journal with integrity MAC
aidangarske Jun 2, 2026
89eb045
F-5646 - Document empty-auth risk on key load/import helpers
aidangarske Jun 2, 2026
77f5022
F-5105 F-5106 F-5107 - Require signing key for attestation commands
aidangarske Jun 2, 2026
e98e527
F-4845 F-4848 F-5096 F-5015 - Enforce key scheme/hash in RSA and HMAC
aidangarske Jun 2, 2026
7a4b94e
F-4956 F-4846 - Enforce tpmKey decrypt attr and cipher mode match
aidangarske Jun 2, 2026
08d327b
F-5679 F-5279 - EventSequenceComplete locality and ClockSet bound
aidangarske Jun 2, 2026
0d95be5
F-5099 F-5109 - Validate authPolicy size and nvIndex range on NV load
aidangarske Jun 2, 2026
5617f43
F-5277 F-5122 - Store and enforce policy cpHashA command binding
aidangarske Jun 2, 2026
194d3bf
F-5278 F-5723 - Exempt NO_DA NV from lockout and persist GlobalWriteLock
aidangarske Jun 2, 2026
32a823c
F-5834 F-5281 F-5118 - Fix ephemeral DoS and PKCS1 unpad OOB/padding
aidangarske Jun 2, 2026
204573f
F-4161 F-4843 - Reject oversized auth and undersized session nonce
aidangarske Jun 2, 2026
5f8c180
F-4954 - Require TPM_RH_NULL hierarchy for LoadExternal private key
aidangarske Jun 2, 2026
c6b15aa
F-4955 - Derive credential keys under EK nameAlg not hardcoded SHA-256
aidangarske Jun 2, 2026
6332a9b
F-4847 - Require inner-wrap path for encryptedDuplication objects
aidangarske Jun 2, 2026
0f15767
F-5653 F-5644 - Bounds-check NV key read and propagate NV load errors
aidangarske Jun 2, 2026
944058a
F-5123 F-5124 - fsync NV writes for crash durability
aidangarske Jun 2, 2026
4ac2bd2
F-4675 F-4677 F-5125 - Harden fwTPM command-port signals and shm perms
aidangarske Jun 2, 2026
4a874c6
F-5643 - Skip DER decode when PEM-to-DER conversion fails
aidangarske Jun 2, 2026
ef022dd
F-5127 - Guard wolfSPDM_Finish against missing KeyExchange state
aidangarske Jun 2, 2026
3493055
F-5648 F-5649 - Add HMAC verify truncation and compute buffer-size tests
aidangarske Jun 2, 2026
5453e6f
F-5654 F-5719 F-5277 F-5122 F-4845 F-4955 - Harden fwTPM fixes per re…
aidangarske Jun 2, 2026
d7638f9
F-5655 - Parse GetTestResult testResult as full 32-bit value
aidangarske Jun 2, 2026
d42f610
F-4161 - Reject oversized auth in CreateLoadedKey and CreatePrimaryKey
aidangarske Jun 2, 2026
684de58
F-4677 - Drop dead command-port power-signal branches
aidangarske Jun 2, 2026
675d336
F-5102 - Create NV journal key file with O_EXCL and O_NOFOLLOW
aidangarske Jun 2, 2026
57f49c7
F-4673 - Track live context sequences for any-order single-use load
aidangarske Jun 2, 2026
bf01067
fwtpm: keep transient state across command-port reconnects
aidangarske Jun 3, 2026
16a4741
fwtpm: address PR review for scheme checks, context-save, and NV dura…
aidangarske Jun 3, 2026
61f7fec
F-5835, F-5100 - Validate firmware data-size bound and NV reserved at…
aidangarske Jun 3, 2026
5699061
fwtpm: scope context replay to sessions and accept unsalted param-enc
aidangarske Jun 3, 2026
40716ac
tests: create restricted AIK for tpm2-tools quote
aidangarske Jun 3, 2026
f98029c
fwtpm: guard FwHandleIsNoDA definition under FWTPM_NO_DA
aidangarske Jun 3, 2026
21a9501
fwtpm: make FWTPM_NV_SaveFlags a no-op success when NV is disabled
aidangarske Jun 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/firmware/ifx_fw_extract.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ static int extractFW(
}

READ_BE32(size32, fw, fw_size, offset);
if (offset + size32 > fw_size) {
/* offset <= fw_size here; subtract to avoid size_t wrap on 32-bit */
if (size32 > fw_size - offset) {
LOG("FW file too short");
return -1;
}
Expand Down
16 changes: 16 additions & 0 deletions examples/nvram/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@ int TPM2_NVRAM_Read_Example(void* userCtx, int argc, char *argv[])
printf("Successfully read public key part from NV\n\n");
offset += readSize;

/* pub.size comes from NV and must fit the destination buffer */
if (readSize != sizeof(keyBlob.pub.size) ||
sizeof(UINT16) + keyBlob.pub.size > sizeof(pubAreaBuffer)) {
printf("Invalid public key size marker from NV\n");
rc = BUFFER_E;
goto exit;
}

readSize = sizeof(UINT16) + keyBlob.pub.size; /* account for TPM2B size marker */
printf("Trying to read %d bytes of public key part from NV\n", keyBlob.pub.size);
rc = wolfTPM2_NVReadAuth(&dev, &nv, nvIndex,
Expand Down Expand Up @@ -244,6 +252,14 @@ int TPM2_NVRAM_Read_Example(void* userCtx, int argc, char *argv[])
printf("Successfully read size marker from NV\n\n");
offset += readSize;

/* priv.size comes from NV and must fit the destination buffer */
if (readSize != sizeof(keyBlob.priv.size) ||
keyBlob.priv.size > sizeof(keyBlob.priv.buffer)) {
printf("Invalid private key size marker from NV\n");
rc = BUFFER_E;
goto exit;
}

readSize = keyBlob.priv.size;
printf("Trying to read %d bytes of private key part from NV\n", readSize);
rc = wolfTPM2_NVReadAuth(&dev, &nv, nvIndex,
Expand Down
4 changes: 3 additions & 1 deletion scripts/tpm2_tools_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,12 @@ flush_transient
run_test "createprimary for attestation" \
tpm2_createprimary -C o -g sha256 -G rsa -c "$TEST_TMPDIR/att_primary.ctx"

# Create child AIK for signing
# Create child AIK for signing. Quote requires a restricted signing key
# (TPM 2.0 Part 3 Sec.18.4), so set the canonical attestation-key attributes.
run_test "create AIK (RSA signing key)" \
tpm2_create -C "$TEST_TMPDIR/att_primary.ctx" \
-g sha256 -G rsa:rsassa:null \
-a "fixedtpm|fixedparent|sensitivedataorigin|userwithauth|restricted|sign" \
-u "$TEST_TMPDIR/aik.pub" -r "$TEST_TMPDIR/aik.priv"

run_test "load AIK" \
Expand Down
Loading
Loading