From 0d929be8264ba592313f2cdd9bc4bd9b2579df00 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 30 Mar 2016 11:22:29 +0200 Subject: Fix MM Auth: disallow key_seq mismatch In auth_get_tuple_for_subscr(), add missing condition to match incoming key_seq with stored key_seq, so that re-authentication is requested for mismatching key_seqs. Add test for this issue. --- openbsc/src/libmsc/auth.c | 1 + 1 file changed, 1 insertion(+) (limited to 'openbsc/src') diff --git a/openbsc/src/libmsc/auth.c b/openbsc/src/libmsc/auth.c index 4ce183935..ca39d0118 100644 --- a/openbsc/src/libmsc/auth.c +++ b/openbsc/src/libmsc/auth.c @@ -100,6 +100,7 @@ int auth_get_tuple_for_subscr(struct gsm_auth_tuple *atuple, rc = db_get_lastauthtuple_for_subscr(atuple, subscr); if ((rc == 0) && (key_seq != GSM_KEY_SEQ_INVAL) && + (key_seq == atuple->key_seq) && (atuple->use_count < 3)) { atuple->use_count++; -- cgit v1.2.3