On 28/05/2026 18:55, Joshua Hudson via Gnupg-users wrote:
I have here a private key that gpg won't import.

~/keystest$ gpg --homedir home --import private2.gpg
gpg: WARNING: unsafe permissions on homedir '/home/DEXTER2/jhudson/ keystest/home'
gpg: read_block: read error: Invalid packet
gpg: import from 'private2.gpg' failed: Invalid keyring
gpg: Total number processed: 0

The problem with the error message is it's wrong. I have hand verified the packet structure is correct. The file can be imported by https://github.com/mattosaurus/ pgpcore (which isn't
where it came from) and the resulting imported key is a working key.

The first MPI length in the secret key packet (rsa public n) is incorrect. It is 0x07ff, but the high bit of the next byte (0xa7) is set - which implies the length *should* have been 0x8000.

This is particularly unusual considering that it is using SOSes (i.e. with untrimmed leading zero bits) for at least some of the other MPIs (I haven't checked them all).

What did you use to generate this?

A

_______________________________________________
Gnupg-users mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to