Page MenuHome GnuPG

delete-secret-key does not delete all secret keys, when primary secret key is stripped in keyring
Open, NormalPublic

Description

I have an keypair with stripped primary secret key.

sec# rsa4096/0000000000001111 2021-02-28 [C]
uid [ ultimativ ] John doe <john.doe@none.com>
ssb rsa3072/0000000000002222 2021-02-28 [E]
ssb rsa3072/0000000000003333 2021-02-28 [SA]

  • When I'm deleting the pubkey with delete-keys, no warning (as usual) is issued before deleting and the secret subkeys remain in private-keys-v1.d
  • delete-secret-keys with the primary keyid returns "key 00001111 not found"
  • delete-secret-keys with the subkey keyid returns "key 00002222 not found"
  • delete-secret-keys with the subkey keyid and exclamation mark deletes specific secret subkey (expected behavior)

delete-secret-key with the primary keyid should delete all secret-(sub)keys, even if primary secret-key is stripped. secret-key warning should be issued when using delete-keys

Details

Version
2.4.0 (debian), with libcrypt 1.10.2

Event Timeline

werner triaged this task as Normal priority.Apr 20 2023, 9:01 AM
werner edited projects, added Feature Request, gnupg24; removed Bug Report.

I confirmed that this is present in version 2.2.40 on debian as well.