From c593cf100abeae7c795ccb568be68384081b9824 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Thu, 10 Jun 2010 23:51:41 +0200 Subject: [PATCH] gsm_04_08: Improve gsm48_rx_mm_auth_resp debug in failure case Signed-off-by: Sylvain Munaut --- openbsc/src/gsm_04_08.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c index 562c24d43..2ce2d15ff 100644 --- a/openbsc/src/gsm_04_08.c +++ b/openbsc/src/gsm_04_08.c @@ -886,7 +886,7 @@ static int gsm48_rx_mm_auth_resp(struct msgb *msg) struct gsm_subscriber_connection *conn = &msg->lchan->conn; struct gsm_network *net = lchan->ts->trx->bts->network; - DEBUGP(DMM, "MM AUTHENTICATION RESPONSE (sres = %s)\n", + DEBUGP(DMM, "MM AUTHENTICATION RESPONSE (sres = %s): ", hexdump(ar->sres, 4)); /* Safety check */ @@ -898,6 +898,10 @@ static int gsm48_rx_mm_auth_resp(struct msgb *msg) /* Validate SRES */ if (memcmp(conn->sec_operation->atuple.sres, ar->sres,4)) { gsm_cbfn *cb = conn->sec_operation->cb; + + DEBUGPC(DMM, "Invalid (expected %s)\n", + hexdump(conn->sec_operation->atuple.sres, 4)); + if (cb) cb(GSM_HOOK_RR_SECURITY, GSM_SECURITY_AUTH_FAILED, NULL, lchan, conn->sec_operation->cb_data); @@ -906,6 +910,8 @@ static int gsm48_rx_mm_auth_resp(struct msgb *msg) return gsm48_tx_mm_auth_rej(lchan); } + DEBUGPC(DMM, "OK\n"); + /* Start ciphering */ lchan->encr.alg_id = RSL_ENC_ALG_A5(net->a5_encryption); lchan->encr.key_len = 8;