mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-02 16:43:03 +01:00
gpg: --delete-secret-key - check that a secret key exists.
* g10/delkey.c (do_delete_key): Check availibility of a secret key. -- Actually we check that at least one secret subkey exists.
This commit is contained in:
parent
cf648fc5c8
commit
1d33d03f0b
@ -111,6 +111,15 @@ do_delete_key( const char *username, int secret, int force, int *r_sec_avail )
|
||||
err = 0;
|
||||
}
|
||||
|
||||
if (secret && !have_secret_key_with_kid (keyid))
|
||||
{
|
||||
err = gpg_error (GPG_ERR_NOT_FOUND);
|
||||
log_error (_("key \"%s\" not found: %s\n"), username, gpg_strerror (err));
|
||||
write_status_text (STATUS_DELETE_PROBLEM, "1");
|
||||
goto leave;
|
||||
}
|
||||
|
||||
|
||||
if (opt.batch && exactmatch)
|
||||
okay++;
|
||||
else if (opt.batch && secret)
|
||||
|
Loading…
x
Reference in New Issue
Block a user