In versions 2.2.22 and 2.2.23 of GPG, generating keys on-card with a YubiKey (or possibly any other OpenPGP smart card), will fail.
To reproduce, install either of these versions of GPG, insert a YubiKey, and run the following:
$ gpg --edit-card gpg/card> admin gpg/card> generate
After answering whether to store an off-card backup of the encryption key, the process will fail without ever prompting for a PIN.
On Windows 10 2004 (19041.508), the error message will be:
gpg: error checking the PIN: Invalid value
On Manjaro Linux 20.1 however, the error will be:
gpg: error checking the PIN: End of file
- This issue was reproduced under Windows 10 with GPG 2.2.23 (via Gpg4win 3.1.13) and GPG 2.2.22 (via https://files.gpg4win.org/). Since the problem did not occur with GPG 2.2.21 (installed via Gpg4win 3.1.12), it seems the problem started in .22.
- This issue was only reproduced with GPG 2.2.23 (installed via native repositories) under Manjaro Linux 20.1. Downgrading to version 2.2.20 resolved the issue.