1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Allow no protection in pinentry-mode=loopback.

When the inquired passphrase has a 0 length then treat it as no
protection.
This commit is contained in:
Ben Kibbey 2011-09-12 20:13:19 -04:00 committed by Werner Koch
parent eb5709f554
commit 0dcf517700
2 changed files with 12 additions and 2 deletions

View file

@ -313,8 +313,13 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt,
err = pinentry_loopback(ctrl, "NEW_PASSPHRASE", &buffer, &size, len);
if (!err)
{
buffer[size] = 0;
*r_passphrase = buffer;
if (size)
{
buffer[size] = 0;
*r_passphrase = buffer;
}
else
*r_passphrase = NULL;
}
return err;
}