From bd55a6dd316f49e11b20f7935c8a8b7153cdf698 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Thu, 24 Dec 2009 00:23:46 +0100 Subject: gsm_04_08: Specify key_seq when calling gsm48_tx_mm_auth_req Signed-off-by: Sylvain Munaut --- openbsc/include/openbsc/gsm_04_08.h | 2 +- openbsc/src/gsm_04_08.c | 5 ++--- openbsc/src/token_auth.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h index b8671554e..9cf8afcf3 100644 --- a/openbsc/include/openbsc/gsm_04_08.h +++ b/openbsc/include/openbsc/gsm_04_08.h @@ -756,7 +756,7 @@ enum gsm_chan_t get_ctype_by_chreq(struct gsm_bts *bts, u_int8_t ra, int neci); enum gsm_chreq_reason_t get_reason_by_chreq(struct gsm_bts *bts, u_int8_t ra, int neci); int gsm48_tx_mm_info(struct gsm_lchan *lchan); -int gsm48_tx_mm_auth_req(struct gsm_lchan *lchan, u_int8_t *rand); +int gsm48_tx_mm_auth_req(struct gsm_lchan *lchan, u_int8_t *rand, int key_seq); int gsm48_tx_mm_auth_rej(struct gsm_lchan *lchan); struct msgb *gsm48_msgb_alloc(void); int gsm48_sendmsg(struct msgb *msg, struct gsm_trans *trans); diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c index cd66d255f..e09928f0e 100644 --- a/openbsc/src/gsm_04_08.c +++ b/openbsc/src/gsm_04_08.c @@ -1175,7 +1175,7 @@ int gsm48_tx_mm_info(struct gsm_lchan *lchan) } /* Section 9.2.2 */ -int gsm48_tx_mm_auth_req(struct gsm_lchan *lchan, u_int8_t *rand) +int gsm48_tx_mm_auth_req(struct gsm_lchan *lchan, u_int8_t *rand, int key_seq) { struct msgb *msg = gsm48_msgb_alloc(); struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); @@ -1187,8 +1187,7 @@ int gsm48_tx_mm_auth_req(struct gsm_lchan *lchan, u_int8_t *rand) gh->proto_discr = GSM48_PDISC_MM; gh->msg_type = GSM48_MT_MM_AUTH_REQ; - /* Key Sequence: FIXME fixed to 0 */ - ar->key_seq = 0; + ar->key_seq = key_seq; /* 16 bytes RAND parameters */ if (rand) diff --git a/openbsc/src/token_auth.c b/openbsc/src/token_auth.c index f6be0bc98..fd81f035a 100644 --- a/openbsc/src/token_auth.c +++ b/openbsc/src/token_auth.c @@ -103,7 +103,7 @@ unauth: if (lchan) { u_int8_t auth_rand[16]; /* kick the subscriber off the network */ - gsm48_tx_mm_auth_req(lchan, auth_rand); + gsm48_tx_mm_auth_req(lchan, auth_rand, 0); gsm48_tx_mm_auth_rej(lchan); /* FIXME: close the channel early ?*/ //gsm48_send_rr_Release(lchan); @@ -139,7 +139,7 @@ static int token_sms_cb(unsigned int subsys, unsigned int signal, lchan = lchan_for_subscr(sms->receiver); if (lchan) { /* kick the subscriber off the network */ - gsm48_tx_mm_auth_req(lchan, auth_rand); + gsm48_tx_mm_auth_req(lchan, auth_rand, 0); gsm48_tx_mm_auth_rej(lchan); /* FIXME: close the channel early ?*/ //gsm48_send_rr_Release(lchan); -- cgit v1.2.3