From 4932ea9dfbaad163aeca7a8aa0f454e5beb7a4ef Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Wed, 4 Apr 2018 12:13:36 +0200 Subject: [PATCH 1/7] Added auth failure and detach to plain nas message --- srsepc/src/mme/s1ap_nas_transport.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/srsepc/src/mme/s1ap_nas_transport.cc b/srsepc/src/mme/s1ap_nas_transport.cc index 687ced63b..1a34c86e2 100644 --- a/srsepc/src/mme/s1ap_nas_transport.cc +++ b/srsepc/src/mme/s1ap_nas_transport.cc @@ -241,6 +241,18 @@ s1ap_nas_transport::handle_uplink_nas_transport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRA m_s1ap_log->console("Uplink NAS: Received Authentication Response\n"); handle_nas_authentication_response(nas_msg, ue_ctx, reply_buffer, reply_flag); break; + // Authentication failure with the option sync failure can be sent not integrity protected + case LIBLTE_MME_MSG_TYPE_AUTHENTICATION_FAILURE: + m_s1ap_log->info("Plain UL NAS: Authentication Failure\n"); + m_s1ap_log->console("Plain UL NAS: Authentication Failure\n"); + handle_authentication_failure(nas_msg, ue_ctx, reply_buffer, reply_flag); + break; + // Detach request can be sent not integrity protected when "power off" option is used + case LIBLTE_MME_MSG_TYPE_DETACH_REQUEST: + m_s1ap_log->info("Plain Protected UL NAS: Detach Request\n"); + m_s1ap_log->console("Plain Protected UL NAS: Detach Request\n"); + handle_nas_detach_request(nas_msg, ue_ctx, reply_buffer, reply_flag); + break; default: m_s1ap_log->warning("Unhandled Plain NAS message 0x%x\n", msg_type ); m_s1ap_log->console("Unhandled Plain NAS message 0x%x\n", msg_type ); @@ -924,8 +936,8 @@ bool s1ap_nas_transport::handle_nas_detach_request(srslte::byte_buffer_t *nas_msg, ue_ctx_t* ue_ctx, srslte::byte_buffer_t *reply_msg, bool *reply_flag) { - m_s1ap_log->console("Detach request -- IMSI %015lu", ue_ctx->emm_ctx.imsi); - m_s1ap_log->info("Detach request -- IMSI %015lu", ue_ctx->emm_ctx.imsi); + m_s1ap_log->console("Detach request -- IMSI %015lu\n", ue_ctx->emm_ctx.imsi); + m_s1ap_log->info("Detach request -- IMSI %015lu\n", ue_ctx->emm_ctx.imsi); LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT detach_req; LIBLTE_ERROR_ENUM err = liblte_mme_unpack_detach_request_msg((LIBLTE_BYTE_MSG_STRUCT*) nas_msg, &detach_req); From 1c2a2e210189dd8f749c31cb6099f1a433e32c7d Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 12 Apr 2018 17:24:16 +0200 Subject: [PATCH 2/7] Fixed negative UE Power Headroom --- lib/src/radio/radio.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/radio/radio.cc b/lib/src/radio/radio.cc index 7008790a3..a15c6dce9 100644 --- a/lib/src/radio/radio.cc +++ b/lib/src/radio/radio.cc @@ -175,7 +175,7 @@ float radio::set_tx_power(float power) float radio::get_max_tx_power() { - return 10; + return 40; } float radio::get_rssi() From 9f5069cdc85a6ab0c9731dceba798cf89352d5bb Mon Sep 17 00:00:00 2001 From: Joseph Giovatto Date: Sun, 29 Apr 2018 11:24:35 -0400 Subject: [PATCH 3/7] Format and typelimit warnings (#169) * merge with origin 4fc7dbc3 8daa8346 * fixed whitespace diff * added .gitignore * added format warning flags to C_FLAGS added typelimit check to C_FLAGS and CXX_CLAGS * Revert "added format warning flags to C_FLAGS" Apply to branch format_and_typelimt branch This reverts commit bf7467e82ec7b056ad06dc50cc964fcce18be99b. * check for format warnings to top level C_FLAGS added typelimit warnings to top level C_FLAGS and CXX_FLAGS beset effort attempt to remedy warnings removed unused param names in hex_log baseclass methods due to multitude of unused-warnings --- .gitignore | 1 + CMakeLists.txt | 4 ++-- lib/examples/synch_file.c | 2 +- lib/include/srslte/common/log.h | 8 ++++---- lib/include/srslte/common/pdu.h | 2 +- lib/src/common/pdu.cc | 19 +++++++++++++------ lib/src/phy/fec/test/turbocoder_test.c | 2 +- lib/src/phy/phch/test/pbch_file_test.c | 2 +- 8 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..378eac25d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/CMakeLists.txt b/CMakeLists.txt index 290754ee3..d495d54a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -226,7 +226,7 @@ macro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have) endmacro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${GCC_ARCH} -Wall -Wno-comment -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable -Wformat -std=c++03") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${GCC_ARCH} -Wall -Wno-comment -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable -Wformat -Wtype-limits -std=c++03") find_package(SSE) if (HAVE_AVX2) @@ -243,7 +243,7 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clan ADD_CXX_COMPILER_FLAG_IF_AVAILABLE("-Werror=incompatible-pointer-types" HAVE_ERROR_INCOMPATIBLE) if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${GCC_ARCH} -Wall -Wno-comment -Wno-write-strings -Wno-format-extra-args -Winline -Wno-unused-result -Wno-format -std=c99 -D_GNU_SOURCE") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${GCC_ARCH} -Wall -Wno-comment -Wno-write-strings -Winline -Wno-unused-result -Wformat -Wtype-limits -std=c99 -D_GNU_SOURCE") if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb -O0 -DDEBUG_MODE -DBUILD_TYPE_DEBUG") diff --git a/lib/examples/synch_file.c b/lib/examples/synch_file.c index 4d553bd38..c73e8d9dc 100644 --- a/lib/examples/synch_file.c +++ b/lib/examples/synch_file.c @@ -113,7 +113,7 @@ int main(int argc, char **argv) { uint32_t m0, m1; float m0_value, m1_value; uint32_t N_id_2; - uint32_t sss_idx; + int sss_idx; struct timeval tdata[3]; int *exec_time; diff --git a/lib/include/srslte/common/log.h b/lib/include/srslte/common/log.h index b47f79d90..79dbdc088 100644 --- a/lib/include/srslte/common/log.h +++ b/lib/include/srslte/common/log.h @@ -129,13 +129,13 @@ public: virtual void debug(const char * message, ...) __attribute__ ((format (printf, 2, 3))) = 0; // Same with hex dump - virtual void error_hex(const uint8_t *hex, int size, const char *, ...) __attribute__((format (printf, 4, 5))) + virtual void error_hex(const uint8_t *, int, const char *, ...) __attribute__((format (printf, 4, 5))) {error("error_hex not implemented.\n");} - virtual void warning_hex(const uint8_t *hex, int size, const char *, ...) __attribute__((format (printf, 4, 5))) + virtual void warning_hex(const uint8_t *, int, const char *, ...) __attribute__((format (printf, 4, 5))) {error("warning_hex not implemented.\n");} - virtual void info_hex(const uint8_t *hex, int size, const char *, ...) __attribute__((format (printf, 4, 5))) + virtual void info_hex(const uint8_t *, int, const char *, ...) __attribute__((format (printf, 4, 5))) {error("info_hex not implemented.\n");} - virtual void debug_hex(const uint8_t *hex, int size, const char *, ...) __attribute__((format (printf, 4, 5))) + virtual void debug_hex(const uint8_t *, int, const char *, ...) __attribute__((format (printf, 4, 5))) {error("debug_hex not implemented.\n");} protected: diff --git a/lib/include/srslte/common/pdu.h b/lib/include/srslte/common/pdu.h index cc2bb64f5..e9ee1f0e9 100644 --- a/lib/include/srslte/common/pdu.h +++ b/lib/include/srslte/common/pdu.h @@ -258,7 +258,7 @@ public: private: static const int MAX_CE_PAYLOAD_LEN = 8; uint32_t lcid; - int nof_bytes; + uint32_t nof_bytes; uint8_t* payload; uint8_t w_payload_ce[8]; bool F_bit; diff --git a/lib/src/common/pdu.cc b/lib/src/common/pdu.cc index 95d9dde9b..09fae2774 100644 --- a/lib/src/common/pdu.cc +++ b/lib/src/common/pdu.cc @@ -103,8 +103,10 @@ void sch_pdu::parse_packet(uint8_t *ptr) read_len += subheaders[i].size_plus_header(); } - if (pdu_len-read_len-1 >= 0) { - subheaders[nof_subheaders-1].set_payload_size(pdu_len-read_len-1); + int n_sub = pdu_len-read_len-1; + + if (n_sub >= 0) { + subheaders[nof_subheaders-1].set_payload_size(n_sub); } else { fprintf(stderr,"Reading MAC PDU: negative payload for last subheader\n"); } @@ -584,17 +586,22 @@ int sch_subh::set_sdu(uint32_t lcid_, uint32_t requested_bytes, read_pdu_interfa payload = ((sch_pdu*)parent)->get_current_sdu_ptr(); // Copy data and get final number of bytes written to the MAC PDU - uint32_t sdu_sz = sdu_itf->read_pdu(lcid, payload, requested_bytes); + int sdu_sz = sdu_itf->read_pdu(lcid, payload, requested_bytes); - if (sdu_sz < 0 || sdu_sz > requested_bytes) { + if (sdu_sz < 0) { return -1; } if (sdu_sz == 0) { return 0; } + else { + // Save final number of written bytes + nof_bytes = sdu_sz; - // Save final number of written bytes - nof_bytes = sdu_sz; + if(nof_bytes > requested_bytes) { + return -1; + } + } ((sch_pdu*)parent)->add_sdu(nof_bytes); ((sch_pdu*)parent)->update_space_sdu(nof_bytes); diff --git a/lib/src/phy/fec/test/turbocoder_test.c b/lib/src/phy/fec/test/turbocoder_test.c index 8daeebdb8..f8219a4e2 100644 --- a/lib/src/phy/fec/test/turbocoder_test.c +++ b/lib/src/phy/fec/test/turbocoder_test.c @@ -40,7 +40,7 @@ uint32_t long_cb = 0; void usage(char *prog) { printf("Usage: %s\n", prog); - printf("\t-l long_cb [Default check all]\n", long_cb); + printf("\t-l long_cb [Default %u]\n", long_cb); } void parse_args(int argc, char **argv) { diff --git a/lib/src/phy/phch/test/pbch_file_test.c b/lib/src/phy/phch/test/pbch_file_test.c index 6b79db422..dac516859 100644 --- a/lib/src/phy/phch/test/pbch_file_test.c +++ b/lib/src/phy/phch/test/pbch_file_test.c @@ -208,7 +208,7 @@ int main(int argc, char **argv) { /* Get channel estimates for each port */ srslte_chest_dl_estimate(&chest, fft_buffer, ce, 0); - INFO("Decoding PBCH\n", 0); + INFO("Decoding PBCH\n"); for (int i=0;i Date: Sat, 28 Apr 2018 21:26:27 +0200 Subject: [PATCH 4/7] private internal nas methods --- srsepc/hdr/mme/s1ap_nas_transport.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/srsepc/hdr/mme/s1ap_nas_transport.h b/srsepc/hdr/mme/s1ap_nas_transport.h index 9df615914..e0b7d93fa 100644 --- a/srsepc/hdr/mme/s1ap_nas_transport.h +++ b/srsepc/hdr/mme/s1ap_nas_transport.h @@ -47,7 +47,20 @@ public: bool handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *init_ue, struct sctp_sndrcvinfo *enb_sri, srslte::byte_buffer_t *reply_buffer, bool *reply_flag); bool handle_uplink_nas_transport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT *ul_xport, struct sctp_sndrcvinfo *enb_sri, srslte::byte_buffer_t *reply_buffer, bool *reply_flag); - //Initial UE messages + bool pack_attach_accept(ue_emm_ctx_t *ue_emm_ctx, ue_ecm_ctx_t *ue_ecm_ctx, LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT *erab_ctxt, struct srslte::gtpc_pdn_address_allocation_ie *paa, srslte::byte_buffer_t *nas_buffer); + +private: + s1ap_nas_transport(); + virtual ~s1ap_nas_transport(); + + srslte::log *m_s1ap_log; + srslte::byte_buffer_pool *m_pool; + + s1ap* m_s1ap; + hss_interface_s1ap* m_hss; + mme_gtpc* m_mme_gtpc; + + //Initial UE messages bool handle_nas_attach_request( uint32_t enb_ue_s1ap_id, srslte::byte_buffer_t *nas_msg, srslte::byte_buffer_t *reply_buffer, @@ -107,7 +120,6 @@ public: bool pack_security_mode_command(srslte::byte_buffer_t *reply_msg, ue_emm_ctx_t *ue_emm_ctx, ue_ecm_ctx_t *ue_ecm_ctx); bool pack_esm_information_request(srslte::byte_buffer_t *reply_msg, ue_emm_ctx_t *ue_emm_ctx, ue_ecm_ctx_t *ue_ecm_ctx); - bool pack_attach_accept(ue_emm_ctx_t *ue_emm_ctx, ue_ecm_ctx_t *ue_ecm_ctx, LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT *erab_ctxt, struct srslte::gtpc_pdn_address_allocation_ie *paa, srslte::byte_buffer_t *nas_buffer); bool pack_identity_request(srslte::byte_buffer_t *reply_msg, uint32_t enb_ue_s1ap_id, uint32_t mme_ue_s1ap_id); bool pack_emm_information(ue_ctx_t* ue_ctx, srslte::byte_buffer_t *reply_msg); @@ -116,18 +128,6 @@ public: void log_unhandled_attach_request_ies(const LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT *attach_req); void log_unhandled_pdn_con_request_ies(const LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT *pdn_con_req); void log_unhandled_initial_ue_message_ies(LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *init_ue); - - -private: - s1ap_nas_transport(); - virtual ~s1ap_nas_transport(); - - srslte::log *m_s1ap_log; - srslte::byte_buffer_pool *m_pool; - - s1ap* m_s1ap; - hss_interface_s1ap* m_hss; - mme_gtpc* m_mme_gtpc; }; } //namespace srsepc #endif // SRSEPC_S1AP_NAS_TRANSPORT_H From 977ed71848e6eca5e58292605672b5376e278887 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Sat, 28 Apr 2018 21:28:44 +0200 Subject: [PATCH 5/7] enodeb print security key --- srsenb/src/upper/rrc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsenb/src/upper/rrc.cc b/srsenb/src/upper/rrc.cc index f47656c6d..ceefca07d 100644 --- a/srsenb/src/upper/rrc.cc +++ b/srsenb/src/upper/rrc.cc @@ -958,7 +958,7 @@ void rrc::ue::set_security_capabilities(LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUC void rrc::ue::set_security_key(uint8_t* key, uint32_t length) { memcpy(k_enb, key, length); - + parent->rrc_log->info_hex(k_enb, 32, "Key eNodeB (k_enb)"); // Select algos (TODO: use security capabilities and config preferences) cipher_algo = srslte::CIPHERING_ALGORITHM_ID_EEA0; integ_algo = srslte::INTEGRITY_ALGORITHM_ID_128_EIA1; From caa59e51415a25c338091533ee63e953c1239ca0 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Sat, 28 Apr 2018 21:38:30 +0200 Subject: [PATCH 6/7] Clean up key derivation and more logs --- srsepc/src/mme/s1ap_nas_transport.cc | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/srsepc/src/mme/s1ap_nas_transport.cc b/srsepc/src/mme/s1ap_nas_transport.cc index 1a34c86e2..f96af4246 100644 --- a/srsepc/src/mme/s1ap_nas_transport.cc +++ b/srsepc/src/mme/s1ap_nas_transport.cc @@ -674,10 +674,11 @@ s1ap_nas_transport::handle_nas_guti_attach_request( uint32_t enb_ue_s1ap_id, m_s1ap->add_ue_ctx_to_mme_ue_s1ap_id_map(ue_ctx); //Re-generate K_eNB - liblte_security_generate_k_enb(emm_ctx->security_ctxt.k_asme, emm_ctx->security_ctxt.ul_nas_count, emm_ctx->security_ctxt.k_enb); + srslte::security_generate_k_enb(emm_ctx->security_ctxt.k_asme, emm_ctx->security_ctxt.ul_nas_count, emm_ctx->security_ctxt.k_enb); m_s1ap_log->info("Generating KeNB with UL NAS COUNT: %d\n",emm_ctx->security_ctxt.ul_nas_count); m_s1ap_log->console("Generating KeNB with UL NAS COUNT: %d\n",emm_ctx->security_ctxt.ul_nas_count); - + m_s1ap_log->info_hex(emm_ctx->security_ctxt.k_enb, 32, "Key eNodeB (k_enb)\n"); + m_s1ap_log->console("Attach request -- IMSI: %015lu\n", ecm_ctx->imsi); m_s1ap_log->info("Attach request -- IMSI: %015lu\n", ecm_ctx->imsi); m_s1ap_log->console("Attach request -- eNB-UE S1AP Id: %d, MME-UE S1AP Id: %d\n", ecm_ctx->enb_ue_s1ap_id, ecm_ctx->mme_ue_s1ap_id); @@ -873,8 +874,10 @@ s1ap_nas_transport::handle_nas_service_request(uint32_t m_tmsi, m_s1ap_log->console("UE previously assigned IP: %s",inet_ntoa(emm_ctx->ue_ip)); //Re-generate K_eNB - liblte_security_generate_k_enb(emm_ctx->security_ctxt.k_asme, emm_ctx->security_ctxt.ul_nas_count, emm_ctx->security_ctxt.k_enb); + srslte::security_generate_k_enb(emm_ctx->security_ctxt.k_asme, emm_ctx->security_ctxt.ul_nas_count, emm_ctx->security_ctxt.k_enb); m_s1ap_log->info("Generating KeNB with UL NAS COUNT: %d\n",emm_ctx->security_ctxt.ul_nas_count); + m_s1ap_log->console("Generating KeNB with UL NAS COUNT: %d\n",emm_ctx->security_ctxt.ul_nas_count); + m_s1ap_log->info_hex(emm_ctx->security_ctxt.k_enb, 32, "Key eNodeB (k_enb)\n"); m_s1ap_log->console("UE Ctr TEID %d\n", emm_ctx->sgw_ctrl_fteid.teid); //Save UE ctx to MME UE S1AP id @@ -1617,15 +1620,15 @@ s1ap_nas_transport::pack_security_mode_command(srslte::byte_buffer_t *reply_msg, ue_emm_ctx->security_ctxt.k_nas_enc, ue_emm_ctx->security_ctxt.k_nas_int ); - srslte::security_generate_k_nas( ue_emm_ctx->security_ctxt.k_asme, - srslte::CIPHERING_ALGORITHM_ID_EEA0, - srslte::INTEGRITY_ALGORITHM_ID_128_EIA1, - ue_emm_ctx->security_ctxt.k_nas_enc, - ue_emm_ctx->security_ctxt.k_nas_int - ); + + m_s1ap_log->info_hex(ue_emm_ctx->security_ctxt.k_nas_enc, 32, "Key NAS Encryption (k_nas_enc)\n"); + m_s1ap_log->info_hex(ue_emm_ctx->security_ctxt.k_nas_int, 32, "Key NAS Integrity (k_nas_int)\n"); + uint8_t key_enb[32]; - liblte_security_generate_k_enb(ue_emm_ctx->security_ctxt.k_asme, ue_emm_ctx->security_ctxt.ul_nas_count, ue_emm_ctx->security_ctxt.k_enb); - m_s1ap_log->info("Generating KeNB with UL NAS COUNT: %d\n",ue_emm_ctx->security_ctxt.ul_nas_count); + srslte::security_generate_k_enb(ue_emm_ctx->security_ctxt.k_asme, ue_emm_ctx->security_ctxt.ul_nas_count, ue_emm_ctx->security_ctxt.k_enb); + m_s1ap_log->info("Generating KeNB with UL NAS COUNT: %d\n", ue_emm_ctx->security_ctxt.ul_nas_count); + m_s1ap_log->console("Generating KeNB with UL NAS COUNT: %d\n", ue_emm_ctx->security_ctxt.ul_nas_count); + m_s1ap_log->info_hex(ue_emm_ctx->security_ctxt.k_enb, 32, "Key eNodeB (k_enb)\n"); //Generate MAC for integrity protection //FIXME Write wrapper to support EIA1, EIA2, etc. srslte::security_128_eia1 (&ue_emm_ctx->security_ctxt.k_nas_int[16], From 751f7f6919d7fd0605787160c604242f9800df2f Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Mon, 30 Apr 2018 21:16:26 +0200 Subject: [PATCH 7/7] Reset NAS UL counter when sending security mode command for right k_enb --- srsepc/src/mme/s1ap_ctx_mngmt_proc.cc | 2 +- srsepc/src/mme/s1ap_nas_transport.cc | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc b/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc index 5500fa561..a509b8a70 100644 --- a/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc +++ b/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc @@ -159,7 +159,7 @@ s1ap_ctx_mngmt_proc::send_initial_context_setup_request(ue_emm_ctx_t *emm_ctx, } //Get K eNB liblte_unpack(emm_ctx->security_ctxt.k_enb, 32, in_ctxt_req->SecurityKey.buffer); - m_s1ap_log->info_hex(emm_ctx->security_ctxt.k_enb, 32, "Initial Context Setup Request -- Key eNB\n"); + m_s1ap_log->info_hex(emm_ctx->security_ctxt.k_enb, 32, "Initial Context Setup Request -- Key eNB (k_enb)\n"); srslte::byte_buffer_t *nas_buffer = m_pool->allocate(); if(emm_ctx->state == EMM_STATE_DEREGISTERED) diff --git a/srsepc/src/mme/s1ap_nas_transport.cc b/srsepc/src/mme/s1ap_nas_transport.cc index f96af4246..940271d95 100644 --- a/srsepc/src/mme/s1ap_nas_transport.cc +++ b/srsepc/src/mme/s1ap_nas_transport.cc @@ -1032,6 +1032,7 @@ s1ap_nas_transport::handle_nas_authentication_response(srslte::byte_buffer_t *na m_s1ap_log->console("UE Authentication Accepted.\n"); m_s1ap_log->info("UE Authentication Accepted.\n"); //Send Security Mode Command + emm_ctx->security_ctxt.ul_nas_count = 0; // Reset the NAS uplink counter for the right key k_enb derivation pack_security_mode_command(reply_buffer, emm_ctx, ecm_ctx); *reply_flag = true; m_s1ap_log->console("Downlink NAS: Sending NAS Security Mode Command.\n"); @@ -1121,10 +1122,10 @@ s1ap_nas_transport::handle_nas_attach_complete(srslte::byte_buffer_t *nas_msg, u //Attach requested from attach request m_mme_gtpc->send_modify_bearer_request(emm_ctx->imsi, &ecm_ctx->erabs_ctx[act_bearer.eps_bearer_id]); //Send reply to eNB - m_s1ap_log->console("Packing EMM infromationi\n"); + m_s1ap_log->console("Packing EMM Information\n"); *reply_flag = pack_emm_information(ue_ctx, reply_msg); - m_s1ap_log->console("Sending EMM infromation, bytes %d\n",reply_msg->N_bytes); - m_s1ap_log->info("Sending EMM infromation\n"); + m_s1ap_log->console("Sending EMM Information, bytes %d\n",reply_msg->N_bytes); + m_s1ap_log->info("Sending EMM Information\n"); } emm_ctx->state = EMM_STATE_REGISTERED; return true; @@ -1181,8 +1182,8 @@ s1ap_nas_transport::handle_identity_response(srslte::byte_buffer_t *nas_msg, ue_ ue_emm_ctx_t *emm_ctx = &ue_ctx->emm_ctx; ue_ecm_ctx_t *ecm_ctx = &ue_ctx->ecm_ctx; - m_s1ap_log->info("Id Response -- IMSI: %015lu\n", imsi); - m_s1ap_log->console("Id Response -- IMSI: %015lu\n", imsi); + m_s1ap_log->info("ID response -- IMSI: %015lu\n", imsi); + m_s1ap_log->console("ID Response -- IMSI: %015lu\n", imsi); //Set UE's context IMSI emm_ctx->imsi=imsi;