From 0e76b9ed1536b96f231a1d394e622f01c342f844 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 27 Mar 2020 20:12:38 +0100 Subject: [PATCH] nas: set NAS key set identifier to no key available when attaching with IMSI --- lib/include/srslte/asn1/liblte_mme.h | 1 + srsue/src/stack/upper/nas.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/include/srslte/asn1/liblte_mme.h b/lib/include/srslte/asn1/liblte_mme.h index 7c89b97c7..36af562b0 100644 --- a/lib/include/srslte/asn1/liblte_mme.h +++ b/lib/include/srslte/asn1/liblte_mme.h @@ -1063,6 +1063,7 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ms_network_capability_ie(uint8** // Defines // Enums // Structs +#define LIBLTE_MME_NAS_KEY_SET_IDENTIFIER_NO_KEY_AVAILABLE (7) typedef struct { LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM tsc_flag; uint8 nas_ksi; diff --git a/srsue/src/stack/upper/nas.cc b/srsue/src/stack/upper/nas.cc index 0a473f61b..f32fcece6 100644 --- a/srsue/src/stack/upper/nas.cc +++ b/srsue/src/stack/upper/nas.cc @@ -1698,7 +1698,7 @@ void nas::gen_attach_request(srslte::unique_byte_buffer_t& msg) } else { attach_req.eps_mobile_id.type_of_id = LIBLTE_MME_EPS_MOBILE_ID_TYPE_IMSI; attach_req.nas_ksi.tsc_flag = LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_NATIVE; - attach_req.nas_ksi.nas_ksi = 0; + attach_req.nas_ksi.nas_ksi = LIBLTE_MME_NAS_KEY_SET_IDENTIFIER_NO_KEY_AVAILABLE; usim->get_imsi_vec(attach_req.eps_mobile_id.imsi, 15); nas_log->info("Requesting IMSI attach (IMSI=%s)\n", usim->get_imsi_str().c_str()); liblte_mme_pack_attach_request_msg(&attach_req, (LIBLTE_BYTE_MSG_STRUCT*)msg.get());