From 3b8cb39e7cf4b49ada8fd8135bed9d5f1a8e405a Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 21 Feb 2017 19:54:36 +0100 Subject: fix osmo_auth_gen_vec_auts: copy rand to auth vector Related: OS#1593 Change-Id: If943731a78089f0aac3d55245de80596d01314a4 --- src/gsm/auth_core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gsm') 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[] = { -- cgit v1.2.3