From 39a5e72818c39a3740638481f14ba82f8febe97c Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 26 Apr 2024 10:05:41 +0200 Subject: [PATCH] define stream_security_context_t as a struct to get type checking By using a struct we may have warnings at compilation time in some cases if the type is not used properly. The type definition becomes a bit weird, so we need to properly comment. If too strange, we can revert to the classical "void" definition. --- openair3/SECU/secu_defs.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openair3/SECU/secu_defs.h b/openair3/SECU/secu_defs.h index e47804fd3f..bfd3a943ce 100644 --- a/openair3/SECU/secu_defs.h +++ b/openair3/SECU/secu_defs.h @@ -28,10 +28,14 @@ #define SECU_DIRECTION_UPLINK 0 #define SECU_DIRECTION_DOWNLINK 1 -/* stream_security_context_t is an opaque structure - * it is different for each integrity and ciphering algorithm in use +/* stream_security_context_t is an opaque structure. + * It is different for each integrity and ciphering algorithm in use. + * Defined as a struct to have compilation time type checking + * (the "context" field is never actually used). */ -typedef void stream_security_context_t; +typedef struct { + void *context; +} stream_security_context_t; /* stream_security_container_t contains the current configuration * of integrity and ciphering. It is used by PDCP and NAS.