fix Le field handling

This commit is contained in:
NIIBE Yutaka 2013-02-14 16:38:38 +09:00
parent 0aca10f307
commit 46259ce63d
3 changed files with 2 additions and 3 deletions

View File

@ -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 <gniibe@fsij.org>

View File

@ -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)

View File

@ -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)