Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes for release prep #392

Merged
merged 3 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Portable TPM 2.0 project designed for embedded use.

* This implementation provides all TPM 2.0 API's in compliance with the specification.
* Wrappers provided to simplify Key Generation/Loading, RSA encrypt/decrypt, ECC sign/verify, ECDH, NV, Hashing/HACM, AES, Sealing/Unsealing, Attestation, PCR Extend/Quote and Secure Root of Trust.
* Testing done using TPM 2.0 modules from STMicro ST33 (SPI/I2C), Infineon OPTIGA SLB9670/SLB9672, Microchip ATTPM20, Nations Tech Z32H330TC/NS350 and Nuvoton NPCT650/NPCT750.
* Testing done using TPM 2.0 modules from STMicro ST33 (SPI/I2C), Infineon OPTIGA SLB9670/SLB9672/SLB9673, Microchip ATTPM20, Nations Tech Z32H330TC/NS350 and Nuvoton NPCT650/NPCT750.
* wolfTPM uses the TPM Interface Specification (TIS) to communicate either over SPI, or using a memory mapped I/O range.
* wolfTPM can also use the Linux TPM kernel interface (`/dev/tpmX`) to talk with any physical TPM on SPI, I2C and even LPC bus.
* Platform support for Raspberry Pi (Linux), MMIO, STM32 with CubeMX, Atmel ASF, Xilinx, QNX Infineon TriCore and Barebox.
Expand All @@ -31,7 +31,7 @@ Portable TPM 2.0 project designed for embedded use.
* Time signed or set
* PCR read/reset
* GPIO configure, read and write.
* Endrosement Key/Cert retreival and validation.
* Endorsement Key/Cert retrieval and validation.
* Parameter encryption support using AES-CFB or XOR.
* Support for salted unbound authenticated sessions.
* Support for HMAC Sessions.
Expand Down
19 changes: 12 additions & 7 deletions src/tpm2_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2822,8 +2822,10 @@ int wolfTPM2_DecodeRsaDer(const byte* der, word32 derSz,
rc = wc_InitRsaKey(key, NULL);
if (rc == 0) {
idx = 0;
#ifdef HAVE_PKCS8
/* skip PKCS8 header */
(void)wc_GetPkcs8TraditionalOffset((byte*)der, &idx, derSz);
#endif
rc = wc_RsaPrivateKeyDecode(der, &idx, key, derSz);
if (rc == 0) {
isPrivateKey = 1;
Expand Down Expand Up @@ -4564,13 +4566,6 @@ static int wolfTPM2_NVWriteData(WOLFTPM2_DEV* dev, WOLFTPM2_SESSION* tpmSession,
XMEMCPY(in.write.data.buffer, &dataBuf[pos], towrite);
if (!extend) {
in.write.offset = offset+pos;
rc = TPM2_NV_Write(&in.write);
}
else {
rc = TPM2_NV_Extend(&in.extend);
}
if (rc != TPM_RC_SUCCESS) {
break;
}

#ifdef DEBUG_WOLFTPM
Expand All @@ -4580,6 +4575,16 @@ static int wolfTPM2_NVWriteData(WOLFTPM2_DEV* dev, WOLFTPM2_SESSION* tpmSession,
in.write.offset, in.write.data.size, extend);
#endif

if (!extend) {
rc = TPM2_NV_Write(&in.write);
}
else {
rc = TPM2_NV_Extend(&in.extend);
}
if (rc != TPM_RC_SUCCESS) {
break;
}

pos += towrite;
dataSz -= towrite;
}
Expand Down
Loading