Skip to content

Commit da1d34c

Browse files
authored
Merge pull request #134 from dgarske/release_v2.0
Preparation for wolfTPM v2.0 release
2 parents c7e9326 + bd14af9 commit da1d34c

27 files changed

Lines changed: 179 additions & 113 deletions

ChangeLog.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
## Release Notes
22

3+
### wolfTPM Release 2.0 (12/07/2020)
4+
5+
**Summary**
6+
7+
Added AES CFB parameter encryption, HMAC sessions, TPM simulator, Windows TPM (TBSI) support and more examples for time/keys.
8+
9+
**Detail**
10+
11+
* Refactor of the session authentication. New struct `TPM2_AUTH_SESSION` and `wolfTPM2_SetAuth_*` API's. (PR #129 and #133)
12+
* Added Windows TPM TBSI support (PR #127)
13+
* Added TPM simulator support using TPM TCP protocol (PR #121)
14+
* Added minGW support (PR #127)
15+
* Added AES CFB parameter encryption support (PR #129)
16+
* Added XOR parameter encryption support (PR #122)
17+
* Added "-aes" or "-xor" option to some examples to enable parameter encryption. (PR #129)
18+
* Added HMAC session support (PR #129)
19+
* Added support for encrypted RSA salt for salted-unbounded session (PR #129)
20+
* Added innerWrap and outerWrap support for sensitive to private. (PR #129)
21+
* Improvements to the KDFa (PR #129)
22+
* Improved the param encryption to use buffers inline (PR #129)
23+
* Added Key generation and loading examples using disk to store the key (PR #131)
24+
* Added support for importing external private key to get a key blob for easy re-loading. (PR #132)
25+
* Add TPM clock increment example (PR #117)
26+
* Add test vectors for AES CFB and make it the default for tests (PR #125)
27+
* Improved documentation and code comments (PR #126)
28+
* Add script to run unit tests with software TPM (PR #124)
29+
30+
331
### wolfTPM Release 1.9 (08/24/2020)
432

533
**Summary**

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ TPM2: Caps 0x1a7e2882, Did 0x0000, Vid 0x104a, Rid 0x4e
9191
Mfg STM (2), Vendor , Fw 74.9 (1151341959), FIPS 140-2 1, CC-EAL4 0
9292

9393
Microchip ATTPM20
94-
TPM2: Caps 0x30000695, Did 0x3205, Vid 0x1114, Rid 0x 1
94+
TPM2: Caps 0x30000695, Did 0x3205, Vid 0x1114, Rid 0x 1
9595
Mfg MCHP (3), Vendor , Fw 512.20481 (0), FIPS 140-2 0, CC-EAL4 0
9696

9797
Nations Technologies Inc. TPM 2.0 module
@@ -432,7 +432,7 @@ ECDHE 256 agree 35 ops took 1.029 sec, avg 29.402 ms, 34.011 ops/sec
432432
```
433433
./examples/native/native_test
434434
TPM2 Demo using Native API's
435-
TPM2: Caps 0x30000495, Did 0x0000, Vid 0x104a, Rid 0x4e
435+
TPM2: Caps 0x30000495, Did 0x0000, Vid 0x104a, Rid 0x4e
436436
TPM2_Startup pass
437437
TPM2_SelfTest pass
438438
TPM2_GetTestResult: Size 12, Rc 0x0
@@ -578,7 +578,7 @@ CCqGSM49BAMCA0gAMEUCIQCR9cbyRt3cbEZUIOBa4GNSRTlgFdB3X1EOwm+cA5/k
578578
### TPM2 PKCS 7 Example
579579

580580
```
581-
./examples/pkcs7/pkcs7
581+
./examples/pkcs7/pkcs7
582582
TPM2 PKCS7 Example
583583
PKCS7 Signed Container 1625
584584
PKCS7 Container Verified (using TPM)

autogen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ else
4242
WARNINGS="all"
4343
fi
4444

45-
autoreconf --install --force --verbose
45+
autoreconf --install --force --verbose

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# All right reserved.
44

55
AC_COPYRIGHT([Copyright (C) 2014-2020 wolfSSL Inc.])
6-
AC_INIT([wolftpm],[1.9.0],[https://github.com/wolfssl/wolfTPM/issues],[wolftpm],[http://www.wolfssl.com])
6+
AC_INIT([wolftpm],[2.0.0],[https://github.com/wolfssl/wolfTPM/issues],[wolftpm],[http://www.wolfssl.com])
77

88
AC_PREREQ([2.63])
99
AC_CONFIG_AUX_DIR([build-aux])
@@ -23,7 +23,7 @@ AC_ARG_PROGRAM
2323
AC_CONFIG_MACRO_DIR([m4])
2424
AC_CONFIG_HEADERS([src/config.h])
2525

26-
WOLFTPM_LIBRARY_VERSION=9:0:0
26+
WOLFTPM_LIBRARY_VERSION=10:0:0
2727
# | | |
2828
# +------+ | +---+
2929
# | | |
@@ -328,7 +328,7 @@ fi
328328

329329
# TIS / SPI Check Wait State support
330330
# Required for all but Infineon only
331-
if test "x$ENABLED_CHECKWAITSTATE" = "xyes" || test "x$ENABLED_AUTODETECT" = "xyes" || test "x$ENABLED_INFINEON" = "xno"
331+
if test "x$ENABLED_CHECKWAITSTATE" = "xyes" || test "x$ENABLED_AUTODETECT" = "xyes" || test "x$ENABLED_INFINEON" = "xno"
332332
then
333333
ENABLED_CHECKWAITSTATE=yes
334334
AM_CFLAGS="$AM_CFLAGS -DWOLFTPM_CHECK_WAIT_STATE"

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ This example client connects to localhost on on port 11111 by default. These can
129129

130130
You can validate using the wolfSSL example server this like:
131131
`./examples/server/server -b -p 11111 -g -d -i -V`
132-
132+
133133
To validate client certificate use the following wolfSSL example server command:
134134
`./examples/server/server -b -p 11111 -g -A ./certs/tpm-ca-rsa-cert.pem -i -V`
135135
or

examples/bench/bench.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static int bench_sym_hash(WOLFTPM2_DEV* dev, const char* desc, int algo,
129129
double start;
130130
WOLFTPM2_HASH hash;
131131

132+
XMEMSET(&hash, 0, sizeof(hash));
132133
bench_stats_start(&count, &start);
133134
do {
134135
rc = wolfTPM2_HashStart(dev, &hash, algo,
@@ -185,7 +186,7 @@ static void usage(void)
185186
{
186187
printf("Expected usage:\n");
187188
printf("./examples/bench/bench [-aes/xor]\n");
188-
printf("* -aes/xor: Use Parameter Encryption\n");
189+
printf("* -aes/xor: Use Parameter Encryption\n");
189190
}
190191

191192
/******************************************************************************/
@@ -257,7 +258,7 @@ int TPM2_Wrapper_BenchArgs(void* userCtx, int argc, char *argv[])
257258
(word32)tpmSession.handle.hndl);
258259

259260
/* set session for authorization of the storage key */
260-
rc = wolfTPM2_SetAuthSession(&dev, 1, &tpmSession,
261+
rc = wolfTPM2_SetAuthSession(&dev, 1, &tpmSession,
261262
(TPMA_SESSION_decrypt | TPMA_SESSION_encrypt | TPMA_SESSION_continueSession));
262263
if (rc != 0) goto exit;
263264
}
@@ -494,6 +495,8 @@ int main(int argc, char *argv[])
494495
rc = TPM2_Wrapper_BenchArgs(NULL, argc, argv);
495496
#else
496497
printf("Wrapper code not compiled in\n");
498+
(void)argc;
499+
(void)argv;
497500
#endif
498501

499502
return rc;

examples/csr/csr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ int TPM2_CSR_ExampleArgs(void* userCtx, int argc, char *argv[])
202202
&storageKey,
203203
&eccKey,
204204
&wolfEccKey,
205-
tpmDevId,
205+
tpmDevId,
206206
(byte*)gKeyAuth, sizeof(gKeyAuth)-1);
207207
if (rc != 0) goto exit;
208208

examples/keygen/keygen.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include <stdio.h>
3232

33+
#ifndef WOLFTPM2_NO_WRAPPER
3334

3435
/******************************************************************************/
3536
/* --- BEGIN TPM Keygen Example -- */
@@ -117,7 +118,7 @@ int TPM2_Keygen_Example(void* userCtx, int argc, char *argv[])
117118
(word32)tpmSession.handle.hndl);
118119

119120
/* set session for authorization of the storage key */
120-
rc = wolfTPM2_SetAuthSession(&dev, 1, &tpmSession,
121+
rc = wolfTPM2_SetAuthSession(&dev, 1, &tpmSession,
121122
(TPMA_SESSION_decrypt | TPMA_SESSION_encrypt | TPMA_SESSION_continueSession));
122123
if (rc != 0) goto exit;
123124
}
@@ -139,7 +140,7 @@ int TPM2_Keygen_Example(void* userCtx, int argc, char *argv[])
139140
/* set session for authorization key */
140141
auth.size = (int)sizeof(gAiKeyAuth)-1;
141142
XMEMCPY(auth.buffer, gAiKeyAuth, auth.size);
142-
143+
143144
}
144145
else {
145146
if (alg == TPM_ALG_RSA) {
@@ -208,16 +209,22 @@ int TPM2_Keygen_Example(void* userCtx, int argc, char *argv[])
208209
}
209210

210211
/******************************************************************************/
211-
/* --- END TPM Timestamp Test -- */
212+
/* --- END TPM Keygen Example -- */
212213
/******************************************************************************/
213-
214+
#endif /* !WOLFTPM2_NO_WRAPPER */
214215

215216
#ifndef NO_MAIN_DRIVER
216217
int main(int argc, char *argv[])
217218
{
218-
int rc;
219+
int rc = NOT_COMPILED_IN;
219220

221+
#ifndef WOLFTPM2_NO_WRAPPER
220222
rc = TPM2_Keygen_Example(NULL, argc, argv);
223+
#else
224+
printf("KeyGen code not compiled in\n");
225+
(void)argc;
226+
(void)argv;
227+
#endif
221228

222229
return rc;
223230
}

examples/keygen/keyimport.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include <stdio.h>
3232

3333

34+
#ifndef WOLFTPM2_NO_WRAPPER
35+
3436
/******************************************************************************/
3537
/* --- BEGIN TPM Key Import / Blob Example -- */
3638
/******************************************************************************/
@@ -57,7 +59,7 @@ int TPM2_Keyimport_Example(void* userCtx, int argc, char *argv[])
5759
size_t fileSz = 0;
5860
#endif
5961
const char* outputFile = "keyblob.bin";
60-
62+
6163
if (argc >= 2) {
6264
if (XSTRNCMP(argv[1], "-?", 2) == 0 ||
6365
XSTRNCMP(argv[1], "-h", 2) == 0 ||
@@ -110,7 +112,7 @@ int TPM2_Keyimport_Example(void* userCtx, int argc, char *argv[])
110112
(word32)tpmSession.handle.hndl);
111113

112114
/* set session for authorization of the storage key */
113-
rc = wolfTPM2_SetAuthSession(&dev, 1, &tpmSession,
115+
rc = wolfTPM2_SetAuthSession(&dev, 1, &tpmSession,
114116
(TPMA_SESSION_decrypt | TPMA_SESSION_encrypt | TPMA_SESSION_continueSession));
115117
if (rc != 0) goto exit;
116118
}
@@ -173,16 +175,23 @@ int TPM2_Keyimport_Example(void* userCtx, int argc, char *argv[])
173175
}
174176

175177
/******************************************************************************/
176-
/* --- END TPM Timestamp Test -- */
178+
/* --- END TPM Key Import / Blob Example -- */
177179
/******************************************************************************/
180+
#endif /* !WOLFTPM2_NO_WRAPPER */
178181

179182

180183
#ifndef NO_MAIN_DRIVER
181184
int main(int argc, char *argv[])
182185
{
183-
int rc;
186+
int rc = NOT_COMPILED_IN;
184187

188+
#ifndef WOLFTPM2_NO_WRAPPER
185189
rc = TPM2_Keyimport_Example(NULL, argc, argv);
190+
#else
191+
printf("KeyImport code not compiled in\n");
192+
(void)argc;
193+
(void)argv;
194+
#endif
186195

187196
return rc;
188197
}

examples/keygen/keyload.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <stdio.h>
4040

4141

42+
#ifndef WOLFTPM2_NO_WRAPPER
4243
/******************************************************************************/
4344
/* --- BEGIN TPM Key Load Example -- */
4445
/******************************************************************************/
@@ -111,7 +112,7 @@ int TPM2_Keyload_Example(void* userCtx, int argc, char *argv[])
111112
(word32)tpmSession.handle.hndl);
112113

113114
/* set session for authorization of the storage key */
114-
rc = wolfTPM2_SetAuthSession(&dev, 1, &tpmSession,
115+
rc = wolfTPM2_SetAuthSession(&dev, 1, &tpmSession,
115116
(TPMA_SESSION_decrypt | TPMA_SESSION_encrypt | TPMA_SESSION_continueSession));
116117
if (rc != 0) goto exit;
117118
}
@@ -191,16 +192,22 @@ int TPM2_Keyload_Example(void* userCtx, int argc, char *argv[])
191192
}
192193

193194
/******************************************************************************/
194-
/* --- END TPM Timestamp Test -- */
195+
/* --- END TPM Key Load Example -- */
195196
/******************************************************************************/
196-
197+
#endif /* !WOLFTPM2_NO_WRAPPER */
197198

198199
#ifndef NO_MAIN_DRIVER
199200
int main(int argc, char *argv[])
200201
{
201-
int rc;
202+
int rc = NOT_COMPILED_IN;
202203

204+
#ifndef WOLFTPM2_NO_WRAPPER
203205
rc = TPM2_Keyload_Example(NULL, argc, argv);
206+
#else
207+
printf("KeyImport code not compiled in\n");
208+
(void)argc;
209+
(void)argv;
210+
#endif
204211

205212
return rc;
206213
}

0 commit comments

Comments
 (0)