Change in libosmocore[master]: osmo-aka-verify: Fix use case with OP and not OPc

laforge gerrit-no-reply at lists.osmocom.org
Mon Mar 22 11:05:52 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/23447 )


Change subject: osmo-aka-verify: Fix use case with OP and not OPc
......................................................................

osmo-aka-verify: Fix use case with OP and not OPc

Change-Id: Ic6b5da83276ce2618cd80c6d34d3322bad7b4c48
---
M utils/osmo-aka-verify.c
1 file changed, 5 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/47/23447/1

diff --git a/utils/osmo-aka-verify.c b/utils/osmo-aka-verify.c
index 0caeab3..086add5 100644
--- a/utils/osmo-aka-verify.c
+++ b/utils/osmo-aka-verify.c
@@ -19,6 +19,7 @@
 		const uint8_t *sqn, const uint8_t *amf, uint8_t *mac_a, uint8_t *mac_s);
 int milenage_f2345(const uint8_t *opc, const uint8_t *k, const uint8_t *_rand,
 		   uint8_t *res, uint8_t *ck, uint8_t *ik, uint8_t *ak, uint8_t *akstar);
+int milenage_opc_gen(uint8_t *opc, const uint8_t *k, const uint8_t *op);
 
 static int milenage_check(const uint8_t *opc, const uint8_t *k, const uint8_t *sqn, const uint8_t *_rand,
 			  const uint8_t *autn, uint8_t *ck, uint8_t *ik, uint8_t *res, size_t *res_len,
@@ -204,7 +205,10 @@
 		printf("Warning: You may want to specify AMF\n");
 
 	if (opc_is_op) {
-		/* FIXME */
+		uint8_t op[16];
+		memcpy(op, g_opc, 16);
+		rc = milenage_opc_gen(g_opc, g_k, op);
+		OSMO_ASSERT(rc == 0);
 	}
 
 	return 0;

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/23447
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ic6b5da83276ce2618cd80c6d34d3322bad7b4c48
Gerrit-Change-Number: 23447
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210322/185f1fbc/attachment.htm>


More information about the gerrit-log mailing list