Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for fixed-length pinpad readers #1288

Closed
wants to merge 5 commits into from

Conversation

amaccuish
Copy link

Fixes #1221

Some pinpad readers have to be told the length of the PIN to accept. OpenPGP has a DO for storing the length. This patch reads the and parses the DO if it is properly configued, and supplies it for use for APDUs.

  • Tested with OpenSC and OpenPGP 2.1 card on MacOS and Linux (Ubuntu and Fedora)

Some pinpad readers have to be told the length of the PIN to accept. OpenPGP has a DO for storing the length. This patch reads the and parses the DO if it is properly configued, and supplies it for use for APDUs.
@frankmorgner
Copy link
Member

How did you test this? Did you test this also without PIN pad?

@frankmorgner
Copy link
Member

Your code doesn't compile

@amaccuish
Copy link
Author

Sorry didn't check x86, now compiles :)

Copy link
Member

@frankmorgner frankmorgner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like your code is a direct translation of gnupg's app-openpgp.c. First, PINPAD_REQUEST is an extension of gnupg, not OpenPGP. It would have been nice if you'd copy over the describing comment as well.

What could be problematic, is that gnupg's code is GPL licensed while OpenSC is LGPL (and historically GPL, as far as I know).

A simpler and yet more powerful (i.e. card-independant) change would be to add a configuration option to the reader section to force a fixed PIN length...

@@ -44,6 +44,8 @@
#include <openssl/sha.h>
#endif /* ENABLE_OPENSSL */

#define digitp(p) (*(p) >= '0' && *(p) <= '9')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is isdigit() in C89.

@amaccuish
Copy link
Author

Yep sorry I mentioned it came from there in the issue, I should have restated that here as well, sorry! I did also copy over and modified the comment from there.

frankmorgner added a commit to frankmorgner/OpenSC that referenced this pull request Apr 6, 2018
frankmorgner added a commit that referenced this pull request May 18, 2018
@frankmorgner frankmorgner added this to Done in Release 0.19.0 May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants