diff --git a/openair-cn/NAS/EURECOM-NAS/Makefile b/openair-cn/NAS/EURECOM-NAS/Makefile index 81fbba90f1..4a69ff77cd 100644 --- a/openair-cn/NAS/EURECOM-NAS/Makefile +++ b/openair-cn/NAS/EURECOM-NAS/Makefile @@ -8,6 +8,9 @@ include Makefile.inc export PROJDIR = $(CURDIR) all: +ifeq ($(PROCESS), UE) + @$(CD) $(SECUDIR) && $(MAKE) +endif @$(CD) $(UTILDIR) && $(MAKE) @$(CD) $(APIDIR) && $(MAKE) @$(CD) $(IESDIR) && $(MAKE) @@ -23,7 +26,7 @@ ifeq ($(PROCESS), MME) @$(CD) $(ASSIMUDIR) && $(MAKE) endif # SR include all objects in a single archive - $(AR) rcs libUE/libNasUE.a `find . -name *.o` + $(AR) rcs libUE/libNasUE.a `find . -name *.o` `find $(OPENAIRCN_DIR)/SECU -name *.o` clean: @$(CD) $(SRCDIR) && $(MAKE) $@ diff --git a/openair-cn/NAS/EURECOM-NAS/Makefile.inc b/openair-cn/NAS/EURECOM-NAS/Makefile.inc index 314a445766..e78eda4c9c 100644 --- a/openair-cn/NAS/EURECOM-NAS/Makefile.inc +++ b/openair-cn/NAS/EURECOM-NAS/Makefile.inc @@ -13,7 +13,8 @@ LIBDIR = $(PROJDIR)/lib LIBPROCESS = $(LIBDIR)$(PROCESS) # Source directories -SRCDIR = $(PROJDIR)/src +SECUDIR = $(OPENAIRCN_DIR)/SECU +SRCDIR = $(PROJDIR)/src INCDIR = $(SRCDIR)/include UTILDIR = $(SRCDIR)/util APIDIR = $(SRCDIR)/api diff --git a/openair-cn/NAS/EURECOM-NAS/Makerules b/openair-cn/NAS/EURECOM-NAS/Makerules index 18b5801740..bef6f3136f 100644 --- a/openair-cn/NAS/EURECOM-NAS/Makerules +++ b/openair-cn/NAS/EURECOM-NAS/Makerules @@ -2,7 +2,7 @@ CC = gcc RM = rm -f CP = cp -p LD = /usr/bin/ld -AR = /usr/bin/ar +AR = /usr/bin/ar CD = cd MAKE = make diff --git a/openair-cn/NAS/EURECOM-NAS/src/Makefile b/openair-cn/NAS/EURECOM-NAS/src/Makefile index a68128ab2a..578f4078a6 100644 --- a/openair-cn/NAS/EURECOM-NAS/src/Makefile +++ b/openair-cn/NAS/EURECOM-NAS/src/Makefile @@ -19,11 +19,11 @@ ifeq ($(TARGET), UEprocess) SRCS = UEprocess.c nas_network.c nas_parser.c nas_proc.c nas_user.c endif -LIBS = -lutil -lapi -lEMMmsg -lESMmsg -lEMMsap -lESMsap -lies -lrt +LIBS = -lutil -lapi -lEMMmsg -lESMmsg -lEMMsap -lESMsap -lies -lrt -lnettle -lcrypto INCLUDES = -I. -I$(INCDIR) -I$(UTILDIR) -I$(USERAPIDIR) -I$(NETAPIDIR) \ -I$(EMMDIR) -I$(EMMMSGDIR) -I$(EMMSAPDIR) \ -I$(ESMDIR) -I$(ESMMSGDIR) -I$(ESMSAPDIR) \ - -I$(IESDIR) -I$(MMEAPIDIR) + -I$(IESDIR) -I$(MMEAPIDIR) .PHONY: $(TARGET) @@ -32,7 +32,7 @@ INCLUDES = -I. -I$(INCDIR) -I$(UTILDIR) -I$(USERAPIDIR) -I$(NETAPIDIR) \ @$(CC) $(CFLAGS) -c $< -o $@ $(TARGET): $(OBJS) - $(CC) $(LDFLAGS) -o $@ $^ $(EMMDIR)/*.o $(ESMDIR)/*.o $(LIBS) + $(CC) $(LDFLAGS) -o $@ $^ $(EMMDIR)/*.o $(ESMDIR)/*.o $(SECUDIR)/*.o $(LIBS) @echo Replacing $@ to $(BINDIR) @$(RM) $(BINDIR)/$@ @$(CP) $@ $(BINDIR) diff --git a/openair-cn/NAS/EURECOM-NAS/src/api/Makefile b/openair-cn/NAS/EURECOM-NAS/src/api/Makefile index 34295ddf42..dd715d7a79 100644 --- a/openair-cn/NAS/EURECOM-NAS/src/api/Makefile +++ b/openair-cn/NAS/EURECOM-NAS/src/api/Makefile @@ -5,7 +5,14 @@ endif include $(PROJDIR)/Makerules include $(PROJDIR)/Makefile.inc -export INCLUDES = -I. -I$(INCDIR) -I$(UTILDIR) -I$(IESDIR) -I$(EMMMSGDIR) -I$(ESMMSGDIR) -I$(SRCDIR) +export INCLUDES = -I. -I$(INCDIR) -I$(UTILDIR) -I$(IESDIR) \ + -I$(EMMDIR) \ + -I$(ESMDIR) \ + -I$(EMMMSGDIR) \ + -I$(ESMMSGDIR) \ + -I$(SRCDIR) \ + -I$(OPENAIRCN_DIR)/COMMON \ + -I$(OPENAIRCN_DIR)/SECU TARGET = $(LIBAPI) TARGETS = $(TARGET).a $(TARGET).so diff --git a/openair-cn/NAS/EURECOM-NAS/src/api/network/Makefile b/openair-cn/NAS/EURECOM-NAS/src/api/network/Makefile index e14844ea35..03b706bc5d 100644 --- a/openair-cn/NAS/EURECOM-NAS/src/api/network/Makefile +++ b/openair-cn/NAS/EURECOM-NAS/src/api/network/Makefile @@ -1,6 +1,6 @@ ifndef PROJDIR PROJDIR = $(PWD)/../../.. -INCLUDES = -I. -I$(INCDIR) -I$(UTILDIR) -I$(IESDIR) -I$(EMMMSGDIR) -I$(ESMMSGDIR) +INCLUDES = -I. -I$(INCDIR) -I$(UTILDIR) -I$(IESDIR) -I$(EMMMSGDIR) -I$(ESMMSGDIR) endif include $(PROJDIR)/Makerules @@ -10,7 +10,7 @@ all: $(OBJS) %.o: %.c Makefile @echo Compiling $< - @$(CC) $(CFLAGS) -c $< -o $@ + @$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ clean: $(RM) $(OBJS) *.bak *~ diff --git a/openair-cn/NAS/EURECOM-NAS/src/api/network/nas_message.c b/openair-cn/NAS/EURECOM-NAS/src/api/network/nas_message.c index 696f1a0b75..0d591b8b99 100644 --- a/openair-cn/NAS/EURECOM-NAS/src/api/network/nas_message.c +++ b/openair-cn/NAS/EURECOM-NAS/src/api/network/nas_message.c @@ -32,6 +32,7 @@ Description Defines the layer 3 messages supported by the NAS sublayer # include "nas_itti_messaging.h" #endif #include "secu_defs.h" +#include "emmData.h" /****************************************************************************/ /**************** E X T E R N A L D E F I N I T I O N S ****************/ @@ -895,7 +896,7 @@ static UInt32_t _nas_message_get_mac( switch (emm_security_context->selected_algorithms.integrity) { case NAS_SECURITY_ALGORITHMS_EIA1: - AssertFatal(0 , + LOG_TRACE(ERROR, "EIA1_128_ALG_ID not implemented"); break; @@ -942,7 +943,7 @@ static UInt32_t _nas_message_get_mac( break; default: - AssertFatal(0 , + LOG_TRACE(ERROR, "Unknown integrity protection algorithm %d", emm_security_context->selected_algorithms.integrity); } diff --git a/openair-cn/NAS/EURECOM-NAS/tools/Makefile b/openair-cn/NAS/EURECOM-NAS/tools/Makefile index 236d115679..97bf016763 100644 --- a/openair-cn/NAS/EURECOM-NAS/tools/Makefile +++ b/openair-cn/NAS/EURECOM-NAS/tools/Makefile @@ -9,7 +9,7 @@ include $(PROJDIR)/Makefile.inc export LD_RUN_PATH = $(LIBDIR):$(LIBPROCESS) -LIBS = -lapi -lutil -lEMMmsg -lESMmsg -lies -lrt +LIBS = -lapi -lutil -lEMMmsg -lESMmsg -lies -lrt INCLUDES = -I. -I$(INCDIR) -I$(UTILDIR) -I$(USIMAPIDIR) -I$(EMMDIR) -I$(ESMDIR) -I$(IESDIR) LIBSUTIL = $(LIBDIR)/$(LIBUTIL).a $(LIBDIR)/$(LIBUTIL).so @@ -28,13 +28,13 @@ all: $(TARGETS) $(CC) $(CFLAGS) -c $< -o $@ $(USIM_TARGET): $(USIM_OBJ) $(LIBSUTIL) - $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SECUDIR)/*.o -lnettle -lcrypto @echo Replacing $@ to $(BINDIR) @$(RM) $(BINDIR)/$@ @$(CP) $@ $(BINDIR) $(UE_TARGET): $(UE_OBJ) $(LIBSUTIL) - $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SECUDIR)/*.o -lnettle -lcrypto @echo Replacing $@ to $(BINDIR) @$(RM) $(BINDIR)/$@ @$(CP) $@ $(BINDIR) diff --git a/openair-cn/NAS/EURECOM-NAS/tools/usim_data.c b/openair-cn/NAS/EURECOM-NAS/tools/usim_data.c index c598594171..853da1ac82 100644 --- a/openair-cn/NAS/EURECOM-NAS/tools/usim_data.c +++ b/openair-cn/NAS/EURECOM-NAS/tools/usim_data.c @@ -299,7 +299,6 @@ int main (int argc, const char* argv[]) usim_data.nasconfig.NMO_I_Behaviour.value[0] = 0x00; usim_data.nasconfig.AttachWithImsi.type = USIM_ATTACH_WITH_IMSI_TAG; usim_data.nasconfig.AttachWithImsi.length = 1; -#undefine START_WITH_GUTI #if defined(START_WITH_GUTI) usim_data.nasconfig.AttachWithImsi.value[0] = 0x00; #else