aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/mm_auth/mm_auth_test.ok
AgeCommit message (Collapse)AuthorFilesLines
2016-03-31Fix MM Auth: zero-initialize auth tuple before first useNeels Hofmeyr1-0/+4
Make sure a new auth tuple is initialized after db_get_lastauthtuple_for_subscr() returns an error, i.e. if no tuple is present for the subscriber yet. Before this patch, the first key_seq depended on the typically uninitialized value that was present in auth tuple's key_seq upon calling auth_get_tuple_for_subscr(). The very first key_seq used for a new subscriber will now always be 0. Before, it used to be mostly 1 ("(0 + 1) % 7"), but depended on whether the key_seq was indeed initialized with 0, actually by random.
2016-03-31Fix MM Auth: disallow key_seq mismatchNeels Hofmeyr1-0/+6
In auth_get_tuple_for_subscr(), add missing condition to match incoming key_seq with stored key_seq, so that re-authentication is requested for mismatching key_seqs. Add test for this issue.
2016-03-31MM Auth: introduce AUTH_ERROR constant.Neels Hofmeyr1-1/+1
Instead of using hardcoded -1 for errors, include -1 in the enum auth_action type; apply its use. In the mm_auth test, the string output changes from '(internal error)' to 'AUTH_ERROR', since now the proper enum value is used in auth_action_names[].
2016-03-31MM Auth test: add test to re-use existing authNeels Hofmeyr1-0/+6
2016-03-31MM Auth test: add two tests for AUTH_THEN_CIPHNeels Hofmeyr1-0/+16
Test two situations for AUTH_DO_AUTH_THEN_CIPH: - when no auth tuple is available - when the key sequence from LU is marked invalid Add convenience auth tuple comparison function using stringification.
2016-03-31Add MM Auth test; add auth_action_str() functionNeels Hofmeyr1-0/+8
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].