summaryrefslogtreecommitdiffstats
path: root/src/gsm/auth_core.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-12-07 02:38:18 +0100
committerHarald Welte <laforge@gnumonks.org>2011-12-07 02:38:18 +0100
commit4afdd5dca21c323675e193d73457fc2cb0f1cecc (patch)
treed40cd26b8ff745b04e25e8915ffd6821a1e94643 /src/gsm/auth_core.c
parenta5ab1620f4fcd01306c82789f60975d646c1fad4 (diff)
auth_core: Make sure we always save the RAND in the vector
Diffstat (limited to 'src/gsm/auth_core.c')
-rw-r--r--src/gsm/auth_core.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c
index c2a13a58..d0c9f1ca 100644
--- a/src/gsm/auth_core.c
+++ b/src/gsm/auth_core.c
@@ -72,11 +72,18 @@ int osmo_auth_gen_vec(struct osmo_auth_vector *vec,
const uint8_t *_rand)
{
struct osmo_auth_impl *impl = selected_auths[aud->algo];
+ int rc;
if (!impl)
return -ENOENT;
- return impl->gen_vec(vec, aud, _rand);
+ rc = impl->gen_vec(vec, aud, _rand);
+ if (rc < 0)
+ return rc;
+
+ memcpy(vec->rand, _rand, sizeof(vec->rand));
+
+ return 0;
}
int osmo_auth_gen_vec_auts(struct osmo_auth_vector *vec,