libosmogsm: Add OSMO_ASSERT() to ensure correct algorithm
Let's make sure that nobody ever ends up calling the algo_impl
call-backs with data of a non-matching algorithm. This should
never happen at all, as all normal users should go through
the auth_core.c:osmo_auth_gen_vec* API, which dispatches based
on algorithm.
Change-Id: I22b504b6cffb4999b2f14772fffcb2f6f02c198c
diff --git a/src/gsm/auth_xor_2g.c b/src/gsm/auth_xor_2g.c
index 1a96b4a..367c79d 100644
--- a/src/gsm/auth_xor_2g.c
+++ b/src/gsm/auth_xor_2g.c
@@ -48,6 +48,8 @@
{
uint8_t res1[16];
+ OSMO_ASSERT(aud->algo == OSMO_AUTH_ALG_XOR_2G);
+
if (aud->type != OSMO_AUTH_TYPE_GSM)
return -ENOTSUP;