Fix enabling of UMTS UEA encryption

The existing code allowed the user to configure UMTS encryption in the
vty, but we never actually passed this information down to RANAP.  As a
result, the RAN had no chance of ever enabling encryption on the air
interface.

Change-Id: Ieaaa6b23b7337b7edb902fad8031e195e0c5e9d2
Related: OS#4144
This commit is contained in:
Harald Welte 2021-02-06 16:47:39 +01:00 committed by Alexander Couzens
parent efa6c5b7d6
commit 274b70f1a8
3 changed files with 7 additions and 1 deletions

View File

@ -102,6 +102,9 @@ struct ran_cipher_mode_command {
/* out-argument to return the key to the caller, pass NULL if not needed. */ /* out-argument to return the key to the caller, pass NULL if not needed. */
struct geran_encr *chosen_key; struct geran_encr *chosen_key;
} geran; } geran;
struct {
bool uea_encryption;
} utran;
}; };
struct ran_handover_request { struct ran_handover_request {

View File

@ -348,6 +348,9 @@ static int msc_a_ran_enc_ciphering(struct msc_a *msc_a, bool umts_aka, bool retr
/* for ran_a.c to store the GERAN key that is actually used */ /* for ran_a.c to store the GERAN key that is actually used */
.chosen_key = &msc_a->geran_encr, .chosen_key = &msc_a->geran_encr,
}, },
.utran = {
.uea_encryption = net->uea_encryption
}
}, },
}; };

View File

@ -369,7 +369,7 @@ static struct msgb *ran_iu_make_security_mode_command(struct osmo_fsm_inst *call
LOG_RAN_IU_ENC(caller_fi, LOGL_DEBUG, "Tx RANAP SECURITY MODE COMMAND to RNC, ik %s\n", LOG_RAN_IU_ENC(caller_fi, LOGL_DEBUG, "Tx RANAP SECURITY MODE COMMAND to RNC, ik %s\n",
osmo_hexdump_nospc(cm->vec->ik, 16)); osmo_hexdump_nospc(cm->vec->ik, 16));
return ranap_new_msg_sec_mod_cmd(cm->vec->ik, NULL, RANAP_KeyStatus_new); return ranap_new_msg_sec_mod_cmd(cm->vec->ik, cm->utran.uea_encryption ? cm->vec->ck : NULL, RANAP_KeyStatus_new);
} }