Since Debian unstable upgraded gnupg from 2.2.20-1 to 2.2.27-1 my smartcard reader -- a SCM SPR332 (which apparently has the same product ID as the SPR532) -- is broken. Specifically:
- I'm using the reader's keypad to enter my PIN.
- The first time I need to enter my PIN, everything works fine.
- Subsequent times result in a verify CHVx failed: Invalid value.
The cause seems to be commit 11d8d1e0505645f7d14bcc1c01d17a566e033705.
I've attached a patch that fixes the problem for me.