summaryrefslogtreecommitdiffstats
path: root/src/gsm
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-02-21 19:54:36 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-02-22 03:12:51 +0100
commit3b8cb39e7cf4b49ada8fd8135bed9d5f1a8e405a (patch)
tree4fe3642cb3c2a9eead119856bd839d9216c14370 /src/gsm
parent3a5ca647c531b7761dc6c555e5e0cabc972bd3ac (diff)
fix osmo_auth_gen_vec_auts: copy rand to auth vector
Related: OS#1593 Change-Id: If943731a78089f0aac3d55245de80596d01314a4
Diffstat (limited to 'src/gsm')
-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 3b1a5c6e..acb65f57 100644
--- a/src/gsm/auth_core.c
+++ b/src/gsm/auth_core.c
@@ -188,11 +188,18 @@ int osmo_auth_gen_vec_auts(struct osmo_auth_vector *vec,
const uint8_t *_rand)
{
struct osmo_auth_impl *impl = selected_auths[aud->algo];
+ int rc;
if (!impl || !impl->gen_vec_auts)
return -ENOENT;
- return impl->gen_vec_auts(vec, aud, auts, rand_auts, _rand);
+ rc = impl->gen_vec_auts(vec, aud, auts, rand_auts, _rand);
+ if (rc < 0)
+ return rc;
+
+ memcpy(vec->rand, _rand, sizeof(vec->rand));
+
+ return 0;
}
static const struct value_string auth_alg_vals[] = {