SMC: reject NULL integrity for non emergency cases

Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
This commit is contained in:
Eduard Vlad
2025-06-12 09:49:33 +02:00
committed by Guido Casati
parent 6399d93be8
commit 896698dab5
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -1134,6 +1134,12 @@ static void handle_security_mode_command(nr_ue_nas_t *nas, as_nas_info_t *initia
/* todo: stream_security_container_delete() is not called anywhere, deal with that */
nas->security_container = stream_security_container_init(ciphering_algorithm, integrity_algorithm, knas_enc, knas_int);
/* Handle the invalid container with a reject message */
if(nas->security_container == NULL) {
LOG_W(NAS, "Could not create security container!\n");
return;
}
nas_itti_kgnb_refresh_req(nas->UE_id, nas->security.kgnb);
generateSecurityModeComplete(nas, initialNasMsg);
}
+6
View File
@@ -118,6 +118,12 @@ stream_security_container_t *stream_security_container_init(int ciphering_algori
container->integrity_context = stream_integrity_init(integrity_algorithm, integrity_key);
container->ciphering_context = stream_ciphering_init(ciphering_algorithm, ciphering_key);
/* Reject invalid configurations, i.e. ones that set NIA0 */
if (container->integrity_context == NULL) {
stream_security_container_delete(container);
return NULL;
}
return container;
}