Fix NCC=1 HO in second round

master
Ismael Gomez 7 years ago
parent aaeec591b6
commit 327002a6cb

@ -132,6 +132,7 @@ private:
uint8_t k_enb_star[32]; uint8_t k_enb_star[32];
uint32_t current_ncc; uint32_t current_ncc;
bool is_first_ncc;
bool initiated; bool initiated;

@ -271,7 +271,8 @@ void usim::generate_as_keys(uint8_t *k_asme,
k_up_enc, k_up_enc,
k_up_int); k_up_int);
current_ncc = 0; current_ncc = 0;
is_first_ncc = true;
} }
void usim::generate_as_keys_ho(uint32_t pci, void usim::generate_as_keys_ho(uint32_t pci,
@ -293,10 +294,11 @@ void usim::generate_as_keys_ho(uint32_t pci,
// Generate successive NH // Generate successive NH
while(current_ncc != (uint32_t) ncc) { while(current_ncc != (uint32_t) ncc) {
uint8_t *sync = NULL; uint8_t *sync = NULL;
if (current_ncc) { if (is_first_ncc) {
sync = nh;
} else {
sync = k_enb_initial; sync = k_enb_initial;
is_first_ncc = false;
} else {
sync = nh;
} }
// Generate NH // Generate NH
security_generate_nh(k_asme, security_generate_nh(k_asme,

Loading…
Cancel
Save