gsm_04_08: Improve gsm48_rx_mm_auth_resp debug in failure case
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index 562c24d..2ce2d15 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -886,7 +886,7 @@
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 @@
/* 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 @@
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;