gsm_04_08: Improve gsm48_rx_mm_auth_resp debug in failure case

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2010-06-10 23:51:41 +02:00 committed by Harald Welte
parent 0c873a06b6
commit c593cf100a
1 changed files with 7 additions and 1 deletions

View File

@ -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;