correct offs for CHUID_GUID_OFFS and change verbose print to CHUID

CHUID_GUID_OFFS was 28 instead of 29, leading to invalid CHUID
verbose print said "setting GUID.." changing to CHUID

patch from Doug Engert
fixes #9
This commit is contained in:
Klas Lindfors
2014-11-10 09:49:54 +01:00
parent d10d5da6c0
commit 7e0fdd8f9d
+2 -2
View File
@@ -57,7 +57,7 @@ unsigned const char chuid_tmpl[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0x08, 0x32, 0x30, 0x33, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0x08, 0x32, 0x30, 0x33, 0x30, 0x30,
0x31, 0x30, 0x31, 0x3e, 0x00, 0xfe, 0x00, 0x31, 0x30, 0x31, 0x3e, 0x00, 0xfe, 0x00,
}; };
#define CHUID_GUID_OFFS 28 #define CHUID_GUID_OFFS 29
unsigned const char sha1oid[] = { unsigned const char sha1oid[] = {
0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00,
@@ -469,7 +469,7 @@ static bool set_chuid(ykpiv_state *state, int verbose) {
return false; return false;
} }
if(verbose) { if(verbose) {
fprintf(stderr, "Setting the GUID to: "); fprintf(stderr, "Setting the CHUID to: ");
dump_hex(chuid, sizeof(chuid)); dump_hex(chuid, sizeof(chuid));
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }