Change in osmo-sim-auth[master]: Check return code of u.authenticate()

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/.

dexter gerrit-no-reply at lists.osmocom.org
Thu Jan 31 08:55:28 UTC 2019


dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/12684 )

Change subject: Check return code of u.authenticate()
......................................................................

Check return code of u.authenticate()

The method authenticate() of the class USIM may return None in some
error cases. Lets check this fore passing the return code into len()

Change-Id: Ic22f37931c13e7ec8bd1fa7872cd2a24faeea0ba
Related: OS#1967
---
M osmo-sim-auth.py
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Kévin Redon: Verified



diff --git a/osmo-sim-auth.py b/osmo-sim-auth.py
index 89deac4..6ba9557 100755
--- a/osmo-sim-auth.py
+++ b/osmo-sim-auth.py
@@ -41,6 +41,9 @@
 
 	print "\nUMTS Authentication"
 	ret = u.authenticate(rand_bin, autn_bin, ctx='3G')
+        if ret == None:
+                print "UMTS Authentication failed"
+                exit(1)
 	if len(ret) == 1:
 		print "AUTS:\t%s" % b2a_hex(byteToString(ret[0]))
 	else:

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

Gerrit-Project: osmo-sim-auth
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic22f37931c13e7ec8bd1fa7872cd2a24faeea0ba
Gerrit-Change-Number: 12684
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Kévin Redon <kredon at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-CC: Max <msuraev at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190131/89ed842c/attachment.htm>


More information about the gerrit-log mailing list