[git] GnuPG - branch, scd-work, updated. gnupg-2.1.0beta3-138-g675ddb4
by NIIBE Yutaka
cvs at cvs.gnupg.org
Sun Jan 13 04:20:52 CET 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, scd-work has been updated
via 675ddb4e53057d4d5cd94ebe4521dce6fcdb52be (commit)
from aba76f91cbfe0f758e3cb61484ac5a7318cc31d6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 675ddb4e53057d4d5cd94ebe4521dce6fcdb52be
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Sun Jan 13 12:12:10 2013 +0900
SCD: Support P=N format for login data.
* scd/app-openpgp.c (parse_login_data): Support P=N format.
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 9c85c61..dc35295 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -602,9 +602,9 @@ count_bits (const unsigned char *a, size_t len)
P=<keypad-request>
- Where KEYPAD_REQUEST is 0 or a pair of two integers: <n>,<m>.
- 0 means use keypad with variable length input. <n>,<m> means use
- keypad with fixed length input. N for user PIN, M for admin PIN.
+ Where KEYPAD_REQUEST is in the format of: <n> or <n>,<m>.
+ N for user PIN, M for admin PIN. If M is missing it means M=N.
+ 0 means to force not to use keypad.
*/
static void
@@ -660,24 +660,22 @@ parse_login_data (app_t app)
if (buflen)
{
- if (*buffer == '0')
- {
- buffer++;
- buflen--;
- if (buflen && !(*buffer == '\n' || *buffer == '\x18'))
- goto next;
- /* Disable use of pinpad. */
- app->app_local->keypad.specified = 1;
- }
- else if (digitp (buffer))
+ if (digitp (buffer))
{
char *q;
int n, m;
n = strtol (buffer, &q, 10);
- if (*q++ != ',' || !digitp (q))
- goto next;
- m = strtol (q, &q, 10);
+ if (q >= (char *)buffer + buflen
+ || *q == '\x18' || *q == '\n')
+ m = n;
+ else
+ {
+ if (*q++ != ',' || !digitp (q))
+ goto next;
+ m = strtol (q, &q, 10);
+ }
+
buffer = q;
if (buflen < ((unsigned char *)q - buffer))
{
@@ -1540,14 +1538,16 @@ static int
check_keypad_request (app_t app, pininfo_t *pininfo, int admin_pin)
{
if (app->app_local->keypad.specified == 0) /* No preference on card. */
- if (pininfo->fixedlen == 0) /* Reader has varlen capability. */
- return 0; /* Then, use pinpad. */
- else
- /*
- * Reader has limited capability, and it may not match PIN of
- * the card.
- */
- return 1;
+ {
+ if (pininfo->fixedlen == 0) /* Reader has varlen capability. */
+ return 0; /* Then, use pinpad. */
+ else
+ /*
+ * Reader has limited capability, and it may not match PIN of
+ * the card.
+ */
+ return 1;
+ }
if (admin_pin)
pininfo->fixedlen = app->app_local->keypad.fixedlen_admin;
-----------------------------------------------------------------------
Summary of changes:
scd/app-openpgp.c | 48 ++++++++++++++++++++++++------------------------
1 files changed, 24 insertions(+), 24 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list