{
if (strcmp (cached_url, token_url) == 0)
{
+ if (strlen(pin) >= sizeof(cached_pin))
+ {
+ fprintf (stderr, "Too long PIN given\n");
+ exit (1);
+ }
+
strcpy (pin, cached_pin);
return 0;
}
}
}
- password = getpass ("Enter pin: ");
+ password = getpass ("Enter PIN: ");
if (password == NULL || password[0] == 0)
{
- fprintf (stderr, "No password given\n");
+ fprintf (stderr, "No PIN given\n");
exit (1);
}
pin[len] = 0;
/* cache */
+ if (strlen(pin) >= sizeof(cached_pin))
+ {
+ fprintf (stderr, "Too long PIN given\n");
+ exit (1);
+ }
+
strcpy (cached_pin, pin);
free (cached_url);
cached_url = strdup (token_url);
pin = getpass ("Enter Security Officer's PIN: ");
if (pin == NULL)
- exit (0);
+ exit (1);
+
+ if (strlen(pin) >= sizeof(so_pin))
+ exit (1);
strcpy (so_pin, pin);
pin = getpass ("Enter new User's PIN: ");
if (pin == NULL)
- exit (0);
+ exit (1);
ret = gnutls_pkcs11_token_init (url, so_pin, label);
if (ret < 0)