From 46259ce63d8c4a3eef2be38f145eabd6be59a93a Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 14 Feb 2013 16:38:38 +0900 Subject: [PATCH] fix Le field handling --- ChangeLog | 1 - src/openpgp.c | 2 +- tool/gnuk_token.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0934dd..5c77bf9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,7 +15,6 @@ * src/gnuk.h (CHALLENGE_LEN): Moved here (was: openpgp.c). * tool/gnuk_token.py (iso7816_compose): Add Le field. - (gnuk_token.cmd_get_challenge): Supply Le. 2013-01-30 Niibe Yutaka diff --git a/src/openpgp.c b/src/openpgp.c index a7e301b..af0306f 100644 --- a/src/openpgp.c +++ b/src/openpgp.c @@ -1049,7 +1049,7 @@ cmd_get_challenge (void) return; } else if (len == 0) - /* backward compatibility */ + /* Le is not specified. Return full-sized challenge by GET_RESPONSE. */ len = CHALLENGE_LEN; if (challenge) diff --git a/tool/gnuk_token.py b/tool/gnuk_token.py index 0c0aee7..f303876 100644 --- a/tool/gnuk_token.py +++ b/tool/gnuk_token.py @@ -431,7 +431,7 @@ class gnuk_token(object): raise ValueError, ("%02x%02x" % (sw[0], sw[1])) def cmd_get_challenge(self): - cmd_data = iso7816_compose(0x84, 0x00, 0x00, '', le=32) + cmd_data = iso7816_compose(0x84, 0x00, 0x00, '') sw = self.icc_send_cmd(cmd_data) if len(sw) != 2: raise ValueError(sw)