aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-06-20 20:10:46 +0200
committerHarald Welte <laforge@gnumonks.org>2015-09-06 14:48:10 +0200
commit40d87ee80b6f3e65b7326b81b9ab6052c0675c42 (patch)
tree9412ee454b05a35899507f8edc71ed1b02cd5cd6 /src
parentfbe56a4630890293ce044ed51b5be591cf1c3ab5 (diff)
TRX: If no cipher algorithm is given, or if it is a5/0, reset cipher state
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bts-trx/scheduler.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/osmo-bts-trx/scheduler.c b/src/osmo-bts-trx/scheduler.c
index 9aa05390..5a22c5c3 100644
--- a/src/osmo-bts-trx/scheduler.c
+++ b/src/osmo-bts-trx/scheduler.c
@@ -2573,7 +2573,10 @@ int trx_sched_set_cipher(struct trx_l1h *l1h, uint8_t chan_nr, int downlink,
int rc = -EINVAL;
struct trx_chan_state *chan_state;
- if (algo < 0 || key_len > 8 || (algo && key_len != 8)) {
+ /* no algorithm given means a5/0 */
+ if (algo <= 0)
+ algo = 0;
+ else if (key_len != 8) {
LOGP(DL1C, LOGL_ERROR, "Algo A5/%d not supported with given "
"key len=%d\n", algo, key_len);
return -ENOTSUP;