diff --git a/pkcs11/Makefile b/pkcs11/Makefile index 3f2c1889..3085ca27 100644 --- a/pkcs11/Makefile +++ b/pkcs11/Makefile @@ -12,10 +12,10 @@ DEBUG_INC_PATHS = -MD OPTIMIZE = -Os # Options -CFLAGS+=$(DEBUG_FLAGS) -#CFLAGS+=$(OPTIMIZE) -LIBS+=$(STATIC_LIB) -ldl -lm -#LIBS+=$(DYN_LIB) +#CFLAGS+=$(DEBUG_FLAGS) +CFLAGS+=$(OPTIMIZE) +#LIBS+=$(STATIC_LIB) -ldl -lm +LIBS+=$(DYN_LIB) # build targets SRC=$(wildcard *.c) diff --git a/pkcs11/README.md b/pkcs11/README.md index 13a58766..83098b21 100644 --- a/pkcs11/README.md +++ b/pkcs11/README.md @@ -100,9 +100,19 @@ softhsm2-util --import ../certs/server-keyPkcs8.pem --slot $SOFTHSM2_SLOTID --id ## Run server and client +### Build wolfSSL + +./autogen.sh +./configure --enable-pkcs11 +make +sudo make install + +### Build Server Example + +make ./server-tls-pkcs11 $SOFTHSM2_SLOTID SoftToken cryptoki -# In wolfSSL directory +### Run Client ./examples/client/client diff --git a/pkcs11/server-tls-pkcs11.c b/pkcs11/server-tls-pkcs11.c index 8c952506..592bce1f 100644 --- a/pkcs11/server-tls-pkcs11.c +++ b/pkcs11/server-tls-pkcs11.c @@ -95,7 +95,7 @@ int server_tls(int devId) } /* Load server key into WOLFSSL_CTX */ - if (wolfSSL_CTX_use_PrivateKey_id(ctx, privKeyId, 2, 2048) != SSL_SUCCESS) { + if (wolfSSL_CTX_use_PrivateKey_id(ctx, privKeyId, 2, devId, 2048) != SSL_SUCCESS) { fprintf(stderr, "ERROR: failed to set id.\n"); return -1; }