Skip to content

Commit c9ccc51

Browse files
authored
Merge pull request #26 from dgarske/rel_v1.2_prep
wolfPKCS11 release v1.2 prep
2 parents 288d2f7 + 404b364 commit c9ccc51

File tree

6 files changed

+55
-5
lines changed

6 files changed

+55
-5
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,44 @@ When not set, defaults to: /tmp
7777

7878
Set to any value to stop storage of token data.
7979

80+
8081
## Release Notes
8182

83+
### wolfPKCS11 Release 1.2 (Dec 26, 2023)
84+
85+
**Summary**
86+
87+
Adds backend support for TPM 2.0 using wolfTPM. Adds AES CBC key wrap / unwrap support. Portability improvements. Improved testing with GitHub Actions.
88+
89+
**Detail**
90+
91+
* Cleanups for minor cast warning, spelling and ignore for generated test files (PR #14)
92+
* Added support for wrap/unwrap RSA with aes_cbc_pad. (PR #15)
93+
* Fixed setting of label for public key after creation (init ECC objects before decoding) (PR #16)
94+
* Flush writes in key store. (PR #17)
95+
* Added build options for embedded use (PR #18)
96+
- `WOLFSSL_USER_SETTINGS` to avoid including `wolfssl/options.h`
97+
- `WOLFPKCS11_USER_SETTINGS` to avoid including `wolfPKCS11/options.h`
98+
- `WOLFPKCS11_NO_TIME` to make wc_GetTime() optional (it disables brute-force protections on token login)
99+
* Reset failed login counter only with `WOLFPKCS11_NO_TIME` (PR #18)
100+
* Fixed argument passing in `SetMPI`/`GetMPIData` (PR #19)
101+
* Fixed `NO_DH` ifdef gate when freeing PKCS11 object (PR #20)
102+
* Added GitHub CI action (PR #21)
103+
* Fixed warnings from `./autogen.sh`. Updated m4 macros. (PR #21)
104+
* Added additional GitHub CI action tests. (PR #22)
105+
* Added wolfPKCS11 support for using TPM 2.0 module as backend. Uses wolfTPM and supports RSA and ECC. Requires https://github.com/wolfSSL/wolfTPM/pull/311 (PR #23)
106+
* Added CI testing for wolfPKCS11 with wolfTPM backend and single threaded. (PR #23)
107+
* Added PKCS11 TPM NV store (enabled with `WOLFPKCS11_TPM_STORE`). Allow `WOLFPKCS11_NO_STORE` for TPM use case. (PR #23)
108+
* Fixed compiler warnings from mingw. (PR #23)
109+
* Added portability macro `WOLFPKCS11_NO_ENV` when setenv/getenv are not available. (PR #23)
110+
* Fix to only require `-ldl` for non-static builds. (PR #23)
111+
* Portability fixes. Added `NO_MAIN_DRIVER`. Support for `SINGLE_THREADED`. Add `static` to some globals. (PR #24)
112+
* Fixes for portability where `XREALLOC` is not available. (PR #25)
113+
* Added support for custom setenv/get env using `WOLFPKCS11_USER_ENV`. (PR #25)
114+
* Fix for final not being called after init in edge case pin failure. (PR #25)
115+
* Added support for hashing PIN with SHA2-256.
116+
- PKS11 uses scrypt, which uses multiple MB of memory and is not practical for embedded systems. (PR #25)
117+
82118
### wolfPKCS11 Release 1.1 (May 6, 2022)
83119

84120
* Added support for CKM_AES_CBC_PAD

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
AC_COPYRIGHT([Copyright (C) 2014-2023 wolfSSL Inc.])
99
AC_PREREQ([2.63])
10-
AC_INIT([wolfpkcs11],[1.1.0],[https://github.com/wolfssl/wolfpkcs11/issues],[wolfpkcs11],[http://www.wolfssl.com])
10+
AC_INIT([wolfpkcs11],[1.2.0],[https://github.com/wolfssl/wolfpkcs11/issues],[wolfpkcs11],[http://www.wolfssl.com])
1111
AC_CONFIG_AUX_DIR([build-aux])
1212

1313
# The following sets CFLAGS to empty if unset on command line.
@@ -32,7 +32,7 @@ AC_ARG_PROGRAM
3232
AC_CONFIG_MACRO_DIR([m4])
3333
AC_CONFIG_HEADERS([wolfpkcs11/config.h])
3434

35-
WOLFPKCS11_LIBRARY_VERSION=2:0:0
35+
WOLFPKCS11_LIBRARY_VERSION=3:0:0
3636
# | | |
3737
# +------+ | +---+
3838
# | | |

src/internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6953,7 +6953,7 @@ int WP11_Ec_GenerateKeyPair(WP11_Object* pub, WP11_Object* priv,
69536953
CK_BBOOL isSign = CK_FALSE;
69546954
CK_ULONG len = sizeof(isSign);
69556955
ret = WP11_Object_GetAttr(priv, CKA_SIGN, &isSign, &len);
6956-
if (isSign)
6956+
if (ret == 0 && isSign)
69576957
priv->slot->tpmCtx.eccKey = (WOLFTPM2_KEY*)&priv->tpmKey;
69586958
else
69596959
priv->slot->tpmCtx.ecdhKey = (WOLFTPM2_KEY*)&priv->tpmKey;

tests/pkcs11mtt.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6527,6 +6527,12 @@ int pkcs11test_mtt(int argc, char* argv[])
65276527
return 1;
65286528
}
65296529
testCase = atoi(*argv);
6530+
if (testCase <= 0 || testCase > testFuncCnt) {
6531+
fprintf(stderr, "Test case out of range: %s\n", *argv);
6532+
return 1;
6533+
}
6534+
testFunc[testCase - 1].run = 1;
6535+
onlySet = 1;
65306536
}
65316537
else if (string_matches(*argv, "-token")) {
65326538
argc--;

tests/pkcs11test.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ static CK_RV test_open_close_session(void* args)
699699
funcList->C_CloseSession(session);
700700

701701
ret = funcList->C_Logout(soSession);
702+
CHECK_CKR(ret, "Session Logout failed");
702703
}
703704
ret = funcList->C_CloseSession(soSession);
704705
}
@@ -2646,6 +2647,7 @@ static CK_RV test_wrap_unwrap_key(void* args)
26462647

26472648
memset(wrappingKeyData, 9, sizeof(wrappingKeyData));
26482649
memset(keyData, 7, sizeof(keyData));
2650+
memset(&mech, 0, sizeof(mech));
26492651
wrappedKeyLen = sizeof(wrappedKey);
26502652

26512653
ret = get_generic_key(session, wrappingKeyData, sizeof(wrappingKeyData),
@@ -7942,6 +7944,12 @@ int pkcs11test_test(int argc, char* argv[])
79427944
return 1;
79437945
}
79447946
testCase = atoi(*argv);
7947+
if (testCase <= 0 || testCase > testFuncCnt) {
7948+
fprintf(stderr, "Test case out of range: %s\n", *argv);
7949+
return 1;
7950+
}
7951+
testFunc[testCase - 1].run = 1;
7952+
onlySet = 1;
79457953
}
79467954
else if (string_matches(*argv, "-token")) {
79477955
argc--;

wolfpkcs11/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
extern "C" {
2929
#endif
3030

31-
#define LIBWOLFPKCS11_VERSION_STRING "1.1.0"
32-
#define LIBWOLFPKCS11_VERSION_HEX 0x01001000
31+
#define LIBWOLFPKCS11_VERSION_STRING "1.2.0"
32+
#define LIBWOLFPKCS11_VERSION_HEX 0x01002000
3333

3434
#ifdef __cplusplus
3535
}

0 commit comments

Comments
 (0)