diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-15 01:09:37 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-18 23:31:31 +0200 |
commit | 498e55a9a4a99aaea7e62b8a477a978e35a597f2 (patch) | |
tree | 20ed95d5562029a99f7d2d7ce7a8714147e78217 /src/osmo-bsc/abis_rsl.c | |
parent | 0256c891878be531c24aa0c62e7c56ef8d71ab65 (diff) |
implement A5/4 in Ciphering Mode procedure
Receive and store the Kc128 key from MSC, and use as key sent to BTS if
A5/4 is the chosen encryption algorithm.
(A5/4 in handover will follow in a separate patch)
Related: SYS#5324
Change-Id: I7c458c8a7350f34ff79531b3c891e1b367614469
Diffstat (limited to 'src/osmo-bsc/abis_rsl.c')
-rw-r--r-- | src/osmo-bsc/abis_rsl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index c844f181e..86b179067 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -178,6 +178,14 @@ static int build_encr_info(uint8_t *out, struct gsm_lchan *lchan) memcpy(out, lchan->encr.key, lchan->encr.key_len); return 1 + lchan->encr.key_len; + case GSM0808_ALG_ID_A5_4: + if (!lchan->encr.kc128_present) { + LOG_LCHAN(lchan, LOGL_ERROR, "A5/4 encryption chosen, but missing Kc128\n"); + return -EINVAL; + } + memcpy(out, lchan->encr.kc128, sizeof(lchan->encr.kc128)); + return 1 + sizeof(lchan->encr.kc128); + default: LOG_LCHAN(lchan, LOGL_ERROR, "A5/%d encryption not supported\n", lchan->encr.alg_id); return -EINVAL; |