osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmocom-bb/+/27312 )
Change subject: mobile/subscriber.c: fix auth resp with test sim
......................................................................
mobile/subscriber.c: fix auth resp with test sim
Do not send a dummy authentication response with the test sim.
Fixes: 39dc9c46 ("mobile/subscriber.c: consider GSM_SIM_TYPE_SAP too")
Change-Id: I0ee910c171d383fb2cdcaf5eb54eafe18da3430b
---
M src/host/layer23/src/mobile/subscriber.c
1 file changed, 19 insertions(+), 19 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/12/27312/1
diff --git a/src/host/layer23/src/mobile/subscriber.c
b/src/host/layer23/src/mobile/subscriber.c
index 500dd76..059ae67 100644
--- a/src/host/layer23/src/mobile/subscriber.c
+++ b/src/host/layer23/src/mobile/subscriber.c
@@ -903,25 +903,6 @@
struct msgb *nmsg;
struct sim_hdr *nsh;
- /* not a SIM */
- if (!GSM_SIM_IS_READER(subscr->sim_type)
- || !subscr->sim_valid || no_sim) {
- struct gsm48_mm_event *nmme;
-
- LOGP(DMM, LOGL_INFO, "Sending dummy authentication response\n");
- nmsg = gsm48_mmevent_msgb_alloc(GSM48_MM_EVENT_AUTH_RESPONSE);
- if (!nmsg)
- return -ENOMEM;
- nmme = (struct gsm48_mm_event *) nmsg->data;
- nmme->sres[0] = 0x12;
- nmme->sres[1] = 0x34;
- nmme->sres[2] = 0x56;
- nmme->sres[3] = 0x78;
- gsm48_mmevent_msg(ms, nmsg);
-
- return 0;
- }
-
/* test SIM */
if (subscr->sim_type == GSM_SIM_TYPE_TEST) {
struct gsm48_mm_event *nmme;
@@ -953,6 +934,25 @@
return 0;
}
+ /* not a SIM */
+ if (!GSM_SIM_IS_READER(subscr->sim_type)
+ || !subscr->sim_valid || no_sim) {
+ struct gsm48_mm_event *nmme;
+
+ LOGP(DMM, LOGL_INFO, "Sending dummy authentication response\n");
+ nmsg = gsm48_mmevent_msgb_alloc(GSM48_MM_EVENT_AUTH_RESPONSE);
+ if (!nmsg)
+ return -ENOMEM;
+ nmme = (struct gsm48_mm_event *) nmsg->data;
+ nmme->sres[0] = 0x12;
+ nmme->sres[1] = 0x34;
+ nmme->sres[2] = 0x56;
+ nmme->sres[3] = 0x78;
+ gsm48_mmevent_msg(ms, nmsg);
+
+ return 0;
+ }
+
LOGP(DMM, LOGL_INFO, "Generating KEY at SIM\n");
/* command to SIM */
--
To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/27312
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I0ee910c171d383fb2cdcaf5eb54eafe18da3430b
Gerrit-Change-Number: 27312
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange