aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/osmo_bsc_bssap.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-02-16 15:53:13 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2022-02-22 16:32:33 +0100
commita007e32c4f3366164a5d0b21bc02deba2283650c (patch)
tree04699492908424fc68b33a2805e4b1934aca1936 /src/osmo-bsc/osmo_bsc_bssap.c
parente561e74bfec8e6d928755766491bf6906c1aa9b9 (diff)
fix inter-BSC-in handover encryption
In the field we saw Handover Requests without any Chosen Encryption Algorithm IE, and osmo-bsc completely failed on those. This made me understand my mistake from when I wrote this handover code. So far, from a BSSMAP Handover Request, we (I) used only the Chosen Encryption Algorithm IE to pick the encryption to use on the target lchan. That is very wrong. Instead, figure out the intersection of permitted algorithms MSC & BSC, and pick the best of those. Which means, actually, completely ignore the Chosen Encryption Algorithm IE. In the message, the permitted algorithms are passed as a bitmask. The current code using gsm0808_dec_encrypt_info() passes this on as an array. In order to select_best_cipher(), I could convert that array back to a bitmask. Instead pass the bitmask on from message decoding alongside the struct gsm0808_encrypt_info in req->ei_as_bitmask. In handover_end(), change the condition so that we can also pass HO_RESULT_FAIL_RR_HO_FAIL to emit a Handover Failure. Related: SYS#5839 Change-Id: Iffedc981b60d309ed2e5decd5efedee07a757b53
Diffstat (limited to 'src/osmo-bsc/osmo_bsc_bssap.c')
-rw-r--r--src/osmo-bsc/osmo_bsc_bssap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index cf8254c01..9d7b89fa3 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -394,7 +394,7 @@ int bsc_paging_start(struct bsc_paging_params *params)
}
/* select the best cipher permitted by the intersection of both masks */
-static int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask)
+int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask)
{
/* A5/7 ... A5/3: We assume higher is better,
* but: A5/1 is better than A5/2, which is better than A5/0 */