3232
3333#include <stdio.h>
3434
35- #ifdef _POSIX_THREADS
35+ #if defined( _POSIX_THREADS ) && !defined( SINGLE_THREADED )
3636#include <wolfssl/wolfcrypt/misc.h>
3737#include <wolfpkcs11/pkcs11.h>
3838
@@ -49,14 +49,14 @@ static void* dlib;
4949#endif
5050static CK_FUNCTION_LIST * funcList ;
5151static int slot ;
52- const char * tokenName = "wolfpkcs11" ;
52+ static const char * tokenName = "wolfpkcs11" ;
5353
5454/* FIPS requires pin to be at least 14 characters, since it is used for
5555 * the HMAC key */
5656static byte * soPin = (byte * )"password123456" ;
5757static int soPinLen = 14 ;
58- byte * userPin = (byte * )"wolfpkcs11-test" ;
59- int userPinLen ;
58+ static byte * userPin = (byte * )"wolfpkcs11-test" ;
59+ static int userPinLen ;
6060
6161#if !defined(NO_RSA ) || defined(HAVE_ECC ) || !defined(NO_DH )
6262static CK_OBJECT_CLASS pubKeyClass = CKO_PUBLIC_KEY ;
@@ -6482,7 +6482,11 @@ static void Usage(void)
64826482 printf ("<num> Test case number to try\n" );
64836483}
64846484
6485+ #ifndef NO_MAIN_DRIVER
64856486int main (int argc , char * argv [])
6487+ #else
6488+ int pkcs11test_mtt (int argc , char * argv [])
6489+ #endif
64866490{
64876491 int ret ;
64886492 CK_RV rv ;
@@ -6603,12 +6607,16 @@ int main(int argc, char* argv[])
66036607
66046608#else
66056609
6610+ #ifndef NO_MAIN_DRIVER
66066611int main (int argc , char * argv [])
6612+ #else
6613+ int pkcs11test_mtt (int argc , char * argv [])
6614+ #endif
66076615{
66086616 (void )argc ;
66096617 (void )argv ;
66106618 fprintf (stderr , "%s: multi-threaded example not compiled in!\n" , argv [0 ]);
66116619 return 0 ;
66126620}
66136621
6614- #endif /* _POSIX_THREADS */
6622+ #endif /* _POSIX_THREADS && !SINGLE_THREADED */
0 commit comments