Commit Graph

100 Commits

Author SHA1 Message Date
Sergey Matyukevich bae8ebe907 simutil: add validate_utf8_tlv
Add helper to validate if TLV value is a valid UTF8 string.
Note that both null-terminated and non null-terminated UTF8
strings are considered valid.
2021-01-19 10:03:05 -06:00
Denis Kenzior 9111a1ac53 simutil: Remove pointless check
len is already checked >= 16 above
2019-11-13 17:01:15 -06:00
Denis Kenzior 17b6c6c314 simutil: Fix EF structure bit processing
The intent here was to find the contents of the 3 low order bits
according to Table 11-5 in ETSI 102.221.  However, the mask ended up
only grabbing the contents of the 2 low order bits.
2019-11-13 17:01:15 -06:00
Denis Kenzior 4059d4226b util: Switch character conversions to ell
Switch various conversions from GSM/UCS2 to UTF8 from glib based
implementation over to ell.

This also converts all related g_free calls to l_free calls (though in
the end they are equivalent calls to free)
2018-12-27 18:18:51 -06:00
Denis Kenzior d5f117be80 util: Convert pack7_bit / unpack_7bit to use l_malloc 2018-12-27 18:18:51 -06:00
Denis Kenzior 70c70a67b0 util: Use bool instead of gboolean 2018-12-27 18:18:51 -06:00
James Prestwood 19e8d21a7e simutil: fix bug when parsing AID type 2018-05-03 17:43:31 -05:00
Denis Kenzior 134b163182 simutil: Add sim_app_record free 2018-02-28 11:08:16 -06:00
Denis Kenzior 0e8e7346af simutil: Fix copiler warning
src/simutil.c:1573:3: warning: dereferencing type-punned pointer will break
strict-aliasing rules [-Wstrict-aliasing]
	app.type = GUINT16_FROM_BE(*((unsigned short *)(app.aid + 5)));
2018-01-19 14:12:37 -06:00
James Prestwood 671fb793fa simutil: Made UMTS/GSM authenticate more consitent
The Le parameter in the AUTHENTICATE command was not being
set for GSM authentication. This did work, but explicitly
setting it to 0 as UMTS does was more consitent.
2017-11-02 11:37:53 -05:00
James Prestwood 2bc262b3af simauth: Fixed incorrect AUTS length
The initial SimAuth implementation incorrectly parsed
the AUTS value as 16 bytes, not 14.
2017-10-20 14:08:57 -05:00
James Prestwood 2a1982e8c0 simutil: Added authenticate builder/parser API
Used to compose/parse non-TLV formatted authenticate commands
for GSM and UMTS authentication.
2017-10-11 10:29:13 -05:00
James Prestwood eb2915e231 simutil: Added app type to application parser
Parsing a SIM application only copied the 16 byte AID
portion, which included the application type. Parsing out
the type makes sorting much easier for modules using the
parser.
2017-10-11 10:26:24 -05:00
John Ernberg a0a766678c simutil: Use g_slist_free_full 2016-04-22 15:31:27 -05:00
Nishanth V b04f9e962c simutil: Add EFACL in elementary file db 2016-04-21 10:01:16 -05:00
Alfonso Sanchez-Beato 46de4df677 simutil: Fix EF_PNN access
EF_PNN was not being read properly (see TS 24.008, section 10.5.3.5a,
for network names format), which affected the displayed PLMN name for
some MVNOs. Some modems already read the file and return the right
string: these do not show the problem.
2014-03-14 12:24:26 -05:00
Marcel Holtmann 0a496ab8c0 sim: Assume CPHS files are in ADFusim 2012-11-25 15:34:41 +01:00
Denis Kenzior a9296c18e9 simutil: Add 2G and 3G path lookup utilities 2012-11-22 10:26:34 -06:00
Denis Kenzior 74deff6b1d simutil: Introduce 2G and 3G parent paths 2012-11-22 10:26:34 -06:00
Denis Kenzior bca0f5cde1 simutil: Add file type information to sim_db 2012-11-22 06:50:09 -06:00
Denis Kenzior cb571f807f simutil: Add entry for EFimsi 2012-06-17 08:11:15 -05:00
Denis Kenzior fe7d012c39 simutil: Add util to find CPHS service availability 2011-12-16 09:44:32 -06:00
Denis Kenzior 3ad70ca28c simutil: Minor whitespace fix 2011-12-02 13:01:14 -06:00
Denis Kenzior 2b1bef59cb simutil: Add CPHS SPN & short SPN to EFdb 2011-12-02 13:00:46 -06:00
Marcel Holtmann 7e6afe37bf core: Update copyright information 2011-10-10 13:39:42 -07:00
Gustavo F. Padovan fba5050f7f simutil: remove set but not used var 2011-05-20 15:06:07 -05:00
Denis Kenzior 2ded3271d5 simutil: Add support of CPHS EFcsp to our EF db 2011-04-14 17:34:16 -05:00
Aki Niemi f0d855dd99 simutil: Remove trailing WS 2011-02-02 11:03:21 +02:00
Aki Niemi 8e90c3368c simutil: Add checks for NULL 2011-02-02 11:03:21 +02:00
Denis Kenzior 8b9e4c1e18 simutil: Fix a memory leak 2011-01-20 11:16:04 -06:00
Andrzej Zaborowski 1542bf0c59 simutil: SIM applications directory decoding utils 2011-01-20 11:15:34 -06:00
Denis Kenzior 2e1318ef34 simutil: Remove inaccurate comment 2010-12-17 16:08:27 -06:00
Lucas De Marchi 42bafa260a simutil: explicitly compare pointers to NULL
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)

// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@

- !E
+ E == NULL
// </smpl>
2010-11-29 13:12:04 -06:00
Jeevaka Badrappan 4988741107 simutil: coding style fixes - rule M6 2010-11-22 05:06:38 -06:00
Petteri Tikander 1f2140dabe simutil: response-handler returns now also file-status 2010-10-15 02:01:34 -05:00
Kristen Carlson Accardi 920ee13a2b simutil: add file type for EFimg 2010-10-13 05:04:46 -05:00
Jeevaka Badrappan 4196182770 Fix multi-line comment style issues 2010-09-21 21:16:01 -05:00
Yang Gu d43b2c0a61 sim: Read EFsst 2010-08-31 13:07:54 -05:00
Andrzej Zaborowski 77543590d9 simutil: Fix compilation with gcc 4.3.2
This gcc version gives two signed / unsigned comparison warnings.
2010-08-26 18:44:50 -05:00
Yang Gu c679babdc5 sim: Read EFust and EFest 2010-08-23 14:29:21 -05:00
Denis Kenzior 70b09d1742 simutil: Remove unneeded forward-declaration 2010-06-09 13:08:23 -05:00
Andrzej Zaborowski 4dcb3fed2a simutil: Fix MMC MNC encoding for 2-digit MNCs. 2010-06-09 13:07:09 -05:00
Andrzej Zaborowski 9f925b3620 util: Add a "sim string" encoding utility. 2010-06-09 12:43:27 -05:00
Denis Kenzior e8a7b5cc46 simutil: Make sim_adn_build use sim bcd 2010-05-26 10:00:02 -05:00
Denis Kenzior b0cf35c324 simutil: Add sim_encode_bcd_number 2010-05-26 09:59:14 -05:00
Denis Kenzior 75ce0a7b28 simutil: Make sim_adn_parse use sim bcd version 2010-05-26 09:51:51 -05:00
Denis Kenzior 48a4f59bdd simutil: add sim_extract_bcd_number 2010-05-26 09:50:51 -05:00
Andrzej Zaborowski af2004ece1 simutil: Add MMC MNC pair encoding utility 2010-05-25 16:52:54 -05:00
Denis Kenzior 83240f1389 simutil: simplify ctlv logic 2010-05-25 16:52:51 -05:00
Denis Kenzior ec8a6cbc43 simutil: Simplify ber_tlv_builder_optimize logic 2010-05-25 16:52:51 -05:00