summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-09 01:31:20 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-14 23:58:23 +0100
commit8b1272a6d300b391efda52cac7dddab7ccc320ef (patch)
tree529b060353618a64b190c3f715480016bb317150
parent080921a5510323f6cbb0924328c0bb364afd08ce (diff)
msc: allow only authentication without ciphering
So far the code did only auth+ciph or none. Add case handling for only authentication without ciphering (basically just fill in the blanks).
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 7003ddde8..49b0bf31f 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -234,7 +234,7 @@ int gsm48_secure_channel(struct gsm_subscriber_connection *conn, int key_seq,
/* FIXME: Should start a timer for completion ... */
/* Then do whatever is needed ... */
- if (rc == AUTH_DO_AUTH_THEN_CIPH) {
+ if ((rc == AUTH_DO_AUTH_THEN_CIPH) || (rc == AUTH_DO_AUTH)) {
/* Start authentication */
DEBUGP(DMM, "gsm48_secure_channel(%s) starting authentication\n",
subscr_name(subscr));
@@ -1150,9 +1150,19 @@ static int gsm48_rx_mm_auth_resp(struct gsm_subscriber_connection *conn, struct
DEBUGPC(DMM, "OK\n");
- /* Start ciphering */
- return gsm0808_cipher_mode(conn, net->a5_encryption,
- conn->sec_operation->atuple.kc, 8, 0);
+ if (net->a5_encryption)
+ /* Start ciphering */
+ return gsm0808_cipher_mode(conn, net->a5_encryption,
+ 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);
}
/* Receive a GSM 04.08 Mobility Management (MM) message */