Skip to content

Commit 57f12df

Browse files
committed
Support for getting TPM EK Certificates. Added wolfTPM2_GetKeyTemplate_EK and wolfTPM2_GetKeyTemplate_EK API's for getting EK public templates for generating the EK primary key. Fix TLS example build issues with wolfSSL not having crypto callback or PK callback enabled.
1 parent fb7e321 commit 57f12df

16 files changed

Lines changed: 1093 additions & 57 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ examples/boot/secret_seal
7979
examples/boot/secret_unseal
8080
examples/firmware/ifx_fw_extract
8181
examples/firmware/ifx_fw_update
82+
examples/endorsement/get_ek_certs
8283

8384
# Generated Cert Files
8485
certs/ca-*.pem

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Portable TPM 2.0 project designed for embedded use.
3434
* Parameter encryption support using AES-CFB or XOR.
3535
* Support for salted unbound authenticated sessions.
3636
* Support for HMAC Sessions.
37+
* Support for reading Endorsement certificates (EK Credential Profile).
3738

3839
Note: See [examples/README.md](examples/README.md) for details on using the examples.
3940

@@ -168,7 +169,7 @@ make install
168169
# then for some other library such as wolfTPM:
169170

170171
# cd /your-wolftpm-repo
171-
./configure --enable-swtpm --with-wolfcrypt=~/workspace/my_wolfssl_bin
172+
./configure --enable-swtpm --with-wolfcrypt=~/workspace/my_wolfssl_bin
172173
```
173174

174175
### Build options and defines
@@ -825,7 +826,6 @@ Connection: close
825826

826827
## Todo
827828

828-
* Add support for Endorsement certificates (EK Credential Profile).
829829
* Update to v1.59 of specification (adding CertifyX509).
830830
* Inner wrap support for SensitiveToPrivate.
831831
* Add support for IRQ (interrupt line)

examples/endorsement/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# TPM Endorsement Certificates
2+
3+
The `get_ek_certs` example will enumerate and validate the Endorsement Key Certificates stored in the NV TCG region.
4+
5+
TPM manufactures provision Endorsement Certificates based on a TPM key. This certificate can be used for signing/endorsement.
6+
7+
We have loaded some of the root and intermediate CA's into the trusted_certs.h file.
8+
9+
## Infineon SLB9672 EK Certificate Chain
10+
11+
Infineon certificates for TPM 2.0 can be downloaded from the following URLs (replace xxx with 3-digit CA number):
12+
13+
https://pki.infineon.com/OptigaRsaMfrCAxxx/OptigaRsaMfrCAxxx.crt
14+
https://pki.infineon.com/OptigaEccMfrCAxxx/OptigaEccMfrCAxxx.crt
15+
16+
17+
Examples:
18+
19+
- Infineon OPTIGA(TM) RSA Root CA 2
20+
- Infineon OPTIGA(TM) TPM 2.0 RSA CA 059
21+
- Infineon OPTIGA(TM) ECC Root CA 2
22+
- Infineon OPTIGA(TM) TPM 2.0 ECC CA 059
23+
24+
## STMicro ST33KTPM EK Certificate Chain
25+
26+
Example:
27+
28+
- STSAFE RSA root CA 02 (http://sw-center.st.com/STSAFE/STSAFERsaRootCA02.crt)
29+
- STSAFE-TPM RSA intermediate CA 10 (http://sw-center.st.com/STSAFE/stsafetpmrsaint10.crt)
30+
- STSAFE ECC root CA 02 (http://sw-center.st.com/STSAFE/STSAFEEccRootCA02.crt)
31+
- STSAFE-TPM ECC intermediate CA 10 (http://sw-center.st.com/STSAFE/stsafetpmeccint10.crt)

examples/endorsement/endorsement.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* endorsement.h
2+
*
3+
* Copyright (C) 2006-2024 wolfSSL Inc.
4+
*
5+
* This file is part of wolfTPM.
6+
*
7+
* wolfTPM is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 2 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* wolfTPM is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20+
*/
21+
22+
#ifndef _WOLFTPM_ENDORSEMENT_H_
23+
#define _WOLFTPM_ENDORSEMENT_H_
24+
25+
#ifdef __cplusplus
26+
extern "C" {
27+
#endif
28+
29+
int TPM2_EndorsementCert_Example(void* userCtx, int argc, char *argv[]);
30+
31+
#ifdef __cplusplus
32+
} /* extern "C" */
33+
#endif
34+
35+
#endif /* _WOLFTPM_ENDORSEMENT_H_ */

0 commit comments

Comments
 (0)