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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

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


Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix osmo_auth_gen_vec_auts: copy rand to auth vector
......................................................................


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(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



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: merged
Gerrit-Change-Id: If943731a78089f0aac3d55245de80596d01314a4
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list