* Fix SQN incrementation arithmetic
Current implementation of increment_sqn function increments the 48 bits
SQN directly by 1 which is incorrect according to 3GPP TS 33.102 version
11.5.1 Annex C. This bug causes commercial UEs to report AUTHENTICATION
FAILURE EMM cause #21 "synch failure" when SQN is out of sync.
According to 3GPP TS 33.102 version 11.5.1 Annex C, 48 bits SQN consists
of 43 bits SEQ and 5 bits IND parts where SEQ are incremented during
generation of authentication vector or resync procedure. A
new IND value is also assigned when an authentication vector is
generated. However, resync procedure will use the same IND value.
This patch implements the increment_sqn function according to 3GPP TS
33.102 version 11.5.1 Annex C. A new function increment_seq_after_resync
is added to handle the special case of SQN arithmetic during SQN
resynchronization.
This patch is tested with two comercial UEs (Oneplus One and Oneplus 3T).
* Fix the maximum value of SEQ value to be 2^43-1
The SEQ value is 43 bits long and previous maximum value has a typo (one
extra F) which allows SEQ value to be 2^47-1. This patch corrects the typo.
During the resync procedure, the security_milenage_f1_star generates a
MAC_S value that does not match the MAC_S value reported in AUTS. This
posts a security risk.
According to 3GPP TS 33.102 version 11.5.1 section 6.3.3, the AMF used
to calculate MAC-S assumes a dummy value of all zeros so that it does
not need to be transmitted in the clear in the re-synch message.
This patch corrects this problem. MAC_S reported by AUTS matches the
MAC_S calculated using f1_star function after the fix.
* Assign correct values from BladeRf manual calibration to correction
The rf_calibration function for blade RF was assgiing dc_gain to
BLADERF_CORR_FPGA_PHASE and dc_phase to BLADERF_CORR_FPGA_GAIN. This hot
fix corrects the value assignments in both rf_blade_set_tx_cal and
rf_blade_set_rx_cal functions.
* Fix ARM NEON code compilation
Fix LV_HAVE_NEON defintion incorrecly used instead of HAVE_NEON in some places
Replace vqabsq_s32 with vabsq_f32 as vqabsq_s32 requires int type (fails to compile)
Fix missing NEON code path in mat.h in srslte_mat_2x2_mmse_csi_simd()
* Fix timestamp overflow issue on 32-bit systems with Soapy driver
'time_t secs' can be 32-bit on some systems. This causes calculation:
'secs * 1000000000;' to overflow.