fix security key setup

master
Francisco Paisana 5 years ago
parent 83758e4f55
commit 2a83eee0ee

@ -19,7 +19,6 @@
*
*/
#include "srslte/asn1/liblte_s1ap.h"
#include "srslte/asn1/s1ap_asn1.h"
#include "srslte/common/log_filter.h"
#include "srslte/common/test_common.h"

@ -32,7 +32,6 @@
#include "srslte/interfaces/enb_interfaces.h"
#include "s1ap_metrics.h"
#include "srslte/asn1/liblte_s1ap.h"
#include "srslte/common/network_utils.h"
#include "srslte/common/stack_procedure.h"

@ -22,14 +22,12 @@
#include "srsenb/hdr/stack/rrc/rrc.h"
#include "srsenb/hdr/stack/rrc/rrc_mobility.h"
#include "srslte/asn1/asn1_utils.h"
#include "srslte/asn1/liblte_mme.h"
#include "srslte/asn1/rrc_asn1_utils.h"
#include "srslte/common/bcd_helpers.h"
#include "srslte/common/int_helpers.h"
#include "srslte/interfaces/sched_interface.h"
#include "srslte/srslte.h"
using srslte::bit_buffer_t;
using srslte::byte_buffer_t;
using srslte::uint32_to_uint8;
using srslte::uint8_to_uint32;
@ -1267,7 +1265,9 @@ void rrc::ue::set_security_capabilities(const asn1::s1ap::ue_security_cap_s& cap
void rrc::ue::set_security_key(const asn1::fixed_bitstring<256, false, true>& key)
{
memcpy(k_enb, key.data(), key.nof_octets());
for (uint32_t i = 0; i < key.nof_octets(); ++i) {
k_enb[i] = key.data()[key.nof_octets() - 1 - i];
}
parent->rrc_log->info_hex(k_enb, 32, "Key eNodeB (k_enb)");
// Selects security algorithms (cipher_algo and integ_algo) based on capabilities and config preferences
select_security_algorithms();

@ -1278,7 +1278,7 @@ bool s1ap::ue::send_ho_required(uint32_t target_eci,
auto& eutra = transparent_cntr.ue_history_info[0].set_e_utran_cell();
eutra.cell_type.cell_size.value = cell_size_opts::medium;
target_plmn.to_s1ap_plmn_bytes(eutra.global_cell_id.plm_nid.data());
for (uint32_t i = 0; i < LIBLTE_S1AP_CELLIDENTITY_BIT_STRING_LEN; ++i) {
for (uint32_t i = 0; i < eutra.global_cell_id.cell_id.length(); ++i) {
eutra.global_cell_id.cell_id.set(i, s1ap_ptr->eutran_cgi.cell_ID.buffer[i]);
}
// - set time spent in current source cell

Loading…
Cancel
Save