support A5/4 in inter-BSC handover

Forward the Kc128 key to the new BSS in BSSMAP Handover Request.

Depends: Ieb6e43eef9e57281d54d4b7c63664668df5aef3e (libosmocore)
Change-Id: Id5ce995a741c8e469a50a0c46e53c06a2378bb7e
This commit is contained in:
Neels Hofmeyr 2021-06-09 22:27:47 +02:00
parent 6ce2edcac1
commit db07fdcbfc
2 changed files with 13 additions and 1 deletions

View File

@ -7,4 +7,4 @@
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
libosmocore >1.5.1 A5/4 support requires new API gsm0808_create_cipher2()
libosmocore >1.5.1 A5/4 support requires new API gsm0808_create_cipher2(), and gsm0808_handover_request.kc128

View File

@ -483,6 +483,7 @@ static int ran_a_decode_handover_request(struct ran_dec *ran_dec, const struct m
const struct tlv_p_entry *ie_aoip_transp_addr = TLVP_GET(tp, GSM0808_IE_AOIP_TRASP_ADDR);
const struct tlv_p_entry *ie_codec_list_msc_preferred = TLVP_GET(tp, GSM0808_IE_SPEECH_CODEC_LIST);
const struct tlv_p_entry *ie_call_id = TLVP_GET(tp, GSM0808_IE_CALL_ID);
const struct tlv_p_entry *ie_kc128 = TLVP_GET(tp, GSM0808_IE_KC_128);
const struct tlv_p_entry *ie_global_call_ref = TLVP_GET(tp, GSM0808_IE_GLOBAL_CALL_REF);
struct gsm0808_channel_type channel_type;
@ -525,6 +526,11 @@ static int ran_a_decode_handover_request(struct ran_dec *ran_dec, const struct m
geran_encr.key_len = encr_info.key_len;
}
if (ie_kc128) {
memcpy(geran_encr.kc128, ie_kc128->val, 16);
geran_encr.kc128_present = true;
}
r->geran.chosen_encryption = &geran_encr;
}
@ -1166,6 +1172,12 @@ struct msgb *ran_a_make_handover_request(struct osmo_fsm_inst *log_fi, const str
n->geran.chosen_encryption->key, n->geran.chosen_encryption->key_len);
r.encryption_information.key_len = n->geran.chosen_encryption->key_len;
r.chosen_encryption_algorithm_serving = n->geran.chosen_encryption->alg_id;
if (n->geran.chosen_encryption->kc128_present) {
r.more_items = true;
memcpy(r.kc128, n->geran.chosen_encryption->kc128, sizeof(r.kc128));
r.kc128_present = true;
}
}
if (n->classmark)