Commit Graph

12 Commits

Author SHA1 Message Date
Denis Kenzior 5d3640397a core: Quiet warning about strncpy use 2019-05-16 15:10:40 -05:00
Denis Kenzior 614ffb0761 sim-auth: Use memcpy instead of strncpy
The code is not really copying strings but 2 or 3 character sof the MNC.
Make this clearer.
2019-04-30 11:09:52 -05:00
Jonas Bonn 3beeff758d treewide: Remove superfluous use of _GNU_SOURCE
There are a large number of files in the tree that define _GNU_SOURCE
despite not actually using features hidden behind this flag.  This patch
removes all these definitions in one fell swoop...
2018-10-17 10:01:57 -05:00
Denis Kenzior dca9071ffe sim-auth: Improve pending cleanup on sim_auth_remove 2018-02-28 11:28:54 -06:00
Denis Kenzior dc59351de6 sim-auth: Do not leak nai
==31530== 88 bytes in 2 blocks are definitely lost in loss record 132 of 186
==31530==    at 0x4C2BF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31530==    by 0x5847B97: vasprintf (in /lib64/libc-2.23.so)
==31530==    by 0x510AE38: g_vasprintf (gprintf.c:316)
==31530==    by 0x50D8BDF: g_strdup_vprintf (gstrfuncs.c:514)
==31530==    by 0x50D8CAA: g_strdup_printf (gstrfuncs.c:540)
==31530==    by 0x4F706B: build_nai (sim-auth.c:660)
==31530==    by 0x4F706B: sim_auth_register (sim-auth.c:738)
==31530==    by 0x4F706B: ofono_sim_auth_create (sim-auth.c:768)
==31530==    by 0x4ACBB4: modem_change_state (modem.c:525)
==31530==    by 0x4AD0CD: sim_state_watch.part.5 (modem.c:720)
==31530==    by 0x4CF6D0: call_state_watches (sim.c:366)
==31530==    by 0x4CF6D0: sim_set_ready (sim.c:1475)
==31530==    by 0x4CF6D0: sim_imsi_obtained (sim.c:1577)
==31530==    by 0x45D868: at_cimi_cb (sim.c:453)
==31530==    by 0x49CB5F: at_chat_finish_command (gatchat.c:459)
==31530==    by 0x49DAC7: at_chat_handle_command_response (gatchat.c:521)
==31530==    by 0x49DAC7: have_line (gatchat.c:600)
==31530==    by 0x49DAC7: new_bytes (gatchat.c:759)
2018-02-28 11:21:45 -06:00
Slava Monich 94c1975801 sim-auth: Avoid using dbus_message_iter_get_element_count
It's the only thing in ofono that requires dbus 1.9.16 or later and it's
not worth it.

And don't leak DBusMessage on format error.
2017-11-27 10:08:16 -06:00
James Prestwood d025f2c8b5 simauth: remove driver code from core simauth atom 2017-11-09 11:55:42 -06:00
James Prestwood 8986e0dd28 simauth: use new sim atom functionality for simauth
All the functionality for the simauth driver was moved
into the sim atom. This patch transitions the simauth
atom to using those API's instead of the simauth driver
API's.

With this change it made more sense to store each AID
as its own object structure so the AID and object path
could be re-used rather than generating it on the fly.

Renamed the simauth 'sim' variable to 'sa' to keep it
consistent now that the simauth structure references
the sim atom as 'sim'.
2017-11-08 20:48:25 -06: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 95e795b62d simauth: fixup adding more dbus return checks 2017-10-16 11:16:27 -05:00
James Prestwood 5ba90f6b09 sim-auth: implementation of core sim-auth atom
The sim-auth module atom can now be used for SIM application discovery
and authentication. The atom will automatically discover SIM
applications available on the SIM and register a new DBus object under
the modem, whos name is the AID string e.g.

/modem1/A0000000871004FFFFFFFF8906190000

A list of discovered AID object paths and types can be retrieved by
calling GetApplications() under the modems (new)
org.ofono.SimAuthentication interface which returns "a{oa{sv}}" where

o = path (e.g. above)

and the dictionary contains the following properties:

Type: "Umts" or "Ims"
Name: "USim" or "ISim"

The Type signifies which interfaces the AID object will have:

Umts = org.ofono.USimApplication
Ims = org.ofono.ISimApplication

These interfaces will contain the supported USIM/ISIM authentication
algorithms. Where:

org.ofono.USimApplication has:
    GetProperties()
    GsmAuthenticate()
    UmtsAuthenticate()

org.ofono.ISimApplication has:
    GetProperties()
    ImsAuthenticate()
2017-10-12 15:28:40 -05:00
Andrzej Zaborowski 84d0a57f8a sim-auth: Add skeleton for the sim-auth atom 2011-01-20 11:16:06 -06:00