From 29407cf2d885cc6c999df8e4778a0d06fb17438f Mon Sep 17 00:00:00 2001 From: aj Date: Wed, 2 Dec 2009 09:52:12 +0000 Subject: [PATCH] fixed and tested by Viktor TARASOV. Thanks! git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3872 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/tools/cardos-tool.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/tools/cardos-tool.c b/src/tools/cardos-tool.c index b1cf80bf..60a8ea64 100644 --- a/src/tools/cardos-tool.c +++ b/src/tools/cardos-tool.c @@ -957,16 +957,15 @@ static int cardos_change_startkey(const char *change_startkey_apdu) unsigned char checksum[SHA256_DIGEST_LENGTH]; static const unsigned char cardos_43b_checksum[SHA256_DIGEST_LENGTH] = - { 0x6E, 0x34, 0x0B, 0x9C, 0xFF, 0xB3, 0x7A, 0x98, - 0x9C, 0xA5, 0x44, 0xE6, 0xBB, 0x78, 0x0A, 0x2C , - 0x78, 0x90, 0x1D, 0x3F, 0xB3, 0x37, 0x38, 0x76, - 0x85, 0x11, 0xA3, 0x06, 0x17, 0xAF, 0xA0, 0x1D }; - + { 0xA5, 0x17, 0x9A, 0x88, 0xC8, 0x78, 0x50, 0x0C, + 0x43, 0x3B, 0xD5, 0xD1, 0x3E, 0x34, 0x65, 0x3D, + 0x74, 0x7A, 0xDA, 0x19, 0x07, 0x5B, 0xCA, 0xC3, + 0xF0, 0xD3, 0xDC, 0x8B, 0xB7, 0xFB, 0xC5, 0xB4 }; static const unsigned char cardos_40_checksum[SHA256_DIGEST_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; if (sc_hex_to_bin(change_startkey_apdu, apdu_bin, &apdu_len) != 0) { printf("can't convert startkey apdu to binary format: aborting\n"); @@ -1062,13 +1061,13 @@ change_startkey: return 1; } - if (apdu.resp[3] != 0xff) { - printf("startkey version is 0x%02x, should have been changed to 0xff.\n", apdu.resp[3]); + if (apdu.resp[2] != 0xff) { + printf("startkey version is 0x%02x, should have been changed to 0xff.\n", apdu.resp[2]); printf("aborting\n"); return 1; } - printf("startkey is now 0xff, success!"); + printf("startkey is now 0xff, success!\n"); return 0; } # else /* ENABLE_OPENSSL */