aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmo-bts/gsm_data.h3
-rw-r--r--src/common/rsl.c8
-rw-r--r--src/osmo-bts-sysmo/main.c1
3 files changed, 10 insertions, 2 deletions
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 8e091f2a..54f7ae9a 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -45,6 +45,9 @@ struct gsm_bts_role_bts {
char *bsc_oml_host;
char *rtp_bind_host;
unsigned int rtp_jitter_buf_ms;
+ struct {
+ uint8_t ciphers;
+ } support;
};
#define bts_role_bts(x) ((struct gsm_bts_role_bts *)(x)->role)
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);
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
index 0ed6e2c8..8d75abdd 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -210,6 +210,7 @@ int main(int argc, char **argv)
exit(1);
}
btsb = bts_role_bts(bts);
+ btsb->support.ciphers = (1 << 0) | (1 << 1) | (1 << 2);
handle_options(argc, argv);