Commit 0cdb95ad authored by Lionel Gauthier's avatar Lionel Gauthier

Bug correction in AS Security Mode Command (algorithm selection, wrong...

Bug correction in AS Security Mode Command (algorithm selection, wrong bitmask), temporary forced eea0. eiax selection now OK


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5332 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 82c1563b
...@@ -64,17 +64,17 @@ Address : EURECOM, ...@@ -64,17 +64,17 @@ Address : EURECOM,
static const uint16_t UE_INITIAL_ID_INVALID = 0; static const uint16_t UE_INITIAL_ID_INVALID = 0;
/* Masks for S1AP Encryption algorithms, EEA0 is always supported (not coded) */ /* Masks for S1AP Encryption algorithms, EEA0 is always supported (not coded) */
static const uint16_t S1AP_ENCRYPTION_EEA1_MASK = 0x1; static const uint16_t S1AP_ENCRYPTION_EEA1_MASK = 0x8000;
static const uint16_t S1AP_ENCRYPTION_EEA2_MASK = 0x2; static const uint16_t S1AP_ENCRYPTION_EEA2_MASK = 0x4000;
/* Masks for S1AP Integrity algorithms, EIA0 is always supported (not coded) */ /* Masks for S1AP Integrity algorithms, EIA0 is always supported (not coded) */
static const uint16_t S1AP_INTEGRITY_EIA1_MASK = 0x1; static const uint16_t S1AP_INTEGRITY_EIA1_MASK = 0x8000;
static const uint16_t S1AP_INTEGRITY_EIA2_MASK = 0x2; static const uint16_t S1AP_INTEGRITY_EIA2_MASK = 0x4000;
#ifdef Rel10 #ifdef Rel10
# define INTEGRITY_ALGORITHM_NONE SecurityAlgorithmConfig__integrityProtAlgorithm_eia0_v920 # define INTEGRITY_ALGORITHM_NONE SecurityAlgorithmConfig__integrityProtAlgorithm_eia0_v920
#else #else
#ifndef EXMIMO_IOT #ifdef EXMIMO_IOT
# define INTEGRITY_ALGORITHM_NONE SecurityAlgorithmConfig__integrityProtAlgorithm_eia2 # define INTEGRITY_ALGORITHM_NONE SecurityAlgorithmConfig__integrityProtAlgorithm_eia2
#else #else
# define INTEGRITY_ALGORITHM_NONE SecurityAlgorithmConfig__integrityProtAlgorithm_reserved # define INTEGRITY_ALGORITHM_NONE SecurityAlgorithmConfig__integrityProtAlgorithm_reserved
...@@ -188,6 +188,9 @@ static uint8_t get_UE_index_from_s1ap_ids(uint8_t mod_id, uint16_t ue_initial_id ...@@ -188,6 +188,9 @@ static uint8_t get_UE_index_from_s1ap_ids(uint8_t mod_id, uint16_t ue_initial_id
*/ */
static e_SecurityAlgorithmConfig__cipheringAlgorithm rrc_eNB_select_ciphering(uint16_t algorithms) { static e_SecurityAlgorithmConfig__cipheringAlgorithm rrc_eNB_select_ciphering(uint16_t algorithms) {
#warning "Forced return SecurityAlgorithmConfig__cipheringAlgorithm_eea0, to be deleted in future"
return SecurityAlgorithmConfig__cipheringAlgorithm_eea0;
if (algorithms & S1AP_ENCRYPTION_EEA2_MASK) { if (algorithms & S1AP_ENCRYPTION_EEA2_MASK) {
return SecurityAlgorithmConfig__cipheringAlgorithm_eea2; return SecurityAlgorithmConfig__cipheringAlgorithm_eea2;
} }
...@@ -236,6 +239,14 @@ static int rrc_eNB_process_security (uint8_t mod_id, uint8_t ue_index, security_ ...@@ -236,6 +239,14 @@ static int rrc_eNB_process_security (uint8_t mod_id, uint8_t ue_index, security_
/* Save security parameters */ /* Save security parameters */
eNB_rrc_inst[mod_id].Info.UE[ue_index].security_capabilities = *security_capabilities; eNB_rrc_inst[mod_id].Info.UE[ue_index].security_capabilities = *security_capabilities;
// translation
LOG_D(RRC,
"[eNB %d] NAS security_capabilities.encryption_algorithms %u AS ciphering_algorithm %u NAS security_capabilities.integrity_algorithms %u AS integrity_algorithm %u\n",
mod_id,
eNB_rrc_inst[mod_id].Info.UE[ue_index].security_capabilities.encryption_algorithms,
eNB_rrc_inst[mod_id].ciphering_algorithm[ue_index],
eNB_rrc_inst[mod_id].Info.UE[ue_index].security_capabilities.integrity_algorithms,
eNB_rrc_inst[mod_id].integrity_algorithm[ue_index]);
/* Select relevant algorithms */ /* Select relevant algorithms */
cipheringAlgorithm = rrc_eNB_select_ciphering (eNB_rrc_inst[mod_id].Info.UE[ue_index].security_capabilities.encryption_algorithms); cipheringAlgorithm = rrc_eNB_select_ciphering (eNB_rrc_inst[mod_id].Info.UE[ue_index].security_capabilities.encryption_algorithms);
if (eNB_rrc_inst[mod_id].ciphering_algorithm[ue_index] != cipheringAlgorithm) { if (eNB_rrc_inst[mod_id].ciphering_algorithm[ue_index] != cipheringAlgorithm) {
......
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