return then;
}
+#define PIN "1234"
+
static void tls_log_func(int level, const char *str)
{
fprintf(stderr, "|<%d>| %s", level, str);
unsigned flags, char *pin, size_t pin_max)
{
if (attempt == 0) {
- strcpy(pin, "1234");
+ strcpy(pin, PIN);
return 0;
}
return -1;
gnutls_x509_crt_t ca;
gnutls_datum_t tmp;
+ unsetenv("SOFTHSM_CONF");
/* The overloading of time() seems to work in linux (ELF?)
* systems only. Disable it on windows.
*/
fprintf(stderr, "error writing %s\n", CONFIG);
exit(1);
}
+ remove("./softhsm-issuer.db");
fputs("0:./softhsm-issuer.db\n", fp);
fclose(fp);
setenv("SOFTHSM_CONF", CONFIG, 0);
- system("softhsm --init-token --slot 0 --label test --so-pin 1234 --pin 1234");
+ system("/usr/bin/softhsm --init-token --slot 0 --label test --so-pin "PIN" --pin "PIN);
ret = gnutls_pkcs11_add_provider(lib, "trusted");
if (ret < 0) {
printf("\tVerifying...");
/* initialize softhsm token */
- ret = gnutls_pkcs11_token_init(URL, "1234", "test");
+ ret = gnutls_pkcs11_token_init(URL, PIN, "test");
if (ret < 0) {
fail("gnutls_pkcs11_token_init\n");
exit(1);