From 4d845ccbb6348feb4cf000ea4e64884e29e9babc Mon Sep 17 00:00:00 2001 From: Eric Wild Date: Wed, 9 Jun 2021 04:01:18 +0200 Subject: osmo-bts-trx: indicate A5/4 support, handle Kc128 Change-Id: Ib8e04fe79f30b443a54c38f395a7a3626ff97c45 Related: SYS#5324 --- src/common/scheduler.c | 2 +- src/osmo-bts-trx/main.c | 2 +- tests/cipher/cipher_test.c | 6 +++--- 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 */ -- cgit v1.2.3