Skip to content

Commit ca56b79

Browse files
committed
Add compile-time option WOLFSSL_PKCS11_RW_TOKENS
By default, wolfcrypt PKCS11 interface accesses tokens in read-only mode. In some cases, we might want to build the client with write permissions, i.e. when initializing tokens via C_InitToken(). The WOLFSSL_PKCS11_RW_TOKENS option, if present, allows write access to PKCS11 tokens.
1 parent 7d85e39 commit ca56b79

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

wolfcrypt/src/wc_pkcs11.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3755,7 +3755,12 @@ int wc_Pkcs11_CryptoDevCb(int devId, wc_CryptoInfo* info, void* ctx)
37553755
int ret = 0;
37563756
Pkcs11Token* token = (Pkcs11Token*)ctx;
37573757
Pkcs11Session session;
3758+
3759+
#ifdef WOLFSSL_PKCS11_RW_TOKENS
3760+
int readWrite = 1;
3761+
#else
37583762
int readWrite = 0;
3763+
#endif
37593764

37603765
if (devId <= INVALID_DEVID || info == NULL || ctx == NULL)
37613766
ret = BAD_FUNC_ARG;

0 commit comments

Comments
 (0)