Merge branch 'master' into next

master
Andre Puschmann 6 years ago
commit 55b3b61ec1

@ -183,7 +183,7 @@ public:
}
b->reset();
if (!pool->deallocate(b)) {
fprintf(stderr, "Error deallocating PDU: Addr=0x%lx not found in pool\n", (uint64_t) b);
printf("Error deallocating PDU: Addr=0x%lx not found in pool\n", (uint64_t) b);
}
b = NULL;
}

@ -25,12 +25,12 @@ tac = 0x0007
mcc = 001
mnc = 01
mme_addr = 127.0.1.100
gtp_bind_addr = 127.0.0.1
gtp_bind_addr = 127.0.1.1
s1c_bind_addr = 127.0.1.1
n_prb = 50
#tm = 4
#nof_ports = 2
#####################################################################
# eNB configuration files
#

@ -49,6 +49,7 @@ typedef struct {
uint16_t mnc; // BCD-coded with 0xF filler
std::string mme_addr;
std::string gtp_bind_addr;
std::string s1c_bind_addr;
std::string enb_name;
}s1ap_args_t;

@ -77,6 +77,7 @@ void parse_args(all_args_t *args, int argc, char* argv[]) {
("enb.mnc", bpo::value<string>(&mnc)->default_value("01"), "Mobile Network Code")
("enb.mme_addr", bpo::value<string>(&args->enb.s1ap.mme_addr)->default_value("127.0.0.1"),"IP address of MME for S1 connnection")
("enb.gtp_bind_addr", bpo::value<string>(&args->enb.s1ap.gtp_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for GTP connection")
("enb.s1c_bind_addr", bpo::value<string>(&args->enb.s1ap.s1c_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for S1AP connection")
("enb.phy_cell_id", bpo::value<uint32_t>(&args->enb.pci)->default_value(0), "Physical Cell Identity (PCI)")
("enb.n_prb", bpo::value<uint32_t>(&args->enb.n_prb)->default_value(25), "Number of PRB")
("enb.nof_ports", bpo::value<uint32_t>(&args->enb.nof_ports)->default_value(1), "Number of ports")

@ -274,8 +274,8 @@ bool s1ap::connect_mme()
memset(&local_addr, 0, sizeof(struct sockaddr_in));
local_addr.sin_family = ADDR_FAMILY;
local_addr.sin_port = 0; // Any local port will do
if(inet_pton(AF_INET, args.gtp_bind_addr.c_str(), &(local_addr.sin_addr)) != 1) {
s1ap_log->error("Error converting IP address (%s) to sockaddr_in structure\n", args.gtp_bind_addr.c_str());
if(inet_pton(AF_INET, args.s1c_bind_addr.c_str(), &(local_addr.sin_addr)) != 1) {
s1ap_log->error("Error converting IP address (%s) to sockaddr_in structure\n", args.s1c_bind_addr.c_str());
return false;
}
bind(socket_fd, (struct sockaddr *)&local_addr, sizeof(local_addr));

@ -250,7 +250,6 @@ bool nas::rrc_connect() {
}
} else {
nas_log->error("Could not establish RRC connection\n");
pool->deallocate(dedicatedInfoNAS);
}
return false;
}
@ -757,7 +756,7 @@ void nas::parse_authentication_request(uint32_t lcid, byte_buffer_t *pdu, const
if (auth_result == AUTH_OK) {
nas_log->info("Network authentication successful\n");
send_authentication_response(res, res_len, sec_hdr_type);
nas_log->info("Generated k_asme=%s\n", hex_to_string(ctxt.k_asme, 32).c_str());
nas_log->info_hex(ctxt.k_asme, 32, "Generated k_asme:\n");
} else if (auth_result == AUTH_SYNCH_FAILURE) {
nas_log->error("Network authentication synchronization failure.\n");
send_authentication_failure(LIBLTE_MME_EMM_CAUSE_SYNCH_FAILURE, res);
@ -878,8 +877,8 @@ void nas::parse_security_mode_command(uint32_t lcid, byte_buffer_t *pdu)
// Generate NAS keys
usim->generate_nas_keys(ctxt.k_asme, k_nas_enc, k_nas_int,
ctxt.cipher_algo, ctxt.integ_algo);
nas_log->debug_hex(k_nas_enc, 32, "NAS encryption key - k_nas_enc");
nas_log->debug_hex(k_nas_int, 32, "NAS integrity key - k_nas_int");
nas_log->info_hex(k_nas_enc, 32, "NAS encryption key - k_nas_enc");
nas_log->info_hex(k_nas_int, 32, "NAS integrity key - k_nas_int");
nas_log->debug("Generating integrity check. integ_algo:%d, count_dl:%d, lcid:%d\n",
ctxt.integ_algo, ctxt.rx_count, lcid);

@ -250,7 +250,7 @@ auth_result_t pcsc_usim::generate_authentication_response(uint8_t *rand,
mcc,
mnc,
k_asme);
log->debug_hex(k_asme, KEY_LEN, "K_ASME:\n");
log->info_hex(k_asme, KEY_LEN, "K_ASME:\n");
ret = AUTH_OK;

@ -526,6 +526,12 @@ bool rrc::connection_request(LIBLTE_RRC_CON_REQ_EST_CAUSE_ENUM cause,
}
}
if (!ret) {
rrc_log->warning("Could not estblish connection. Deallocating dedicatedInfoNAS PDU\n");
pool->deallocate(this->dedicatedInfoNAS);
this->dedicatedInfoNAS = NULL;
}
pthread_mutex_unlock(&mutex);
return ret;
}
@ -2036,9 +2042,9 @@ void rrc::parse_dl_dcch(uint32_t lcid, byte_buffer_t *pdu) {
uint8_t k_asme[32];
nas->get_k_asme(k_asme, 32);
usim->generate_as_keys(k_asme, nas->get_ul_count(), k_rrc_enc, k_rrc_int, k_up_enc, k_up_int, cipher_algo, integ_algo);
rrc_log->debug_hex(k_rrc_enc, 32, "RRC encryption key - k_rrc_enc");
rrc_log->debug_hex(k_rrc_int, 32, "RRC integrity key - k_rrc_int");
rrc_log->debug_hex(k_up_enc, 32, "UP encryption key - k_up_enc");
rrc_log->info_hex(k_rrc_enc, 32, "RRC encryption key - k_rrc_enc");
rrc_log->info_hex(k_rrc_int, 32, "RRC integrity key - k_rrc_int");
rrc_log->info_hex(k_up_enc, 32, "UP encryption key - k_up_enc");
security_is_activated = true;

Loading…
Cancel
Save