From 537d480f3947924a2db182bab36a48f0bb42045f Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Mon, 12 Oct 2015 19:36:35 +0200 Subject: gprs/gb_proxy: Use RAND_bytes for gbproxy TLLI/TMSI allocation This change has some implications for the test case. It manipulated bss_ptmsi_state and sgsn_tlli_state variables to make the output of rand_r() and thus the TLLI/TMSI used predictable. This possibility is gone when using RAND_bytes() so instead it is overridden by a function that returns a deterministic sequence of values (0x00dead00, 0x00dead01, ...). The test cases are adapted to expect these values instead of the pseudo random values before. The gbproxy_test stdout file changes as well, but only where the TLLI/TMSI is displayed (in the hex dumps as well as the TLLI cache entries). All other output is the same. --- openbsc/src/gprs/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openbsc/src/gprs/Makefile.am') diff --git a/openbsc/src/gprs/Makefile.am b/openbsc/src/gprs/Makefile.am index dcc6842d9..f01200312 100644 --- a/openbsc/src/gprs/Makefile.am +++ b/openbsc/src/gprs/Makefile.am @@ -2,7 +2,7 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS=-Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) $(LIBOSMOGB_CFLAGS) $(COVERAGE_CFLAGS) \ - $(LIBCARES_CFLAGS) + $(LIBCARES_CFLAGS) $(LIBCRYPTO_CFLAGS) OSMO_LIBS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) \ $(LIBOSMOCTRL_LIBS) $(LIBOSMOGB_LIBS) @@ -20,7 +20,7 @@ osmo_gbproxy_SOURCES = gb_proxy.c gb_proxy_main.c gb_proxy_vty.c \ gb_proxy_patch.c gb_proxy_tlli.c gb_proxy_peer.c \ gprs_gb_parse.c gprs_llc_parse.c crc24.c gprs_utils.c osmo_gbproxy_LDADD = $(top_builddir)/src/libcommon/libcommon.a \ - $(OSMO_LIBS) -lrt + $(OSMO_LIBS) $(LIBCRYPTO_LIBS) -lrt osmo_sgsn_SOURCES = gprs_gmm.c gprs_sgsn.c gprs_sndcp.c gprs_sndcp_vty.c \ sgsn_main.c sgsn_vty.c sgsn_libgtp.c \ -- cgit v1.2.3