You are not logged in.

#1 2017-04-20 03:22:58

Nycroth
Member
Registered: 2014-04-16
Posts: 7

[Solved] GnuPG Subkey Cloning on Edit

I've been searching for hours today to figure out what I have either done wrong or misunderstood. I'm sorry if this is an obvious PEBKAC level issue.

I have a PGP master and accompanying encryption/signing keys setup and today I edited the UIDs on it to account for my new email address and renew the expiry date. When I saved the modifications it did something wild, it duplicated all the encryption subkeys. I figured this was a simple issue so I went in and deleted the clones. Saved, then I got more. Every time I save, it duplicates all the subkeys. I went and tried creating an new key set altogether and same issue. Any time I go in with --edit-key and save, all the encryption keys get duplicated. Here's what I mean:

pub   rsa4096/0x401EA217DC053378 2014-03-20 [SC] [expires: 2019-04-19]
      Key fingerprint = 6008 92BD F3B1 375C 678B  8510 401E A217 DC05 3378
uid                   [ultimate] My Name <hidden>
uid                   [ultimate] My Name <redacted>
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 []
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 []
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 []
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 []
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 []
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 []
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 []
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 []
sub   rsa4096/0xF0DD8AA7D7568E5C 2017-04-20 [S] [expires: 2019-04-20]
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 []
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 [E] [expires: 2018-03-21]
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 [E] [expires: 2018-03-21]
sub   rsa4096/0xF4B3D65D6576A873 2014-03-20 [E] [expires: 2018-03-21]

The real issue here is my keyset when exported is nearly a megabyte and I cannot for example upload it to Github as it complains: "has multiple keys with the same key id".

Any ideas? I do have a config for gpg.conf:

# A rather secure pool of key servers
keyserver hkps://hkps.pool.sks-keyservers.net

# Display long key IDs
keyid-format 0xlong

# List all keys (or the specified ones) along with their fingerprints
with-fingerprint

# Display the calculated validity of user IDs during key listings
list-options show-uid-validity
verify-options show-uid-validity

# list of personal digest preferences. When multiple digests are supported by
# all recipients, choose the strongest one
personal-cipher-preferences AES256 AES192 AES CAST5

# Trust new keys by user on first use (SSH Model)
trust-model tofu

# list of personal digest preferences. When multiple ciphers are supported by
# all recipients, choose the strongest one
personal-digest-preferences SHA512 SHA384 SHA256 SHA224

# message digest algorithm used when signing a key
cert-digest-algo SHA512

# This preference list is used for new keys and becomes the default for
# "setpref" in the edit menu
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed

I have GNUPGHOME=/home/keller/.local/share/gnupg. I don't think anything's at issue in those last two points, but I include them for completeness. Seriously though, any pointers would be appreciated.

Update: Well, I got it fixed, but the solution I used was drastic. I deleted everything in my GnuPG home directory (after making a backup) and started over. I have a new master key and subkeys (which is nice as my master key is now an ec25519 key) and then I re-imported my old key to re-encrypt all the files I have encrypted with the old one. Pass, my password manager, made this very easy as all I had to do was re-init the directory with my new key.

The most notable change I noted from before and after is that the GnuPG home directory went from having publickeys.gpg and secretkeys.gpg to having pubring.kbx and private-keys-v1.d/. Everything works fine now and I didn't loose much. Sadly I didn't think to sign my new keys with my old one nor revoking my old one. I have them on my backup drive but I don't find the work worth it as I hadn't used the old one for authentication. Worst case going forward, someone pulls my old key from the key servers and decides to use a random untrusted key for some reason.

Hope someone finds this useful.

Last edited by Nycroth (2017-04-20 17:36:10)

Offline

Board footer

Powered by FluxBB