Repository navigation
Use the reader's PIN pad for PIN verification when available - #11
Merged
Merged
Conversation
When the reader (or a device with its own PIN entry, such as a hardware wallet running an OpenPGP card application) reports a VERIFY pin pad feature, ask the user to enter the PIN there instead of requesting it through the age client. The PIN then never passes through the host, where a keylogger could record it. Readers without a pin pad behave as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Martin Monperrus (AI-assisted) <martin.monperrus+ai@gnieh.org>
Owner
|
Okay it works 👌 the CI failed for some docker caching issue but went through the test cases. Of course the PIN-pad entry case cannot be tested by me but I presume you already tested that manually? :) |
Contributor
Author
|
yes, tested.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the card reader reports a PIN pad for VERIFY (
feature_pinpad_verify), the plugin now asks the user to enter the PIN there (verify_user_pinpad) instead of requesting it through the age client. Readers without a PIN pad behave exactly as before.Why: with the current code the PIN always travels through the host (age client prompt, then the plugin), where any keylogger can record it. The
openpgp-cardcrate already supports PIN pad verification; this uses it when available. Besides classic PIN pad readers, it matters for devices that provide their own PIN entry, such as hardware wallets running an OpenPGP card application.The README gets one sentence about it.
Testing:
cargo clippy --all-targets -- -D warningsand nightlycargo fmt --checkpass.scripts/encrypt-decrypt.shon the virtual opcard) passes. The virtual reader has no PIN pad, so it covers the unchanged fallback path; the PIN pad path itself is not exercised by the virtual card, and I have not yet tested it on hardware with a PIN pad.Thank you for the plugin: I am planning to use it for a recovery setup where the decryption key must stay on the device.
🤖 Generated with Claude Code