aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wild <ewild@sysmocom.de>2021-06-09 04:01:18 +0200
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-06-23 21:59:31 +0200
commit4d845ccbb6348feb4cf000ea4e64884e29e9babc (patch)
treea84816286277f41a872a45f3c1806c431a42245c
parentf1bdf605b5857cdcddbce10b24d3f816e81f79b6 (diff)
osmo-bts-trx: indicate A5/4 support, handle Kc128
-rw-r--r--src/common/scheduler.c2
-rw-r--r--src/osmo-bts-trx/main.c2
-rw-r--r--tests/cipher/cipher_test.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 93c1e85e..11b3f4b1 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1201,7 +1201,7 @@ int trx_sched_set_cipher(struct gsm_lchan *lchan, uint8_t chan_nr, bool downlink
/* no algorithm given means a5/0 */
if (algo <= 0)
algo = 0;
- else if (lchan->encr.key_len != 8) {
+ else if (lchan->encr.key_len != 8 && lchan->encr.key_len != 16) {
LOGPLCHAN(lchan, DL1C, LOGL_ERROR,
"Algo A5/%d not supported with given key_len=%u\n",
algo, lchan->encr.key_len);
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 71349397..7c2fda87 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -127,7 +127,7 @@ int bts_model_init(struct gsm_bts *bts)
bts->model_priv = bts_trx;
bts->variant = BTS_OSMO_TRX;
- bts->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3);
+ bts->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3) | CIPHER_A5(4);
/* The nominal value for each TRX is later overwritten through VTY cmd
* 'nominal-tx-power' if present, otherwise through TRXC cmd NOMTXPOWER.
diff --git a/tests/cipher/cipher_test.c b/tests/cipher/cipher_test.c
index 9d78a880..9303ed21 100644
--- a/tests/cipher/cipher_test.c
+++ b/tests/cipher/cipher_test.c
@@ -50,14 +50,14 @@ static void test_cipher_parsing(void)
ASSERT_TRUE(bts_supports_cipher(bts, i) == 0);
}
- /* checking default A5/1 to A5/3 support */
- bts->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3);
+ /* checking default A5/1 to A5/4 support */
+ bts->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3) | CIPHER_A5(4);
ASSERT_TRUE(bts_supports_cipher(bts, 0x0) == -ENOTSUP);
ASSERT_TRUE(bts_supports_cipher(bts, 0x1) == 1); /* A5/0 */
ASSERT_TRUE(bts_supports_cipher(bts, 0x2) == 1); /* A5/1 */
ASSERT_TRUE(bts_supports_cipher(bts, 0x3) == 1); /* A5/2 */
ASSERT_TRUE(bts_supports_cipher(bts, 0x4) == 1); /* A5/3 */
- ASSERT_TRUE(bts_supports_cipher(bts, 0x5) == 0); /* A5/4 */
+ ASSERT_TRUE(bts_supports_cipher(bts, 0x5) == 1); /* A5/4 */
ASSERT_TRUE(bts_supports_cipher(bts, 0x6) == 0); /* A5/5 */
ASSERT_TRUE(bts_supports_cipher(bts, 0x7) == 0); /* A5/6 */
ASSERT_TRUE(bts_supports_cipher(bts, 0x8) == 0); /* A5/7 */