mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpg: Emit status error for an invalid ADSK.
* g10/keygen.c (prepare_adsk): Emit status error. -- This is useful for GPGME. GnuPG-bug-id: 7322
This commit is contained in:
parent
f8f6c6c761
commit
e8858807bc
@ -5044,6 +5044,7 @@ menu_addadsk (ctrl_t ctrl, kbnode_t pub_keyblock, const char *adskfpr)
|
|||||||
NULL, adsk_pk, answer, &adsk_keyblock, NULL, 1);
|
NULL, adsk_pk, answer, &adsk_keyblock, NULL, 1);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
|
write_status_error ("add_adsk", err);
|
||||||
log_info (_("key \"%s\" not found: %s\n"), answer,
|
log_info (_("key \"%s\" not found: %s\n"), answer,
|
||||||
gpg_strerror (err));
|
gpg_strerror (err));
|
||||||
if ((!opt.batch || adskfpr) && !opt.quiet
|
if ((!opt.batch || adskfpr) && !opt.quiet
|
||||||
@ -5069,6 +5070,7 @@ menu_addadsk (ctrl_t ctrl, kbnode_t pub_keyblock, const char *adskfpr)
|
|||||||
}
|
}
|
||||||
if (!node)
|
if (!node)
|
||||||
{
|
{
|
||||||
|
write_status_error ("add_adsk", err);
|
||||||
err = gpg_error (GPG_ERR_WRONG_KEY_USAGE);
|
err = gpg_error (GPG_ERR_WRONG_KEY_USAGE);
|
||||||
log_info (_("key \"%s\" not found: %s\n"), answer,
|
log_info (_("key \"%s\" not found: %s\n"), answer,
|
||||||
gpg_strerror (err));
|
gpg_strerror (err));
|
||||||
|
@ -4665,6 +4665,7 @@ prepare_adsk (ctrl_t ctrl, const char *name)
|
|||||||
{
|
{
|
||||||
if (namebuffer && (p=strchr (namebuffer, '!')))
|
if (namebuffer && (p=strchr (namebuffer, '!')))
|
||||||
*p = 0; /* Strip the ! for the diagnostic. */
|
*p = 0; /* Strip the ! for the diagnostic. */
|
||||||
|
write_status_error ("add_adsk", err);
|
||||||
log_error ("invalid ADSK '%s' specified: %s\n", name, gpg_strerror (err));
|
log_error ("invalid ADSK '%s' specified: %s\n", name, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
free_public_key (adsk_pk);
|
free_public_key (adsk_pk);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user