Commit Graph

16 Commits

Author SHA1 Message Date
Martin Hauke 1f7a2ab5d3 Fix common misspellings and typos
Change-Id: I962b42871693f33b1054d43d195817e9cd84bb64
2019-10-17 08:07:39 +00:00
Vadim Yanitskiy 507781ee70 common/sim.c: add missing break to sim_apdu_resp()
Change-Id: Id5c325ffcfea8175bc5d5499a0904c0984e00349
Fixes: OS#198542
2019-05-14 20:52:39 +07:00
Vadim Yanitskiy 1c6263b2be common/sim.c: use msgb_get() in gsm_sim_reply()
Change-Id: Ie5843c8adafc37da0d69c335c97b422552b85049
2019-02-02 12:37:50 +03:00
Vadim Yanitskiy 6c04bd39c4 common/sim.c: get rid of unused 'payload' pointer
This change fixes the following compiler warning:

  sim.c: In function ‘gsm_sim_reply’:
  sim.c:149:11: warning: variable ‘payload’ set but not used
                         [-Wunused-but-set-variable]
    uint8_t *payload;

Change-Id: I3767b23bb1b28d3f4bb515d399bce160ba2eee09
2019-02-02 12:36:35 +03:00
Vadim Yanitskiy 221d3121b7 layer23/sap_interface.c: avoid using 'osmo' prefix
The 'osmo' prefix is usually used by libosmo-* symbols.

Change-Id: Id37d8553c2f2c20012fb1b729967b92a9a03f612
2019-01-07 15:39:52 +00:00
Vadim Yanitskiy b9073067c6 layer23/common/sim.c: don't ignore rc of sim_apdu_send()
Change-Id: I8cab7cc72f026947859cc607f65d925803424cf7
2018-12-26 20:52:18 +00:00
Vadim Yanitskiy f8edc45506 layer23/common: move SIM APDU caching from l1ctl.c
L1CTL implementation (i.e. l1ctl.c) is not a good place for the
SIM specific stuff. Let's move it to the proper place (i.e. sim.c).

As a bonus, this change fixes a possible problem of loosing the
cached APDUs if two or more L2&3 applications are using a single
LAPDm connection. The APDU buffer is dedicated per MS now.

Change-Id: I564c610e45aa3b630ca5d1ec6bc1cace0dc9c566
2018-10-27 05:49:45 +07:00
Vadim Yanitskiy d0ed4de085 host/mobile: use osmocom_ms as talloc context
As we use talloc, it's absurdly not to use the main feature of
the library - hierarchical memory management. This change sets
talloc context of all sub-allocated objects to related osmocom_ms
instance. So, as soon as osmocom_ms instance is destroyed, all
sub-allocated chunks are getting destroyed too.

Change-Id: I6e3467ff739f3e6dc8dd60cc6d1fcd3f8e490ce9
2017-11-08 18:46:57 +07:00
Яницкий Ва дим bec943f0b7 host/mobile: Improved SAP interface integration
1) Now the SAP interface is selectable as SIM source using the 'sim sap'
   command in VTY.
2) SAP connection starts only if it is configured as SIM source.
3) Fixed sap_socket_path configuration r/w errors.

Written-by: Яницкий Ва дим <axilirator@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2016-01-18 21:08:45 +01:00
Sylvain Munaut fc20a37cb3 host/mobile: Finish working support for the SAP interface
Patch mostly written by Nico Golde
and some cleanup/testing by Domonkos Tomcsanyi

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-04-28 15:57:54 +02:00
Andreas Eversberg 4d13b401ae host/layer23: SIM client now supports reading records correctly
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Nico Golde 9ddeae9d42 [sim] Fixed path handling in sim client and mobile app. 2011-05-02 15:55:36 +02:00
Pablo Neira Ayuso ade79a0083 src: use new libosmogsm and include/osmocom/[gsm|core] path to headers
This patch changes include paths to get osmocom-bb working with
the current libosmocore tree.

Among all these renames, you can notice several tweaks that I
added on purpose, and that require some explanation, they are:

* hexdump() in osmocon.c and osmoload.c has been renamed to avoid
clashing with hexdump() defined in libosmocore.

* gsmmap now depends on libosmogsm. Actually I had to cleanup
Makefile.am because I was experiencing weird linking problems,
probably due to a bug in the autotools. With the change included
in this patch, I got it compiled and linked here correctly.

This patch has been tested with the phone Motorola C123 and the
following images files:

* firmware/board/compal_e88/hello_world.compalram.bin
* firmware/board/compal_e88/layer1.compalram.bin

Using the osmocon, bcch_scan and mobile tools.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-04-26 02:55:30 +02:00
Holger Hans Peter Freyther 87ef8ec74e sim.c: Fix NULL pointer dereference found by clang. 2010-10-03 02:39:06 +08:00
Andreas.Eversberg 5e1cf12d67 [layer23] Fixed and completed SIM's PIN handling
Use VTY to handle PIN:

enable
sim pin 1 xxxx
sim change-pin 1 xxxx yyyy
sim disable-pin 1 xxxx
sim enable-pin 1 xxxx
sim unlock-pin 1 uuuuuuuu yyyy

1 = mobile station "1"
xxxx = current PIN
yyyy = new PIN
uuuuuuuu = unlock key (PuK)
2010-09-19 10:52:42 +00:00
Andreas.Eversberg 0856c8a6a5 [layer23] SIM client completion
The SIM client is now complete. Because it usefull for multiple
applications, i moved it to the layer23/src/common directory.

The SIM reader works together with mobile process. Fixes were made.
Thanx to all for testing, finding bugs, and making it work as it is
supposed to do.

The current version uses special L1CTL messages to send and receive APDUs.
This will change in the future, when BTSAP interface is completed.

Please note that this client will not work until the layer1 SIM reader
fixes and extensions are committed.
2010-09-18 19:15:15 +00:00