diff options
-rw-r--r-- | lib/libsectok/cyberflex.c | 25 | ||||
-rw-r--r-- | lib/libsectok/sectok.h | 3 |
2 files changed, 26 insertions, 2 deletions
diff --git a/lib/libsectok/cyberflex.c b/lib/libsectok/cyberflex.c index 17305df7f0f..b157e563f1a 100644 --- a/lib/libsectok/cyberflex.c +++ b/lib/libsectok/cyberflex.c @@ -1,4 +1,4 @@ -/* $Id: cyberflex.c,v 1.1 2001/06/25 19:59:37 rees Exp $ */ +/* $Id: cyberflex.c,v 1.2 2001/06/25 23:14:29 markus Exp $ */ /* copyright 2000 @@ -207,3 +207,26 @@ cyberflex_load_rsa_priv(int fd, int cla, unsigned char *key_fid, printf ("rsa key loading done! :)\n"); return 0; } + +int +cyberflex_verify_AUT0(int fd, int cla, unsigned char *aut0, int aut0len) +{ + int n, r1, r2; + + n = scwrite(fd, cla, 0x2a, 0, 0, aut0len, aut0, &r1, &r2); + if (n >= 0 && cla == 0 && r1 == 0x6d) { + /* F0 card? */ + n = scwrite(fd, 0xf0, 0x2a, 0, 0, aut0len, aut0, &r1, &r2); + if (r1 == 0x90) { + printf("class F0\n"); + cla = 0xf0; + } + } + printf("Verify key: "); + if (n < 0) { + printf("scwrite failed\n"); + return -1; + } + dump_reply(NULL, 0, r1, r2); + return 0; +} diff --git a/lib/libsectok/sectok.h b/lib/libsectok/sectok.h index 542689730f9..b1863b50e11 100644 --- a/lib/libsectok/sectok.h +++ b/lib/libsectok/sectok.h @@ -1,4 +1,4 @@ -/* $Id: sectok.h,v 1.5 2001/06/25 20:03:26 rees Exp $ */ +/* $Id: sectok.h,v 1.6 2001/06/25 23:14:29 markus Exp $ */ /* copyright 1997, 2000 @@ -125,6 +125,7 @@ int cyberflex_load_rsa_pub(int fd, int cla, unsigned char *key_fid, int key_len, unsigned char *key_data); int cyberflex_load_rsa_priv(int fd, int cla, unsigned char *key_fid, int nkey_elems, int keylen, unsigned char *key_elems[]); +int cyberflex_verify_AUT0(int fd, int cla, unsigned char *aut0, int aut0len); /* SCPERF - performance evaluation */ #ifdef SCPERF |