diff 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
line wrap: on
line diff
--- a/simtool/sws.c	Wed Mar 17 00:42:47 2021 +0000
+++ b/simtool/sws.c	Wed Mar 17 00:49:50 2021 +0000
@@ -62,3 +62,33 @@
 		return(-1);
 	return verify_chv_func(0x0A, pin);
 }
+
+cmd_sws_auth_pin1()
+{
+	int rc;
+	struct dbread_state dbs;
+	char *pin;
+
+	rc = lookup_sws_card(&dbs);
+	if (rc < 0)
+		return(rc);
+	pin = dbread_find_key_req(&dbs, "PIN1");
+	if (!pin)
+		return(-1);
+	return verify_chv_func(0x01, pin);
+}
+
+cmd_sws_auth_pin2()
+{
+	int rc;
+	struct dbread_state dbs;
+	char *pin;
+
+	rc = lookup_sws_card(&dbs);
+	if (rc < 0)
+		return(rc);
+	pin = dbread_find_key_req(&dbs, "PIN2");
+	if (!pin)
+		return(-1);
+	return verify_chv_func(0x02, pin);
+}