UE NAS: Add counter for NAS messages

This commit is contained in:
Robert Schmidt
2023-03-28 14:12:05 +02:00
parent 4642a7c0f5
commit 77e61425e0
2 changed files with 5 additions and 3 deletions
+3 -3
View File
@@ -585,7 +585,7 @@ static void generateSecurityModeComplete(nr_ue_nas_t *nas, as_nas_info_t *initia
stream_cipher.key = nas->security.knas_int;
stream_cipher.key_length = 16;
stream_cipher.count = 0;
stream_cipher.count = nas->security.mm_counter++;
stream_cipher.bearer = 1;
stream_cipher.direction = 0;
stream_cipher.message = (unsigned char *)(initialNasMsg->data + 6);
@@ -690,7 +690,7 @@ static void generateRegistrationComplete(nr_ue_nas_t *nas, as_nas_info_t *initia
initialNasMsg->length = length;
stream_cipher.key = nas->security.knas_int;
stream_cipher.key_length = 16;
stream_cipher.count = 1;
stream_cipher.count = nas->security.mm_counter++;
stream_cipher.bearer = 1;
stream_cipher.direction = 0;
stream_cipher.message = (unsigned char *)(initialNasMsg->data + 6);
@@ -802,7 +802,7 @@ static void generatePduSessionEstablishRequest(nr_ue_nas_t *nas, as_nas_info_t *
stream_cipher.key = nas->security.knas_int;
stream_cipher.key_length = 16;
stream_cipher.count = 0;
stream_cipher.count = nas->security.sm_counter++;
stream_cipher.bearer = 1;
stream_cipher.direction = 0;
stream_cipher.message = (unsigned char *)(initialNasMsg->data + 6);
+2
View File
@@ -79,6 +79,8 @@ typedef struct {
uint8_t res[16];
uint8_t rand[16];
uint8_t kgnb[32];
uint32_t mm_counter;
uint32_t sm_counter;
} ue_sa_security_key_t;
typedef struct {