srsUE: Fix for NAS overflow counter computation.

master
Pedro Alvarez 5 years ago
parent 0382933cb1
commit 772ab89391

@ -246,8 +246,7 @@ nas::nas(srslte::task_handler_interface* task_handler_) :
t3421(task_handler_->get_unique_timer()), t3421(task_handler_->get_unique_timer()),
reattach_timer(task_handler_->get_unique_timer()), reattach_timer(task_handler_->get_unique_timer()),
nas_log{"NAS"} nas_log{"NAS"}
{ {}
}
void nas::init(usim_interface_nas* usim_, rrc_interface_nas* rrc_, gw_interface_nas* gw_, const nas_args_t& cfg_) void nas::init(usim_interface_nas* usim_, rrc_interface_nas* rrc_, gw_interface_nas* gw_, const nas_args_t& cfg_)
{ {
@ -823,7 +822,7 @@ bool nas::integrity_check(byte_buffer_t* pdu)
uint8_t* mac = &pdu->msg[1]; uint8_t* mac = &pdu->msg[1];
// generate expected MAC // generate expected MAC
uint32_t count_est = (ctxt.rx_count & 0x0FF0u) | pdu->msg[5]; uint32_t count_est = (ctxt.rx_count & 0x00FFFF00u) | pdu->msg[5];
integrity_generate( integrity_generate(
&k_nas_int[16], count_est, SECURITY_DIRECTION_DOWNLINK, &pdu->msg[5], pdu->N_bytes - 5, &exp_mac[0]); &k_nas_int[16], count_est, SECURITY_DIRECTION_DOWNLINK, &pdu->msg[5], pdu->N_bytes - 5, &exp_mac[0]);

Loading…
Cancel
Save