mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
scd: Support clearing of Reset Code by ''.
* scd/app-openpgp.c (do_change_pin): Allow null-string. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
63427a0e4e
commit
4e02db75e3
@ -3477,7 +3477,9 @@ do_change_pin (app_t app, ctrl_t ctrl, const char *chvnostr,
|
||||
}
|
||||
else if (set_resetcode)
|
||||
{
|
||||
if (strlen (pinvalue) < 8)
|
||||
size_t bufferlen = strlen (pinvalue);
|
||||
|
||||
if (bufferlen != 0 && bufferlen < 8)
|
||||
{
|
||||
log_error (_("Reset Code is too short; minimum length is %d\n"), 8);
|
||||
rc = gpg_error (GPG_ERR_BAD_PIN);
|
||||
@ -3485,7 +3487,6 @@ do_change_pin (app_t app, ctrl_t ctrl, const char *chvnostr,
|
||||
else
|
||||
{
|
||||
char *buffer = NULL;
|
||||
size_t bufferlen;
|
||||
|
||||
rc = pin2hash_if_kdf (app, 0, pinvalue, &buffer, &bufferlen);
|
||||
if (!rc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user