Fix NCC=1 HO in second round

This commit is contained in:
Ismael Gomez 2018-07-28 10:16:01 +02:00
parent aaeec591b6
commit 327002a6cb
2 changed files with 7 additions and 4 deletions

View File

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

View File

@ -271,7 +271,8 @@ void usim::generate_as_keys(uint8_t *k_asme,
k_up_enc,
k_up_int);
current_ncc = 0;
current_ncc = 0;
is_first_ncc = true;
}
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
while(current_ncc != (uint32_t) ncc) {
uint8_t *sync = NULL;
if (current_ncc) {
sync = nh;
} else {
if (is_first_ncc) {
sync = k_enb_initial;
is_first_ncc = false;
} else {
sync = nh;
}
// Generate NH
security_generate_nh(k_asme,