FreeCalypso > hg > fc-sim-tools
comparison simtool/sws.c @ 32:d0be3802410a
fc-simtool sws-auth-pin[12] implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 17 Mar 2021 00:49:50 +0000 |
parents | cca7d0528f89 |
children | c83ec3bd9d67 |
comparison
equal
deleted
inserted
replaced
31:cca7d0528f89 | 32:d0be3802410a |
---|---|
60 pin = dbread_find_key_req(&dbs, "ADM1"); | 60 pin = dbread_find_key_req(&dbs, "ADM1"); |
61 if (!pin) | 61 if (!pin) |
62 return(-1); | 62 return(-1); |
63 return verify_chv_func(0x0A, pin); | 63 return verify_chv_func(0x0A, pin); |
64 } | 64 } |
65 | |
66 cmd_sws_auth_pin1() | |
67 { | |
68 int rc; | |
69 struct dbread_state dbs; | |
70 char *pin; | |
71 | |
72 rc = lookup_sws_card(&dbs); | |
73 if (rc < 0) | |
74 return(rc); | |
75 pin = dbread_find_key_req(&dbs, "PIN1"); | |
76 if (!pin) | |
77 return(-1); | |
78 return verify_chv_func(0x01, pin); | |
79 } | |
80 | |
81 cmd_sws_auth_pin2() | |
82 { | |
83 int rc; | |
84 struct dbread_state dbs; | |
85 char *pin; | |
86 | |
87 rc = lookup_sws_card(&dbs); | |
88 if (rc < 0) | |
89 return(rc); | |
90 pin = dbread_find_key_req(&dbs, "PIN2"); | |
91 if (!pin) | |
92 return(-1); | |
93 return verify_chv_func(0x02, pin); | |
94 } |