# HG changeset patch # User Mychaela Falconia # Date 1613784050 0 # Node ID c0cd0d4635bb18797c03de2fcebd1b7f2bb25d2d # Parent 8e70ee7c194f226374f019807e2434a7bcfaedba fc-simtool verify-sjs1-adm1 command implemented diff -r 8e70ee7c194f -r c0cd0d4635bb simtool/dispatch.c --- a/simtool/dispatch.c Sat Feb 20 00:48:22 2021 +0000 +++ b/simtool/dispatch.c Sat Feb 20 01:20:50 2021 +0000 @@ -80,6 +80,7 @@ extern int cmd_verify_chv(); extern int cmd_verify_ext(); extern int cmd_verify_hex(); +extern int cmd_verify_sjs1_adm1(); extern int cmd_write_iccid(); extern int cmd_write_imsi(); @@ -187,6 +188,7 @@ {"verify-hex", 2, 2, 0, cmd_verify_hex}, {"verify-pin1", 1, 1, 0, cmd_verify_chv}, {"verify-pin2", 1, 1, 0, cmd_verify_chv}, + {"verify-sjs1-adm1", 1, 1, 0, cmd_verify_sjs1_adm1}, {"write-iccid", 1, 1, 0, cmd_write_iccid}, {"write-imsi", 1, 1, 0, cmd_write_imsi}, {0, 0, 0, 0, 0} diff -r 8e70ee7c194f -r c0cd0d4635bb simtool/sysmo.c --- a/simtool/sysmo.c Sat Feb 20 00:48:22 2021 +0000 +++ b/simtool/sysmo.c Sat Feb 20 01:20:50 2021 +0000 @@ -13,6 +13,31 @@ #include "curfile.h" #include "file_id.h" +cmd_verify_sjs1_adm1(argc, argv) + char **argv; +{ + u_char cmd[13]; + int rc; + + /* UICC-style VERIFY PIN command APDU */ + cmd[0] = 0x00; + cmd[1] = 0x20; + cmd[2] = 0x00; + cmd[3] = 0x0A; + cmd[4] = 8; + rc = encode_pin_entry(argv[1], cmd + 5); + if (rc < 0) + return(rc); + rc = apdu_exchange(cmd, 13); + if (rc < 0) + return(rc); + if (sim_resp_sw != 0x9000) { + fprintf(stderr, "bad SW response: %04X\n", sim_resp_sw); + return(-1); + } + return(0); +} + cmd_fix_sysmo_msisdn() { int rc;