aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-05-06 11:18:15 +0200
committerHarald Welte <laforge@gnumonks.org>2016-05-06 11:22:05 +0200
commit766da8687741340135b637aa593886b7345b8ddc (patch)
tree6213e33028fecc10032a04c3264f26a0e137f4d5 /src
parent48dc1a5a64041e53e7cf7ae39758ed92aecbb6a3 (diff)
GSUP: Add support for RAND in SendAuthInfo.req
In the autentication re-sync case, we need not only the AUTS from the MS/UE, but also the RAND that we sent as part of the failed authentication challenge.
Diffstat (limited to 'src')
-rw-r--r--src/gsm/gsup.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c
index 244c5fa8..3697958b 100644
--- a/src/gsm/gsup.c
+++ b/src/gsm/gsup.c
@@ -236,7 +236,6 @@ int osmo_gsup_decode(const uint8_t *const_data, size_t data_len,
case OSMO_GSUP_IMSI_IE:
case OSMO_GSUP_PDP_TYPE_IE:
case OSMO_GSUP_ACCESS_POINT_NAME_IE:
- case OSMO_GSUP_RAND_IE:
case OSMO_GSUP_SRES_IE:
case OSMO_GSUP_KC_IE:
LOGP(DLGSUP, LOGL_NOTICE,
@@ -319,6 +318,15 @@ int osmo_gsup_decode(const uint8_t *const_data, size_t data_len,
gsup_msg->auts = value;
break;
+ case OSMO_GSUP_RAND_IE:
+ if (value_len != 16) {
+ LOGP(DLGSUP, LOGL_ERROR,
+ "RAND length != 16 received\n");
+ return -GMM_CAUSE_COND_IE_ERR;
+ }
+ gsup_msg->rand = value;
+ break;
+
case OSMO_GSUP_MSISDN_IE:
gsup_msg->msisdn_enc = value;
gsup_msg->msisdn_enc_len = value_len;
@@ -474,6 +482,9 @@ void osmo_gsup_encode(struct msgb *msg, const struct osmo_gsup_message *gsup_msg
if (gsup_msg->auts)
msgb_tlv_put(msg, OSMO_GSUP_AUTS_IE, 16, gsup_msg->auts);
+ if (gsup_msg->rand)
+ msgb_tlv_put(msg, OSMO_GSUP_RAND_IE, 16, gsup_msg->rand);
+
if (gsup_msg->cn_domain) {
uint8_t dn = gsup_msg->cn_domain;
msgb_tlv_put(msg, OSMO_GSUP_CN_DOMAIN_IE, 1, &dn);