[PATCH] libosmocore[master]: fix osmo_auth_gen_vec_auts: copy rand to auth vector

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Feb 22 02:13:10 UTC 2017


Review at  https://gerrit.osmocom.org/1864

fix osmo_auth_gen_vec_auts: copy rand to auth vector

Related: OS#1593
Change-Id: If943731a78089f0aac3d55245de80596d01314a4
---
M src/gsm/auth_core.c
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/64/1864/1

diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c
index 3b1a5c6..acb65f5 100644
--- a/src/gsm/auth_core.c
+++ b/src/gsm/auth_core.c
@@ -188,11 +188,18 @@
 			   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[] = {

-- 
To view, visit https://gerrit.osmocom.org/1864
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If943731a78089f0aac3d55245de80596d01314a4
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>


More information about the gerrit-log mailing list