summaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-30 11:22:24 +0200
committerHarald Welte <laforge@gnumonks.org>2016-03-31 11:56:00 +0200
commit37984bdb1b507446421e5aa6131ccdf117dd269f (patch)
treee7dea62884366f31181d35f85f9d15b3c5871114 /openbsc/src
parent56ea30ff3f9f98a4903d060196b185ce124d7eaa (diff)
Add MM Auth test; add auth_action_str() function
Add basic MM Authentication test setup, with fake DB access and RAND_bytes(). So far implement simple tests for IO error during DB access and missing auth entry. To print the auth action during tests, add struct auth_action_names and auth_action_str() inline function in auth.[hc].
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/libmsc/auth.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/auth.c b/openbsc/src/libmsc/auth.c
index 65a9b03c4..85123167b 100644
--- a/openbsc/src/libmsc/auth.c
+++ b/openbsc/src/libmsc/auth.c
@@ -31,6 +31,15 @@
#include <stdlib.h>
+const struct value_string auth_action_names[] = {
+#define AUTH_ACTION_STR(X) { X, #X }
+ { -1, "(internal error)" }, /* soon to be fixed with an enum val */
+ AUTH_ACTION_STR(AUTH_NOT_AVAIL),
+ AUTH_ACTION_STR(AUTH_DO_AUTH_THEN_CIPH),
+ AUTH_ACTION_STR(AUTH_DO_CIPH),
+ AUTH_ACTION_STR(AUTH_DO_AUTH),
+#undef AUTH_ACTION_STR
+};
static int
_use_xor(struct gsm_auth_info *ainfo, struct gsm_auth_tuple *atuple)