mirror of https://github.com/PentHertz/srsLTE.git
Added EIA3 and EEA3 to default UE capabilities to srsUE. Added parsers for EEA3/EIA3 config options in srsENB and srsEPC
This commit is contained in:
parent
4ff70b6008
commit
1ae8ccda8c
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,8 +109,8 @@ static int parse_args(all_args_t* args, int argc, char* argv[])
|
|||
("nas.user", bpo::value<string>(&args->stack.nas.apn_user)->default_value(""), "Username for CHAP authentication")
|
||||
("nas.pass", bpo::value<string>(&args->stack.nas.apn_pass)->default_value(""), "Password for CHAP authentication")
|
||||
("nas.force_imsi_attach", bpo::value<bool>(&args->stack.nas.force_imsi_attach)->default_value(false), "Whether to always perform an IMSI attach")
|
||||
("nas.eia", bpo::value<string>(&args->stack.nas.eia)->default_value("1,2"), "List of integrity algorithms included in UE capabilities")
|
||||
("nas.eea", bpo::value<string>(&args->stack.nas.eea)->default_value("0,1,2"), "List of ciphering algorithms included in UE capabilities")
|
||||
("nas.eia", bpo::value<string>(&args->stack.nas.eia)->default_value("1,2,3"), "List of integrity algorithms included in UE capabilities")
|
||||
("nas.eea", bpo::value<string>(&args->stack.nas.eea)->default_value("0,1,2,3"), "List of ciphering algorithms included in UE capabilities")
|
||||
|
||||
("pcap.enable", bpo::value<bool>(&args->stack.pcap.enable)->default_value(false), "Enable MAC packet captures for wireshark")
|
||||
("pcap.filename", bpo::value<string>(&args->stack.pcap.filename)->default_value("ue.pcap"), "MAC layer capture filename")
|
||||
|
|
Loading…
Reference in New Issue