diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 67680d0afc..8d21bd411d 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -404,6 +404,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* rrc_config_ rrc->bwpd = NULL; rrc->ubwpd = NULL; + rrc->as_security_activated = false; // TODO: Put the appropriate list of SIBs rrc->requested_SI_List.buf = CALLOC(1,4); @@ -1572,7 +1573,7 @@ void nr_rrc_ue_process_securityModeCommand(const protocol_ctxt_t *const ctxt_pP, ue_rrc->kgnb, kRRCenc); nr_derive_key(RRC_INT_ALG, - ue_rrc->cipheringAlgorithm, + ue_rrc->integrityProtAlgorithm, ue_rrc->kgnb, kRRCint); @@ -1628,6 +1629,10 @@ void nr_rrc_ue_process_securityModeCommand(const protocol_ctxt_t *const ctxt_pP, } LOG_T(NR_RRC, "\n"); + //TODO the SecurityModeCommand message needs to pass the integrity protection check + // for the UE to declare AS security to be activated + ue_rrc->as_security_activated = true; + nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, nr_rrc_mui++, (enc_rval.encoded + 7) / 8, buffer, deliver_pdu_srb_rlc, NULL); } else LOG_W(NR_RRC,"securityModeCommand->criticalExtensions.present (%d) != NR_SecurityModeCommand__criticalExtensions_PR_securityModeCommand\n", diff --git a/openair2/RRC/NR_UE/rrc_defs.h b/openair2/RRC/NR_UE/rrc_defs.h index c574400a70..f69b369132 100644 --- a/openair2/RRC/NR_UE/rrc_defs.h +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -233,6 +233,7 @@ typedef struct NR_UE_RRC_INST_s { //RRC_LIST_TYPE(NR_SecurityAlgorithmConfig_t, NR_SecurityAlgorithmConfig) SecurityAlgorithmConfig_list; NR_CipheringAlgorithm_t cipheringAlgorithm; e_NR_IntegrityProtAlgorithm integrityProtAlgorithm; + bool as_security_activated; long selected_plmn_identity; Rrc_State_NR_t nrRrcState;