diff options
author | Harald Welte <laforge@gnumonks.org> | 2016-05-06 11:18:15 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-05-06 11:22:05 +0200 |
commit | 766da8687741340135b637aa593886b7345b8ddc (patch) | |
tree | 6213e33028fecc10032a04c3264f26a0e137f4d5 | |
parent | 48dc1a5a64041e53e7cf7ae39758ed92aecbb6a3 (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.
-rw-r--r-- | include/osmocom/gsm/gsup.h | 1 | ||||
-rw-r--r-- | src/gsm/gsup.c | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 523c15d4..660ffd48 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -138,6 +138,7 @@ struct osmo_gsup_message { const uint8_t *hlr_enc; size_t hlr_enc_len; const uint8_t *auts; + const uint8_t *rand; enum osmo_gsup_cn_domain cn_domain; }; 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); |