Commit b6151626 authored by Cedric Roux's avatar Cedric Roux

nrUE NAS: there are actually two NAS COUNT, one for DL and one for UL

parent 2e7b9268
...@@ -603,7 +603,7 @@ static void generateSecurityModeComplete(nr_ue_nas_t *nas, as_nas_info_t *initia ...@@ -603,7 +603,7 @@ static void generateSecurityModeComplete(nr_ue_nas_t *nas, as_nas_info_t *initia
initialNasMsg->length = security_header_len + mm_msg_encode(mm_msg, (uint8_t*)(initialNasMsg->data+security_header_len), size-security_header_len); initialNasMsg->length = security_header_len + mm_msg_encode(mm_msg, (uint8_t*)(initialNasMsg->data+security_header_len), size-security_header_len);
stream_cipher.context = nas->security_container->integrity_context; stream_cipher.context = nas->security_container->integrity_context;
stream_cipher.count = nas->security.nas_count++; stream_cipher.count = nas->security.nas_count_ul++;
stream_cipher.bearer = 1; stream_cipher.bearer = 1;
stream_cipher.direction = 0; stream_cipher.direction = 0;
stream_cipher.message = (unsigned char *)(initialNasMsg->data + 6); stream_cipher.message = (unsigned char *)(initialNasMsg->data + 6);
...@@ -703,7 +703,7 @@ static void generateRegistrationComplete(nr_ue_nas_t *nas, as_nas_info_t *initia ...@@ -703,7 +703,7 @@ static void generateRegistrationComplete(nr_ue_nas_t *nas, as_nas_info_t *initia
initialNasMsg->length = length; initialNasMsg->length = length;
stream_cipher.context = nas->security_container->integrity_context; stream_cipher.context = nas->security_container->integrity_context;
stream_cipher.count = nas->security.nas_count++; stream_cipher.count = nas->security.nas_count_ul++;
stream_cipher.bearer = 1; stream_cipher.bearer = 1;
stream_cipher.direction = 0; stream_cipher.direction = 0;
stream_cipher.message = (unsigned char *)(initialNasMsg->data + 6); stream_cipher.message = (unsigned char *)(initialNasMsg->data + 6);
...@@ -765,7 +765,7 @@ static void generateDeregistrationRequest(nr_ue_nas_t *nas, as_nas_info_t *initi ...@@ -765,7 +765,7 @@ static void generateDeregistrationRequest(nr_ue_nas_t *nas, as_nas_info_t *initi
nas_stream_cipher_t stream_cipher = { nas_stream_cipher_t stream_cipher = {
.context = nas->security_container->integrity_context, .context = nas->security_container->integrity_context,
.count = nas->security.nas_count++, .count = nas->security.nas_count_ul++,
.bearer = 1, .bearer = 1,
.direction = 0, .direction = 0,
.message = (unsigned char *)(initialNasMsg->data + 6), .message = (unsigned char *)(initialNasMsg->data + 6),
...@@ -855,7 +855,7 @@ static void generatePduSessionEstablishRequest(nr_ue_nas_t *nas, as_nas_info_t * ...@@ -855,7 +855,7 @@ static void generatePduSessionEstablishRequest(nr_ue_nas_t *nas, as_nas_info_t *
initialNasMsg->length = security_header_len + mm_msg_encode(mm_msg, (uint8_t*)(initialNasMsg->data+security_header_len), size-security_header_len); initialNasMsg->length = security_header_len + mm_msg_encode(mm_msg, (uint8_t*)(initialNasMsg->data+security_header_len), size-security_header_len);
stream_cipher.context = nas->security_container->integrity_context; stream_cipher.context = nas->security_container->integrity_context;
stream_cipher.count = nas->security.nas_count++; stream_cipher.count = nas->security.nas_count_ul++;
stream_cipher.bearer = 1; stream_cipher.bearer = 1;
stream_cipher.direction = 0; stream_cipher.direction = 0;
stream_cipher.message = (unsigned char *)(initialNasMsg->data + 6); stream_cipher.message = (unsigned char *)(initialNasMsg->data + 6);
......
...@@ -92,7 +92,8 @@ typedef struct { ...@@ -92,7 +92,8 @@ typedef struct {
uint8_t res[16]; uint8_t res[16];
uint8_t rand[16]; uint8_t rand[16];
uint8_t kgnb[32]; uint8_t kgnb[32];
uint32_t nas_count; uint32_t nas_count_ul;
uint32_t nas_count_dl;
} ue_sa_security_key_t; } ue_sa_security_key_t;
typedef struct { typedef struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment