From fe4893e625dd196e11c17dd468d73b60f17db9f9 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 24 Nov 2011 17:46:22 +0100 Subject: RSL: Actually check if BSC-requested cipher is supported --- src/common/rsl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/common/rsl.c') 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); -- cgit v1.2.3