dexter has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sim-auth refs/changes/84/12684/1
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: newchange
Gerrit-Change-Id: Ic22f37931c13e7ec8bd1fa7872cd2a24faeea0ba
Gerrit-Change-Number: 12684
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>