24 lines
555 B
Text
24 lines
555 B
Text
|
|
||
|
char *passwdcb(PK11SlotInfo * slot, PRBool retry, void *arg)
|
||
|
{
|
||
|
if (!isatty(STDIN_FILENO) && retry) {
|
||
|
/* we're just reading from a file, and the value is known to be wrong,
|
||
|
* don't keep bounding the token with the wrong password. */
|
||
|
return NULL;
|
||
|
}
|
||
|
|
||
|
if (retry) {
|
||
|
printf("Warning: Wrong PIN has been provided in the previous attempt\n");
|
||
|
if (PK11_IsHW(slot)) {
|
||
|
printf
|
||
|
(" NOTE: multiple pin failures could result in locking your device\n");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (pin == NULL)
|
||
|
return pin;
|
||
|
else
|
||
|
return strdup(pin);
|
||
|
}
|
||
|
|