Unable to import GPG key
Summary
Can't add GPG keys generated with GnuPG for Linux running on WSL2 for Windows.
Steps to reproduce
- Generate a GPG key in Ubuntu or Debian on WSL2 for Windows
- Try to add it under GPG keys in user profile settings
Example Project
N/A
What is the current bug behavior?
Adding a GPG public key results in the following error message:
The form contains the following errors
- Fingerprint can't be blank
- Primary keyid can't be blank
What is the expected correct behavior?
The dialog accepts the pasted public key and adds it to my profile. I've tested several keys and all have the same issue. I tested the keys on GitHub and they were added without issue.
A key I generated using GnuPG for Windows on the same machine was accepted.
Relevant logs and/or screenshots
Example key which reproduces this behaviour. It's 1024-bit RSA simply for brevity; the behaviour replicates with 4096-bit RSA as well:
-----BEGIN PGP PUBLIC KEY BLOCK-----
mI0EYF/HYQEEAKFr7BHAmJ9LXCOpFTpkuVYQH69kWnxtuEBXSy4NIdbezLGfxMW2
75hZZksP4M6Kuj9f0+HFLRyqdVJSi2trEGq8YaVJEEgXoXOOKgW/RiZEJrLQNtQu
xaU3eZqVuoWCRCm+dvY+soj2twBJmUzq/2JlTOyC6/FgRmp/seD9QwtZABEBAAG0
I01pa2UgRWhlbGVyIDxtaWtlLmVoZWxlckBnbWFpbC5jb20+iM4EEwEKADgWIQTL
sWmoEJIyRQgPOg7Oaz6i1VQ8KAUCYF/HYQIbAwULCQgHAgYVCgkICwIEFgIDAQIe
AQIXgAAKCRDOaz6i1VQ8KMGSA/0YP/7Mx0H++jon0kDuHx6DJv7TzKZNaPUMLmpa
m9jJGRoWTtFbzkwz3q68kGKPHu8PSIpapRF4rtZ98zqJkVCpJLN66Pq/GP+bY2jY
/6h/oeHwbY+zUMeOWNu0MaAEpWVwiLPRK2oMemAX4TzXGDXtMlGLTRH14xuFuCVq
Qnr8zA==
=mFqw
-----END PGP PUBLIC KEY BLOCK-----
Environment information
Ubuntu 20.04 running in WSL2 on Windows 10.
$ uname -a
Linux office-pc 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ gpg --version
gpg (GnuPG) 2.2.19
libgcrypt 1.8.5
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Home: /home/mike/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
Output of checks
This bug happens on GitLab.com
Possible fixes
Unknown.
Edited by Mike Eheler