Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions srsue/src/stack/rrc_nr/rrc_nr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,13 @@ void rrc_nr::handle_security_mode_command(const asn1::rrc_nr::security_mode_cmd_
transaction_id = smc.rrc_transaction_id;

const auto& sec_algo_cfg = smc.crit_exts.security_mode_cmd().security_cfg_smc.security_algorithm_cfg;

// Out-of-bounds algorithms
if(sec_algo_cfg.ciphering_algorithm.value >= CIPHERING_ALGORITHM_ID_N_ITEMS
|| sec_algo_cfg.integrity_prot_algorithm.value >= INTEGRITY_ALGORITHM_ID_N_ITEMS){
return;
}

sec_cfg.cipher_algo = (CIPHERING_ALGORITHM_ID_ENUM)sec_algo_cfg.ciphering_algorithm.value;
if (sec_algo_cfg.integrity_prot_algorithm_present) {
sec_cfg.integ_algo = (INTEGRITY_ALGORITHM_ID_ENUM)sec_algo_cfg.integrity_prot_algorithm.value;
Expand Down