Fix admin-less mode -> admin-full mode change.

This commit is contained in:
NIIBE Yutaka
2018-04-05 12:13:45 +09:00
parent d9c5dcf206
commit d76534dd3a
2 changed files with 22 additions and 2 deletions

View File

@@ -1,3 +1,7 @@
2018-04-05 NIIBE Yutaka <gniibe@fsij.org>
* src/openpgp.c (cmd_change_password): Care admin-less mode.
2018-04-04 NIIBE Yutaka <gniibe@fsij.org>
* tests: Add more tests, key generation and KDF support.

View File

@@ -366,8 +366,24 @@ cmd_change_password (void)
if (ks_pw3 == NULL)
{
salt = NULL;
salt_len = 0;
if (admin_authorized == BY_USER)
{
const uint8_t *ks_pw1 = gpg_do_read_simple (NR_DO_KEYSTRING_PW1);
if (ks_pw1 == NULL)
{
GPG_SECURITY_FAILURE ();
return;
}
salt = KS_GET_SALT (ks_pw1);
salt_len = SALT_SIZE;
}
else
{
salt = NULL;
salt_len = 0;
}
}
else
{