diff --git a/srsenb/src/enb.cc b/srsenb/src/enb.cc index 5c03952b1..30058ee72 100644 --- a/srsenb/src/enb.cc +++ b/srsenb/src/enb.cc @@ -220,6 +220,9 @@ int enb::parse_args(const all_args_t& args_) } else if ((*it) == "EEA2") { rrc_cfg.eea_preference_list[i] = srslte::CIPHERING_ALGORITHM_ID_128_EEA2; i++; + } else if ((*it) == "EEA3") { + rrc_cfg.eea_preference_list[i] = srslte::CIPHERING_ALGORITHM_ID_128_EEA3; + i++; } else { fprintf(stderr, "Failed to parse EEA prefence list %s \n", args.general.eea_pref_list.c_str()); return SRSLTE_ERROR; @@ -241,6 +244,9 @@ int enb::parse_args(const all_args_t& args_) } else if ((*it) == "EIA2") { rrc_cfg.eia_preference_list[i] = srslte::INTEGRITY_ALGORITHM_ID_128_EIA2; i++; + } else if ((*it) == "EIA3") { + rrc_cfg.eia_preference_list[i] = srslte::INTEGRITY_ALGORITHM_ID_128_EIA3; + i++; } else { fprintf(stderr, "Failed to parse EIA prefence list %s \n", args.general.eia_pref_list.c_str()); return SRSLTE_ERROR; diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index 90035b33f..cc6915d01 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -2013,6 +2013,18 @@ bool rrc::ue::select_security_algorithms() parent->rrc_log->info("Failed to selected EEA2 as RRC encryption algorithm, due to unsupported algorithm\n"); } break; + case srslte::CIPHERING_ALGORITHM_ID_128_EEA3: + // “third bit” – 128-EEA3, + if (security_capabilities.encryptionAlgorithms + .buffer[srslte::CIPHERING_ALGORITHM_ID_128_EEA3 - 1]) { + cipher_algo = srslte::CIPHERING_ALGORITHM_ID_128_EEA3; + enc_algo_found = true; + parent->rrc_log->info("Selected EEA3 as RRC encryption algorithm\n"); + break; + } else { + parent->rrc_log->info("Failed to selected EEA2 as RRC encryption algorithm, due to unsupported algorithm\n"); + } + break; default: enc_algo_found = false; break; @@ -2048,6 +2060,16 @@ bool rrc::ue::select_security_algorithms() parent->rrc_log->info("Failed to selected EIA2 as RRC encryption algorithm, due to unsupported algorithm\n"); } break; + case srslte::INTEGRITY_ALGORITHM_ID_128_EIA3: + // “third bit” – 128-EIA3, + if (security_capabilities.integrityProtectionAlgorithms.buffer[srslte::INTEGRITY_ALGORITHM_ID_128_EIA3 - 1]) { + integ_algo = srslte::INTEGRITY_ALGORITHM_ID_128_EIA3; + integ_algo_found = true; + parent->rrc_log->info("Selected EIA3 as RRC integrity algorithm.\n"); + } else { + parent->rrc_log->info("Failed to selected EIA3 as RRC encryption algorithm, due to unsupported algorithm\n"); + } + break; default: integ_algo_found = false; break; diff --git a/srsepc/src/main.cc b/srsepc/src/main.cc index bd8cab3c7..e8532d1c9 100644 --- a/srsepc/src/main.cc +++ b/srsepc/src/main.cc @@ -249,9 +249,11 @@ void parse_args(all_args_t* args, int argc, char* argv[]) args->mme_args.s1ap_args.encryption_algo = srslte::CIPHERING_ALGORITHM_ID_128_EEA1; } else if (boost::iequals(encryption_algo, "eea2")) { args->mme_args.s1ap_args.encryption_algo = srslte::CIPHERING_ALGORITHM_ID_128_EEA2; + } else if (boost::iequals(encryption_algo, "eea3")) { + args->mme_args.s1ap_args.encryption_algo = srslte::CIPHERING_ALGORITHM_ID_128_EEA3; } else { args->mme_args.s1ap_args.encryption_algo = srslte::CIPHERING_ALGORITHM_ID_EEA0; - cout << "Error parsing mme.encryption_algo:" << encryption_algo << " - must be EEA0, EEA1, or EEA2." << endl; + cout << "Error parsing mme.encryption_algo:" << encryption_algo << " - must be EEA0, EEA1, EEA2 or EEA3." << endl; cout << "Using default mme.encryption_algo: EEA0" << endl; } @@ -263,9 +265,11 @@ void parse_args(all_args_t* args, int argc, char* argv[]) args->mme_args.s1ap_args.integrity_algo = srslte::INTEGRITY_ALGORITHM_ID_128_EIA1; } else if (boost::iequals(integrity_algo, "eia2")) { args->mme_args.s1ap_args.integrity_algo = srslte::INTEGRITY_ALGORITHM_ID_128_EIA2; + } else if (boost::iequals(integrity_algo, "eia3")) { + args->mme_args.s1ap_args.integrity_algo = srslte::INTEGRITY_ALGORITHM_ID_128_EIA3; } else { args->mme_args.s1ap_args.integrity_algo = srslte::INTEGRITY_ALGORITHM_ID_128_EIA1; - cout << "Error parsing mme.integrity_algo:" << encryption_algo << " - must be EIA0, EIA1, or EIA2." << endl; + cout << "Error parsing mme.integrity_algo:" << encryption_algo << " - must be EIA0, EIA1, EIA2 or EIA3." << endl; cout << "Using default mme.integrity_algo: EIA1" << endl; } diff --git a/srsue/src/main.cc b/srsue/src/main.cc index e13ef88a5..d9ed8c5f6 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -109,8 +109,8 @@ static int parse_args(all_args_t* args, int argc, char* argv[]) ("nas.user", bpo::value(&args->stack.nas.apn_user)->default_value(""), "Username for CHAP authentication") ("nas.pass", bpo::value(&args->stack.nas.apn_pass)->default_value(""), "Password for CHAP authentication") ("nas.force_imsi_attach", bpo::value(&args->stack.nas.force_imsi_attach)->default_value(false), "Whether to always perform an IMSI attach") - ("nas.eia", bpo::value(&args->stack.nas.eia)->default_value("1,2"), "List of integrity algorithms included in UE capabilities") - ("nas.eea", bpo::value(&args->stack.nas.eea)->default_value("0,1,2"), "List of ciphering algorithms included in UE capabilities") + ("nas.eia", bpo::value(&args->stack.nas.eia)->default_value("1,2,3"), "List of integrity algorithms included in UE capabilities") + ("nas.eea", bpo::value(&args->stack.nas.eea)->default_value("0,1,2,3"), "List of ciphering algorithms included in UE capabilities") ("pcap.enable", bpo::value(&args->stack.pcap.enable)->default_value(false), "Enable MAC packet captures for wireshark") ("pcap.filename", bpo::value(&args->stack.pcap.filename)->default_value("ue.pcap"), "MAC layer capture filename")