Skip to content

Commit a93cf0c

Browse files
committed
Add file storage safety to wolfPKCS11
Ensure token storage validates configured directories, uses atomic temp files for updates, and returns errors when no secure path is available. Document the updated storage path resolution and adjust the storage tests to cover the missing-path failure case.
1 parent 793e264 commit a93cf0c

4 files changed

Lines changed: 351 additions & 118 deletions

File tree

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,12 @@ NOTE: In the code, we have embedded a test key. This must be changed for
9898

9999
### WOLFPKCS11_TOKEN_PATH
100100

101-
Path into which files are stored that contain token data.
102-
When not set, defaults to: /tmp
101+
Path into which files are stored that contain token data. If unset, wolfPKCS11
102+
tries, in order, the directory specified by `WOLFPKCS11_TOKEN_PATH`, any store
103+
directory configured by NSS, the user's home directory (`~/.wolfPKCS11` on
104+
POSIX or `%APPDIR%\wolfPKCS11` on Windows), and finally the optional
105+
`WOLFPKCS11_DEFAULT_TOKEN_PATH` build-time setting. There is no fallback to
106+
`/tmp`; deployments must provide a secure storage location explicitly.
103107

104108
### WOLFPKCS11_NO_STORE
105109

@@ -287,4 +291,3 @@ Adds backend support for TPM 2.0 using wolfTPM. Adds AES CBC key wrap / unwrap s
287291
### wolfPKCS11 Release 1.0 (October 20, 2021)
288292

289293
* Initial PKCS11 support
290-

0 commit comments

Comments
 (0)