FreeCalypso > hg > fc-pcsc-tools
view simtool/dumpdir.c @ 74:8562d8508cf2
grcard2-set-{adm,super}-hex commands implemented
It appears that GrcardSIM2 cards allow arbitrary 64-bit keys
for ADM and SUPER ADM, not necessarily consisting of ASCII digits
like the specs require for standard PIN and PUK, and pySim-prog.py
in fact sets the ADM key to 4444444444444444 in hex by default,
which is not an ASCII digit string. If the cards allow such keys,
we need to support them too.
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Tue, 16 Feb 2021 04:10:36 +0000 |
| parents | 2c72709e0891 |
| children | dcfec53643c5 |
line wrap: on
line source
/* * This module implements the dump of EF_DIR. */ #include <sys/types.h> #include <stdio.h> #include "curfile.h" #include "file_id.h" cmd_uicc_dir() { int rc; unsigned recno; rc = select_op(FILEID_MF); if (rc < 0) return(rc); rc = select_op(EF_DIR); if (rc < 0) return(rc); rc = parse_ef_select_response(); if (rc < 0) return(rc); if (curfile_structure != 0x01) { fprintf(stderr, "error: EF_DIR is not linear fixed\n"); return(-1); } if (curfile_record_len < 5) { fprintf(stderr, "error: EF_DIR record length is too short\n"); return(-1); } for (recno = 1; recno <= curfile_record_count; recno++) { rc = readrec_op(recno, 0x04, curfile_record_len); if (rc < 0) return(rc); if (check_simresp_all_blank()) continue; printf("Record #%u:\n", recno); dump_efdir_record(); } return(0); }
