aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/rsl.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-11-24 17:46:22 +0100
committerHarald Welte <laforge@gnumonks.org>2011-11-24 17:46:22 +0100
commitfe4893e625dd196e11c17dd468d73b60f17db9f9 (patch)
tree7dcea467f0cc3bd5e75f711e74e627e18d0e92d1 /src/common/rsl.c
parent26608120842761bfae612eed1b5cf3c881855fc7 (diff)
RSL: Actually check if BSC-requested cipher is supported
Diffstat (limited to 'src/common/rsl.c')
-rw-r--r--src/common/rsl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 6c334497..891e8e24 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -568,6 +568,12 @@ static void copy_sacch_si_to_lchan(struct gsm_lchan *lchan)
static int encr_info2lchan(struct gsm_lchan *lchan,
const uint8_t *val, uint8_t len)
{
+ struct gsm_bts_role_bts *btsb = bts_role_bts(lchan->ts->trx->bts);
+
+ /* check if the encryption algorithm sent by BSC is supported! */
+ if (!((1 << *val) & btsb->support.ciphers))
+ return -ENOTSUP;
+
/* length can be '1' in case of no ciphering */
if (len < 1)
return -EINVAL;
@@ -805,8 +811,6 @@ static int rsl_rx_encr_cmd(struct msgb *msg)
return rsl_tx_error_report(msg->trx, RSL_ERR_IE_CONTENT);
}
- /* FIXME: check if the encryption algorithm sent by BSC is supported! */
-
/* 9.3.2 Link Identifier */
link_id = *TLVP_VAL(&tp, RSL_IE_LINK_IDENT);