Commit Graph

155 Commits

Author SHA1 Message Date
Denis Kenzior 764afde1fe sim: Fix LockedPins in case SIM wants a PUK first
In the case that oFono is started with the SIM asking for a PUK, we
don't report LockedPins properly.
2010-08-05 10:00:57 -05:00
Marcel Holtmann 1fedd096a0 Check sanity the MNC length value from the SIM card
In case the SIM entry is wrong or we force reading of it, nasty things
like this can happen:

ofonod[12456]: Control:> AT+CRSM=176,28589,0,0,4\r
ofonod[12456]: Control:< +CRSM: 144,0,"00FFFF"\r\n\r\nOK\r\n
*** buffer overflow detected ***: ./src/ofonod terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x3e42efb417]
/lib64/libc.so.6[0x3e42ef9310]
/lib64/libc.so.6(__strncpy_chk+0x17b)[0x3e42ef85cb]
2010-06-22 17:21:03 +02:00
Denis Kenzior f2f5810942 sim: move ServiceDiallingNumbers to ServiceNumbers
In line with the API documentation
2010-05-27 14:58:29 -05:00
Denis Kenzior 73bfae4f46 sim: Read EFiccid after EFphase 2010-05-19 23:48:34 -05:00
Denis Kenzior bbd6a1d48a sim: No need for this define 2010-05-19 23:47:41 -05:00
Daniel Wagner b338033307 Read EF_ICCID property of SIM
Tested with phonesim.
2010-05-19 23:41:03 -05:00
Denis Kenzior 50264a311d Style: Proper indentation 2010-04-15 16:49:42 -05:00
Andrzej Zaborowski aad4d0de78 Add Sim Toolkit atom
- Add ofono_stk atom in stk.c
- Move envelope command from sim driver to stk driver
2010-04-15 16:49:40 -05:00
Denis Kenzior 228e1e735c Fix: Minor style issues 2010-04-15 16:49:40 -05:00
Denis Kenzior c63b2c9d44 Fix: Uncomplicate the logic for SIM initialization
If we get a sim inserted notify before we are registered, we need to
initialize the SIM once ofono_sim_register is called.  The logic for
doing so is rather twisted, simplify it.
2010-04-15 16:49:40 -05:00
Andrzej Zaborowski 6dc4799d1b Add SIM "Present" property. 2010-04-15 16:49:40 -05:00
Andrzej Zaborowski ddfe8acf11 Drivers can notify core of SIM insertion / removal
Add ofono_sim_inserted_notify function to notify the core of SIM
insertion / removal.

Make every plugin generate a sim inserted event on start.  For devices
with removable card, the event should be emitted after the
plugin detects such event.  For devices that need to wait for SIM card
initialization, they can emit this event later.
2010-04-15 16:49:40 -05:00
Andrzej Zaborowski 22cbe98146 Extend sim-ready watch with card insert/eject 2010-04-15 16:49:40 -05:00
Andrzej Zaborowski 42ef218668 Use stkutil named constants in sim.c 2010-03-31 13:06:14 -05:00
Denis Kenzior 9390dbaf31 Refactor: Remove MobileNetworkCodeLength property
Replaced by MNC/MCC properties which is more intuitive for use by
external applications.
2010-03-25 10:21:37 -05:00
Denis Kenzior a5d54581ad Move sim manager interface definition to dbus.h 2010-03-22 15:39:13 -05:00
Pekka Pessi 9a398a1087 Fix: Check password length based on its type
The different password types have different length requirements, so
update is_valid_pin to validate according to the password type being
validated (PIN / PUK / NET)
2010-03-19 13:48:04 -05:00
Denis Kenzior 62007cd074 Fix: Fixup error paths in sim_op_check_cached 2010-03-16 15:45:04 -05:00
Andrzej Zaborowski 3a9cd4fc03 Use stk_envelope_type constant name in sim.c 2010-02-27 11:40:16 -06:00
Denis Kenzior 87ca1b0c8f Fix: Don't use ofono_debug directly in the core
Use DBG macro which is integrated with the new debug framework.
2010-02-08 11:54:03 -06:00
Denis Kenzior 0382f64353 Refactor: Rename & Restructure cphs_support
- Rename to cphs_service_table to be more inline with the specification.
- Since the spec allows arbitrary length service tables, use an unsigned
  char * return instead of a short.
- Use bit_field function instead of defining an enum
2010-01-12 11:27:31 -06:00
Denis Kenzior 2b231c3f84 Rename: Rename CPHS Phase enums
Be more consistent with the 3GPP Phase names
2010-01-12 11:23:21 -06:00
Andrzej Zaborowski 637ca18af4 Retrieve CPHS phase (if any) from SIM. 2010-01-12 10:35:51 -06:00
Denis Kenzior 45f2f9315f Set phase to unknown until we probe it 2010-01-06 14:17:27 -06:00
Denis Kenzior beb3e032e4 Refactor: Preserve Phase obtained from the SIM 2010-01-06 13:19:47 -06:00
Andrzej Zaborowski b4c3e1c1cc Index SIM cache by phase also. 2010-01-06 13:14:20 -06:00
Marcel Holtmann 144080e749 Update copyright information 2010-01-01 17:00:10 -08:00
Denis Kenzior 955e6a61ee Style: Fix a few more occurences of if/else
See Linux coding style document for details
2009-12-17 21:45:39 -06:00
Denis Kenzior 0bd6739766 Style: Fixup style issues 2009-12-17 21:45:39 -06:00
Andrzej Zaborowski da6f3e63e0 Handle EF-CBSMID contents. 2009-12-17 21:45:39 -06:00
Denis Kenzior 60118757b2 Fix: Don't crash when cached ef structure differs 2009-10-05 16:20:55 -05:00
Denis Kenzior be55ba4ab3 Refactor: Move elementary file type checking
Every single EF read callback checks the file type reported out of the
SIM is what it expects.  Instead this should be done in one place and
the errors reported accordingly
2009-10-02 18:25:56 -05:00
Denis Kenzior bb746b3e9d Fix efli being removed prematurely 2009-09-28 11:18:50 -05:00
Denis Kenzior bbe49a1b6e Fix whitespace 2009-09-24 10:23:37 -05:00
Denis Kenzior 5b2852d8b4 Add initial support for LockedPins property 2009-09-24 10:23:37 -05:00
Denis Kenzior dc644108bf Ignore EFli if the first entry is empty 2009-09-23 17:28:15 -05:00
Andrzej Zaborowski c98e99aef2 Remove unused struct field. 2009-09-23 14:27:49 -05:00
Andrzej Zaborowski cb19aa987f Rename eflp_format to efli_format, semantically opposite. 2009-09-23 14:27:26 -05:00
Denis Kenzior cfcf7e6516 Simplify: Use dbus_message_iter_get_args 2009-09-22 11:24:21 -05:00
Denis Kenzior b8dcd905fb Remove unused structure 2009-09-22 11:24:21 -05:00
Marcel Holtmann 5f4340f186 Fix unused variable issue from last commits 2009-09-23 10:47:29 -07:00
Denis Kenzior 17cedf0eb7 Don't try to Lock or Unlock SIM PIN2 2009-09-22 00:07:07 -05:00
Denis Kenzior 2c4c27654c Make sure we try to lock/unlock/change only PINs 2009-09-22 00:07:07 -05:00
Denis Kenzior 5fd083f6f4 Refactor: Do not use int instead of enum
27.007 does not define an enumeration for SIM PIN/PUK values.  This
should be handled by ofono enum instead
2009-09-22 00:07:07 -05:00
Denis Kenzior f599036ed0 Add LockPin and UnlockPin functions 2009-09-22 00:07:06 -05:00
Denis Kenzior 63416e2851 Rearrange sim password enum 2009-09-22 00:07:06 -05:00
Denis Kenzior 1faf467d87 Get rid of 1 line function 2009-09-22 00:07:06 -05:00
Denis Kenzior 9f27be58bc Move some stuff around 2009-09-22 00:07:06 -05:00
Andrzej Zaborowski ee02b14836 Do PIN authentication
This adds checking whether PIN is required during SIM initialisation and
delaying the sim ready notifications until after correct PIN is given.
2009-09-22 00:07:06 -05:00
Denis Kenzior 91555b9165 Refactor language preference parsing
- Make sure to handle capital / lower case ISO639 strings
- Properly handle the case where files are empty / unused
- Don't emit the signal unless the preferences are useable
- Simplify the logic and be a bit more readable
2009-09-17 14:10:12 -05:00