Commit 8f4aa7a2 authored by Jerome Peraldi's avatar Jerome Peraldi

Merge branch 'private/bugz125253_NR5GC_AS_UP_Security' into 'sqn/3GPP_TTCN_System_Simulator'

add AS Data Plane security: TC 7.1.3.2.x and 7.1.3.3.x

See merge request sequans/system/ttcn/openairinterface5g!15
parents 542bcfb4 e65bcd40
...@@ -260,6 +260,7 @@ security = { ...@@ -260,6 +260,7 @@ security = {
# rlc_log_level ="info"; # rlc_log_level ="info";
# pdcp_log_level ="info"; # pdcp_log_level ="info";
# rrc_log_level ="info"; # rrc_log_level ="info";
# ngap_log_level ="debug"; # nr_rrc_log_level ="info";
# ngap_log_level ="debug";
}; };
...@@ -5,9 +5,7 @@ log_config = { ...@@ -5,9 +5,7 @@ log_config = {
mac_log_level ="error"; mac_log_level ="error";
nr_mac_log_level ="error"; nr_mac_log_level ="error";
rlc_log_level ="info"; rlc_log_level ="info";
nr_rlc_log_level ="info"; pdcp_log_level ="info";
pdcp_log_level ="debug";
nr_pdcp_log_level ="debug";
rrc_log_level ="info"; rrc_log_level ="info";
nr_rrc_log_level ="info"; nr_rrc_log_level ="info";
}; };
......
...@@ -39,6 +39,18 @@ ...@@ -39,6 +39,18 @@
#include "radio/SS/ss_config.h" #include "radio/SS/ss_config.h"
#include "RRC/NR/nr_rrc_defs.h" #include "RRC/NR/nr_rrc_defs.h"
// Used for loopback message routing in DRB-specific TC's
typedef enum {
DRB_MacPdu = 0,
DRB_RlcPdu,
DRB_RlcSdu,
DRB_PdcpPdu,
DRB_PdcpSdu,
DRB_SdapPdu,
DRB_SdapSdu,
DRB_data_type_qty
} nr_drb_data_t;
// forward declarations to avoid including the full typess ***eNB; // forward declarations to avoid including the full typess ***eNB;
struct PHY_VARS_gNB_s; struct PHY_VARS_gNB_s;
struct PHY_VARS_eNB_NB_IoT_s; struct PHY_VARS_eNB_NB_IoT_s;
...@@ -133,6 +145,8 @@ typedef struct { ...@@ -133,6 +145,8 @@ typedef struct {
struct ss_config_s ss; struct ss_config_s ss;
// Variable to store Transaction ID for SS in case of RRCReconfiguration // Variable to store Transaction ID for SS in case of RRCReconfiguration
long rrc_Transaction_Identifier; long rrc_Transaction_Identifier;
// Loopback mode can operate on either sdap, pdcp or rlc
nr_drb_data_t nr_drb_data_type;
RBConfig RB_Config[MAX_NUM_CCs][MAX_RBS]; RBConfig RB_Config[MAX_NUM_CCs][MAX_RBS];
NRRBConfig NR_RB_Config[MAX_NUM_CCs][MAX_NR_RBS]; NRRBConfig NR_RB_Config[MAX_NUM_CCs][MAX_NR_RBS];
} RAN_CONTEXT_t; } RAN_CONTEXT_t;
......
...@@ -153,6 +153,8 @@ typedef struct SecurityActTimeList_s { ...@@ -153,6 +153,8 @@ typedef struct SecurityActTimeList_s {
typedef struct AS_IntegrityInfo_s { typedef struct AS_IntegrityInfo_s {
e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm; e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
uint8_t *kRRCint; uint8_t *kRRCint;
bool isUPIntegrityInfoPresent;
uint8_t *kUPint;
SecurityActTimeList ActTimeList; SecurityActTimeList ActTimeList;
}AS_IntegrityInfo; }AS_IntegrityInfo;
......
This diff is collapsed.
...@@ -36,7 +36,7 @@ typedef enum { ...@@ -36,7 +36,7 @@ typedef enum {
} nr_pdcp_entity_type_t; } nr_pdcp_entity_type_t;
/** /**
* 3GPP TS 33.501 * 3GPP TS 33.501 6.7.4
* RRC downlink ciphering (encryption) at the gNB shall start after sending the AS security mode command message. * RRC downlink ciphering (encryption) at the gNB shall start after sending the AS security mode command message.
* RRC uplink deciphering (decryption) at the gNB shall start after receiving and successful verification of the AS security mode complete message. * RRC uplink deciphering (decryption) at the gNB shall start after receiving and successful verification of the AS security mode complete message.
* *
......
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef _NR_PDCP_SECURITY_H_
#define _NR_PDCP_SECURITY_H_
#define NR_PDCP_DBG
#ifdef NR_PDCP_DBG
#include "LOG/log.h"
#define FNIN LOG_D(PDCP, ">>> %s:%d\n",__FUNCTION__, __LINE__);
#define FNOUT LOG_D(PDCP, "<<< %s:%d\n",__FUNCTION__, __LINE__);
#define LOG_MSG(B, S, ...) LOG_UDUMPMSG(PDCP, B, S, LOG_DUMP_CHAR, __VA_ARGS__);
#else // NR_PDCP_DBG
#define FNIN printf(">>> %s:%d\n", __FUNCTION__, __LINE__);
#define FNOUT printf("<<< %s:%d\n", __FUNCTION__, __LINE__);
#define LOG_MSG(B, S, ...) do {printf(__VA_ARGS__); for (int i = 0; i < S; ++i) printf("%02X", (uint8_t)B[i]); printf("\n"); } while(0);
#endif // NR_PDCP_DBG
#endif /* _NR_PDCP_SECURITY_H_ */
...@@ -158,8 +158,11 @@ void mac_rlc_data_ind ( ...@@ -158,8 +158,11 @@ void mac_rlc_data_ind (
T(T_ENB_RLC_MAC_UL, T_INT(module_idP), T_INT(rntiP), T(T_ENB_RLC_MAC_UL, T_INT(module_idP), T_INT(rntiP),
T_INT(channel_idP), T_INT(tb_sizeP)); T_INT(channel_idP), T_INT(tb_sizeP));
LOG_UDUMPMSG(RLC, buffer_pP, tb_sizeP, LOG_DUMP_CHAR, "%s: ", __FUNCTION__);
if (RC.ss.mode >= SS_SOFTMODEM) { if (RC.ss.mode >= SS_SOFTMODEM) {
if ((tb_sizeP != 0) && (true == enb_flagP) && (channel_idP >= 4)) { LOG_D(RLC, "Packet received over RLC layer, DRB data type == %d\n", RC.nr_drb_data_type);
if ((tb_sizeP != 0) && (true == enb_flagP) && (channel_idP >= 4) && ((RC.nr_drb_data_type == DRB_RlcPdu) || (RC.nr_drb_data_type == DRB_RlcSdu))) {
int drb_id = channel_idP - 3; int drb_id = channel_idP - 3;
int result; int result;
LOG_A(RLC, "Sending packet to SS, Calling SS_DRB_PDU_IND ue %x drb id %d size %u\n", rntiP, drb_id, tb_sizeP); LOG_A(RLC, "Sending packet to SS, Calling SS_DRB_PDU_IND ue %x drb id %d size %u\n", rntiP, drb_id, tb_sizeP);
...@@ -179,11 +182,14 @@ void mac_rlc_data_ind ( ...@@ -179,11 +182,14 @@ void mac_rlc_data_ind (
} }
} }
//if RLC packet is segmented, we shall not "reset" RLC packet in progress
if (RC.nr_drb_data_type == DRB_RlcPdu) {
RC.nr_drb_data_type = DRB_data_type_qty;
}
return; return;
} }
} }
// Trace UL RLC PDU Here
nr_rlc_pkt_info_t rlc_pkt; nr_rlc_pkt_info_t rlc_pkt;
rlc_pkt.direction = DIRECTION_UPLINK; rlc_pkt.direction = DIRECTION_UPLINK;
rlc_pkt.ueid = rntiP; rlc_pkt.ueid = rntiP;
...@@ -239,7 +245,6 @@ tbs_size_t mac_rlc_data_req( ...@@ -239,7 +245,6 @@ tbs_size_t mac_rlc_data_req(
nr_rlc_entity_t *rb; nr_rlc_entity_t *rb;
int maxsize; int maxsize;
// Trace UL RLC PDU Here
nr_rlc_pkt_info_t rlc_pkt; nr_rlc_pkt_info_t rlc_pkt;
rlc_pkt.direction = DIRECTION_DOWNLINK; rlc_pkt.direction = DIRECTION_DOWNLINK;
rlc_pkt.ueid = rntiP; rlc_pkt.ueid = rntiP;
...@@ -630,6 +635,8 @@ rb_found: ...@@ -630,6 +635,8 @@ rb_found:
is_enb = nr_rlc_manager_get_enb_flag(nr_rlc_ue_manager); is_enb = nr_rlc_manager_get_enb_flag(nr_rlc_ue_manager);
ctx.enb_flag = is_enb; ctx.enb_flag = is_enb;
LOG_UDUMPMSG(RLC, buf, size, LOG_DUMP_CHAR, "%s: ", __FUNCTION__);
if (is_enb) { if (is_enb) {
T(T_ENB_RLC_UL, T(T_ENB_RLC_UL,
T_INT(0 /*ctxt_pP->module_id*/), T_INT(0 /*ctxt_pP->module_id*/),
...@@ -681,7 +688,7 @@ rb_found: ...@@ -681,7 +688,7 @@ rb_found:
exit(1); exit(1);
} }
memcpy(memblock->data, buf, size); memcpy(memblock->data, buf, size);
LOG_D(PDCP, "Calling PDCP layer from RLC in %s\n", __FUNCTION__); LOG_I(RLC, "Calling PDCP layer from RLC in %s\n", __FUNCTION__);
if (!pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock, NULL, NULL)) { if (!pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock, NULL, NULL)) {
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__); LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__);
/* what to do in case of failure? for the moment: nothing */ /* what to do in case of failure? for the moment: nothing */
...@@ -722,7 +729,7 @@ static void successful_delivery(void *_ue, nr_rlc_entity_t *entity, int sdu_id) ...@@ -722,7 +729,7 @@ static void successful_delivery(void *_ue, nr_rlc_entity_t *entity, int sdu_id)
exit(1); exit(1);
rb_found: rb_found:
LOG_D(RLC, "sdu %d was successfully delivered on %s %d\n", LOG_I(RLC, "sdu %d was successfully delivered on %s %d\n",
sdu_id, sdu_id,
is_srb ? "SRB" : "DRB", is_srb ? "SRB" : "DRB",
rb_id); rb_id);
...@@ -820,7 +827,7 @@ void *rlc_enb_task(void *arg) ...@@ -820,7 +827,7 @@ void *rlc_enb_task(void *arg)
if (RC.ss.mode >= SS_SOFTMODEM) { if (RC.ss.mode >= SS_SOFTMODEM) {
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
instance_t instance = ITTI_MSG_DESTINATION_INSTANCE(received_msg); instance_t instance = ITTI_MSG_DESTINATION_INSTANCE(received_msg);
LOG_D(RLC, "RLC received SS_DRB_PDU_REQ DRB_ID:%d SDU_SIZE:%d\n", LOG_I(RLC, "RLC received SS_DRB_PDU_REQ DRB_ID:%d SDU_SIZE:%d\n",
SS_DRB_PDU_REQ(received_msg).drb_id, SS_DRB_PDU_REQ(received_msg).sdu_size); SS_DRB_PDU_REQ(received_msg).drb_id, SS_DRB_PDU_REQ(received_msg).sdu_size);
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
instance, instance,
......
...@@ -122,11 +122,13 @@ mui_t rrc_gNB_mui = 0; ...@@ -122,11 +122,13 @@ mui_t rrc_gNB_mui = 0;
uint8_t first_rrcreconfiguration = 0; uint8_t first_rrcreconfiguration = 0;
// temp static storage for AS Security settings to be applied for SRB1 and SRB2 // temp static storage of AS Security settings for SRB1 and SRB2
static e_NR_IntegrityProtAlgorithm _int_algo = 0; static e_NR_IntegrityProtAlgorithm _int_algo = 0;
static NR_CipheringAlgorithm_t _cip_algo = 0; static NR_CipheringAlgorithm_t _cip_algo = 0;
static uint8_t _nr_cp_int_key[16] = {0}; static uint8_t _nr_control_plane_int_key[16] = {0};
static uint8_t _nr_cp_cip_key[16] = {0}; static uint8_t _nr_control_plane_cip_key[16] = {0};
static uint8_t _nr_data_plane_int_key[16] = {0};
static uint8_t _nr_data_plane_cip_key[16] = {0};
///---------------------------------------------------------------------------------------------------------------/// ///---------------------------------------------------------------------------------------------------------------///
///---------------------------------------------------------------------------------------------------------------/// ///---------------------------------------------------------------------------------------------------------------///
...@@ -917,10 +919,9 @@ static void rrc_gNB_generate_defaultRRCReconfiguration(const protocol_ctxt_t *co ...@@ -917,10 +919,9 @@ static void rrc_gNB_generate_defaultRRCReconfiguration(const protocol_ctxt_t *co
size, size,
buffer, buffer,
PDCP_TRANSMISSION_MODE_CONTROL); PDCP_TRANSMISSION_MODE_CONTROL);
}
// rrc_pdcp_config_asn1_req // rrc_pdcp_config_asn1_req
}
break; break;
case ngran_gNB_DU: case ngran_gNB_DU:
// nothing to do for DU // nothing to do for DU
...@@ -1646,9 +1647,13 @@ rrc_gNB_process_RRCReconfigurationComplete( ...@@ -1646,9 +1647,13 @@ rrc_gNB_process_RRCReconfigurationComplete(
kRRCenc = (uint8_t*)malloc(16); kRRCenc = (uint8_t*)malloc(16);
kRRCint = (uint8_t*)malloc(16); kRRCint = (uint8_t*)malloc(16);
AssertFatal(kRRCint && kRRCenc, "malloc failed"); kUPint = (uint8_t*)malloc(16);
memcpy(kRRCenc, _nr_cp_cip_key, 16); kUPenc = (uint8_t*)malloc(16);
memcpy(kRRCint, _nr_cp_int_key, 16); AssertFatal(kRRCint && kRRCenc && kUPint && kUPenc, "malloc failed\n");
memcpy(kRRCenc, _nr_control_plane_cip_key, 16);
memcpy(kRRCint, _nr_control_plane_int_key, 16);
memcpy(kUPint, _nr_data_plane_int_key, 16);
memcpy(kUPenc, _nr_data_plane_int_key, 16);
LOG_D(NR_RRC, "Configuring PDCP DRBs/SRBs for UE %04x\n", ue_context_pP->ue_context.rnti); LOG_D(NR_RRC, "Configuring PDCP DRBs/SRBs for UE %04x\n", ue_context_pP->ue_context.rnti);
...@@ -1674,7 +1679,7 @@ rrc_gNB_process_RRCReconfigurationComplete( ...@@ -1674,7 +1679,7 @@ rrc_gNB_process_RRCReconfigurationComplete(
ctxt_pP->rntiMaybeUEid, ctxt_pP->rntiMaybeUEid,
reestablish_ue_id, reestablish_ue_id,
DRB_configList, DRB_configList,
(ue_context_pP->ue_context.integrity_algorithm << 4) | ue_context_pP->ue_context.ciphering_algorithm, (_int_algo << 4) | _cip_algo,
kUPenc, kUPenc,
kUPint, kUPint,
get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList : NULL); get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList : NULL);
...@@ -4678,15 +4683,19 @@ void *rrc_gnb_task(void *args_p) { ...@@ -4678,15 +4683,19 @@ void *rrc_gnb_task(void *args_p) {
msg_p->ittiMsgHeader.lte_time.frame, msg_p->ittiMsgHeader.lte_time.slot); msg_p->ittiMsgHeader.lte_time.frame, msg_p->ittiMsgHeader.lte_time.slot);
if (_int_algo > 0) { if (_int_algo > 0) {
memcpy(&(_nr_cp_int_key[0]), &(RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint[0]), 16); memcpy(&(_nr_control_plane_int_key[0]), &(RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint[0]), 16);
memcpy(&(_nr_data_plane_int_key[0]), &(RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kUPint[0]), 16);
} else { } else {
memset(&(_nr_cp_int_key[0]), 0, 16); memset(&(_nr_control_plane_int_key[0]), 0, 16);
memset(&(_nr_data_plane_int_key[0]), 0, 16);
} }
if (_cip_algo > 0) { if (_cip_algo > 0) {
memcpy(&(_nr_cp_cip_key[0]), &(RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kRRCenc[0]), 16); memcpy(&(_nr_control_plane_cip_key[0]), &(RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kRRCenc[0]), 16);
memcpy(&(_nr_data_plane_cip_key[0]), &(RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kUPenc[0]), 16);
} else { } else {
memset(&(_nr_cp_cip_key[0]), 0, 16); memset(&(_nr_control_plane_cip_key[0]), 0, 16);
memset(&(_nr_data_plane_cip_key[0]), 0, 16);
} }
int unused = 0; int unused = 0;
......
...@@ -1784,8 +1784,8 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB ...@@ -1784,8 +1784,8 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout, &asn_DEF_NR_UL_DCCH_Message, (void *)&ul_dcch_msg); xer_fprint(stdout, &asn_DEF_NR_UL_DCCH_Message, (void *)&ul_dcch_msg);
} }
log_dump(MAC, buffer, 16, LOG_DUMP_CHAR, "securityModeComplete payload: "); log_dump(NR_RRC, buffer, (enc_rval.encoded+7)/8, LOG_DUMP_CHAR, "securityModeComplete payload: ");
LOG_D(NR_RRC, "securityModeComplete Encoded %zd bits (%zd bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8); LOG_I(NR_RRC, "securityModeComplete Encoded %zd bits (%zd bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8);
for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) { for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) {
LOG_I(NR_RRC, "%02x.", buffer[i]); LOG_I(NR_RRC, "%02x.", buffer[i]);
...@@ -2325,14 +2325,7 @@ nr_rrc_ue_establish_srb2( ...@@ -2325,14 +2325,7 @@ nr_rrc_ue_establish_srb2(
NR_DL_DCCH_Message_t *dl_dcch_msg = NULL; NR_DL_DCCH_Message_t *dl_dcch_msg = NULL;
MessageDef *msg_p; MessageDef *msg_p;
if (Srb_id != 1) { LOG_D(NR_RRC, "Decoding DL-DCCH message received message on SRB%ld\n", Srb_id);
LOG_E(NR_RRC,"[UE %d] Frame %d: Received message on DL-DCCH (SRB%ld), should not have ...\n",
ctxt_pP->module_id, ctxt_pP->frame, Srb_id);
} else {
LOG_D(NR_RRC, "Received message on SRB%ld\n", Srb_id);
}
LOG_D(NR_RRC, "Decoding DL-DCCH Message\n");
dec_rval = uper_decode( NULL, dec_rval = uper_decode( NULL,
&asn_DEF_NR_DL_DCCH_Message, &asn_DEF_NR_DL_DCCH_Message,
(void **)&dl_dcch_msg, (void **)&dl_dcch_msg,
......
...@@ -212,9 +212,7 @@ int stream_compute_integrity_eia1(stream_cipher_t *stream_cipher, uint8_t out[4] ...@@ -212,9 +212,7 @@ int stream_compute_integrity_eia1(stream_cipher_t *stream_cipher, uint8_t out[4]
// printf ("MAC_I:%16X\n",MAC_I); // printf ("MAC_I:%16X\n",MAC_I);
MAC_I = hton_int32(MAC_I); MAC_I = hton_int32(MAC_I);
memcpy(out, &MAC_I, 4); memcpy(out, &MAC_I, 4);
LOG_A(OSA, "MAC-I Calculated for algorithm,\n" LOG_A(OSA, "MAC-I Calculated for algorithm: %02x.%02x.%02x.%02x\n", out[0], out[1], out[2], out[3]);
"\tMAC-I %02x.%02x.%02x.%02x\n",
out[0], out[1], out[2], out[3]);
return 0; return 0;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -283,7 +283,7 @@ static void ss_task_handle_rrc_pdu_req(struct NR_RRC_PDU_REQ *req) ...@@ -283,7 +283,7 @@ static void ss_task_handle_rrc_pdu_req(struct NR_RRC_PDU_REQ *req)
} }
LOG_A(GNB_APP, "[SS_SRB][NR_RRC_PDU_REQ] sending to TASK_RRC_GNB: {srb: %d, ch: %s, qty: %d }", LOG_A(GNB_APP, "[SS_SRB][NR_RRC_PDU_REQ] sending to TASK_RRC_GNB: {srb: %d, ch: %s, qty: %d }\n",
SS_NRRRC_PDU_REQ(message_p).srb_id, SS_NRRRC_PDU_REQ(message_p).srb_id,
req->RrcPdu.d == NR_RRC_MSG_Request_Type_Ccch ? "CCCH" : "DCCH", SS_NRRRC_PDU_REQ(message_p).sdu_size); req->RrcPdu.d == NR_RRC_MSG_Request_Type_Ccch ? "CCCH" : "DCCH", SS_NRRRC_PDU_REQ(message_p).sdu_size);
...@@ -294,7 +294,7 @@ static void ss_task_handle_rrc_pdu_req(struct NR_RRC_PDU_REQ *req) ...@@ -294,7 +294,7 @@ static void ss_task_handle_rrc_pdu_req(struct NR_RRC_PDU_REQ *req)
LOG_A(GNB_APP, "[SS_SRB] Error in itti_send_msg_to_task"); LOG_A(GNB_APP, "[SS_SRB] Error in itti_send_msg_to_task");
} }
LOG_A(GNB_APP, "Send res: %d", send_res); LOG_A(GNB_APP, "Send res: %d\n", send_res);
} }
} }
......
...@@ -262,7 +262,7 @@ static void sys_handle_nr_as_security_req(struct NR_AS_Security_Type *ASSecurity ...@@ -262,7 +262,7 @@ static void sys_handle_nr_as_security_req(struct NR_AS_Security_Type *ASSecurity
MessageDef *msg_p = itti_alloc_new_message(TASK_SYS_GNB, INSTANCE_DEFAULT, RRC_AS_SECURITY_CONFIG_REQ); MessageDef *msg_p = itti_alloc_new_message(TASK_SYS_GNB, INSTANCE_DEFAULT, RRC_AS_SECURITY_CONFIG_REQ);
if(msg_p) if(msg_p)
{ {
LOG_E(GNB_APP,"[SYS-GNB] AS Security Request Received\n"); LOG_I(GNB_APP,"[SYS-GNB] AS Security Request Received\n");
RRC_AS_SECURITY_CONFIG_REQ(msg_p).rnti = SS_context.ss_rnti_g; RRC_AS_SECURITY_CONFIG_REQ(msg_p).rnti = SS_context.ss_rnti_g;
switch(ASSecurity->d) { switch(ASSecurity->d) {
...@@ -275,9 +275,21 @@ static void sys_handle_nr_as_security_req(struct NR_AS_Security_Type *ASSecurity ...@@ -275,9 +275,21 @@ static void sys_handle_nr_as_security_req(struct NR_AS_Security_Type *ASSecurity
RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint = CALLOC(1,16); RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint = CALLOC(1,16);
memset(RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint,0,16); memset(RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint,0,16);
bits_copy_from_array((char*)RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint, 0, (const char*)ASSecurity->v.StartRestart.Integrity.v.KRRCint, 128); bits_copy_from_array((char*)RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint, 0, (const char*)ASSecurity->v.StartRestart.Integrity.v.KRRCint, 128);
LOG_E(GNB_APP, "[SYS-GNB] kRRCint:\n"); LOG_I(GNB_APP, "[SYS-GNB] kRRCint:\n");
for(int i = 0; i < 16; i++) { for(int i = 0; i < 16; i++) {
LOG_E(GNB_APP, "%02x\n", RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint[i]); LOG_I(GNB_APP, "%02x\n", RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint[i]);
}
if (ASSecurity->v.StartRestart.Integrity.v.KUPint.d == true) {
RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.isUPIntegrityInfoPresent = true;
RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kUPint = CALLOC(1, 16);
memset(RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kUPint, 0, 16);
bits_copy_from_array(RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kUPint, 0, ASSecurity->v.StartRestart.Integrity.v.KUPint.v, 128);
LOG_I(GNB_APP, "[SYS-GNB] kUPint:\n");
for(int i = 0; i < 16; i++) {
LOG_I(GNB_APP, "%02x\n", RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kUPint[i]);
}
} }
if(ASSecurity->v.StartRestart.Integrity.v.ActTimeList.d == true) if(ASSecurity->v.StartRestart.Integrity.v.ActTimeList.d == true)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment