libmsc: ran_iu_make_security_mode_command(): improve readability

Change-Id: I14f4f9617f91ed17fb7614f218cb023a0231866d
This commit is contained in:
Vadim Yanitskiy 2021-11-29 00:54:11 +03:00 committed by fixeria
parent 565ea2ba0c
commit 35db146e88
1 changed files with 4 additions and 2 deletions

View File

@ -375,13 +375,15 @@ static struct msgb *ran_iu_make_rab_assignment(struct osmo_fsm_inst *caller_fi,
static struct msgb *ran_iu_make_security_mode_command(struct osmo_fsm_inst *caller_fi,
const struct ran_cipher_mode_command *cm)
{
bool use_encryption = cm->utran.uea_encryption_mask > (1 << OSMO_UTRAN_UEA0);
LOG_RAN_IU_ENC(caller_fi, LOGL_DEBUG, "Tx RANAP SECURITY MODE COMMAND to RNC, IK=%s, CK=%s\n",
osmo_hexdump_nospc(cm->vec->ik, 16),
cm->utran.uea_encryption_mask > (1 << OSMO_UTRAN_UEA0) ? osmo_hexdump_nospc(cm->vec->ck, 16) : "NONE");
use_encryption ? osmo_hexdump_nospc(cm->vec->ck, 16) : "NONE");
/* TODO: Do we need to check if the UE supports all of the algorithms and build an intersection like
* in the case of A5? */
return ranap_new_msg_sec_mod_cmd2(cm->vec->ik, cm->utran.uea_encryption_mask > (1 << OSMO_UTRAN_UEA0) ? cm->vec->ck : NULL,
return ranap_new_msg_sec_mod_cmd2(cm->vec->ik,
use_encryption ? cm->vec->ck : NULL,
RANAP_KeyStatus_new, 0x06, cm->utran.uea_encryption_mask);
}