diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-03-22 19:53:36 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-03-22 19:53:36 +0100 |
commit | d025a3cfbb53f690a4ebbd628cafda81c1b34bc7 (patch) | |
tree | 040f93a09cac87dd7a6af3a827b880ead9fa1d97 /openbsc/src/libmsc | |
parent | 4b3b13e10c164547f014677c0ac1fb137850b387 (diff) |
in gsm8_rx_mm_auth_resp(): call sec_operation.cb() instead of finish_lu() directly
Diffstat (limited to 'openbsc/src/libmsc')
-rw-r--r-- | openbsc/src/libmsc/gsm_04_08.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 156303503..a6010463b 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -1121,6 +1121,7 @@ static int gsm48_rx_mm_auth_resp(struct gsm_subscriber_connection *conn, struct struct gsm48_hdr *gh = msgb_l3(msg); struct gsm48_auth_resp *ar = (struct gsm48_auth_resp*) gh->data; struct gsm_network *net = conn->network; + gsm_cbfn *cb; DEBUGP(DMM, "MM AUTHENTICATION RESPONSE (sres = %s): ", osmo_hexdump(ar->sres, 4)); @@ -1131,11 +1132,11 @@ static int gsm48_rx_mm_auth_resp(struct gsm_subscriber_connection *conn, struct return -EIO; } + cb = conn->sec_operation->cb; + /* Validate SRES */ if (memcmp(conn->sec_operation->atuple.sres, ar->sres,4)) { int rc; - gsm_cbfn *cb = conn->sec_operation->cb; - DEBUGPC(DMM, "Invalid (expected %s)\n", osmo_hexdump(conn->sec_operation->atuple.sres, 4)); @@ -1156,13 +1157,10 @@ static int gsm48_rx_mm_auth_resp(struct gsm_subscriber_connection *conn, struct conn->sec_operation->atuple.kc, 8, 0); /* Only authentication requested, and we're done. */ - if (!conn->loc_operation) { - LOGP(DMM, LOGL_ERROR, "Received authentication response, but no" - " location update operation pending for subscriber %s\n", - subscr_name(conn->subscr)); - return -1; - } - return finish_lu(conn); + if (!cb) + return 0; + return cb(GSM_HOOK_RR_SECURITY, GSM_SECURITY_SUCCEEDED, + NULL, conn, conn->sec_operation->cb_data); } /* Receive a GSM 04.08 Mobility Management (MM) message */ |