various stuff

This commit is contained in:
Klas Lindfors
2014-02-03 10:59:32 +01:00
parent f2dc1e6d62
commit 899c12a5d3
+34 -28
View File
@@ -38,36 +38,42 @@
#include "cmdline.h" #include "cmdline.h"
typedef struct unsigned const char default_key[] =
{ { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04,
unsigned char cla; 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
unsigned char ins; };
unsigned char p1;
unsigned char p2; typedef struct {
unsigned char lc; unsigned char cla;
unsigned char data[0xff]; unsigned char ins;
unsigned char p1;
unsigned char p2;
unsigned char lc;
unsigned char data[0xff];
} APDU; } APDU;
static void static void dump_hex(const unsigned char *buf, int len)
dumpHex (unsigned char *buf, int len)
{ {
int i; int i;
for(i = 0; i < len; i++) { printf("length: %d\n", len);
printf("0x%02x ", buf[i]); for (i = 0; i < len; i++) {
if(i != 0 && i % 8) { printf("0x%02x ", buf[i]);
printf("\n"); if (i % 8 == 7) {
} printf("\n");
}
}
printf("\n");
}
int main(int argc, char *argv[])
{
struct gengetopt_args_info args_info;
if (cmdline_parser(argc, argv, &args_info) != 0) {
return EXIT_FAILURE;
} }
printf("\n");
} dump_hex(default_key, 24);
int return EXIT_SUCCESS;
main (int argc, char *argv[])
{
struct gengetopt_args_info args_info;
if (cmdline_parser (argc, argv, &args_info) != 0)
return EXIT_FAILURE;
return EXIT_SUCCESS;
} }