From 408d05c68259411f68635a51924456b6e2d1e3cf Mon Sep 17 00:00:00 2001
From: matzakos <matzakos@eurecom.fr>
Date: Sun, 27 Jun 2021 10:34:37 +0200
Subject: [PATCH] Configure PDCP entity for UE DRB with no integrity and
 ciphering to comply with configuration at gNB

-To be revisited if we want to enable integrity and ciphering for DRBs
---
 openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c | 3 ---
 openair2/RRC/NR_UE/rrc_UE.c              | 3 +--
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
index 2717ab9a9b..21e35a54a0 100644
--- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
+++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
@@ -65,9 +65,6 @@ static void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity,
                 buffer[2];
     header_size = 3;
   }
-  // FIXME: DRB creation is with integrity, but we don't receive it
-  if ( entity->type != NR_PDCP_SRB ) 
-      entity->has_integrity=0;
   /* SRBs always have MAC-I, even if integrity is not active */
   if ( entity->has_integrity ||
        entity->type == NR_PDCP_SRB) {
diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c
index 140574e310..b338a46e72 100644
--- a/openair2/RRC/NR_UE/rrc_UE.c
+++ b/openair2/RRC/NR_UE/rrc_UE.c
@@ -2158,8 +2158,7 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
                                     NULL,
                                     radioBearerConfig->drb_ToAddModList,
                                     NULL,
-                                    NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm |
-                                    (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4),
+                                    0,
                                     NULL,
                                     NULL,
                                     kUPenc,
-- 
2.26.2