aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2019-01-23 15:50:14 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2019-01-23 15:52:43 +0100
commit00534312cbaa79f3ed409ad8071652599c6e8c79 (patch)
tree70bbfb44b9e2c0ab0a799923facef8656f8fce79
parent3aa34223e1f4d75a51382f8a337c69b7e94e36a2 (diff)
Check return code of u.authenticate()HEADmaster
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
-rwxr-xr-xosmo-sim-auth.py3
1 files changed, 3 insertions, 0 deletions
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 @@ def handle_usim(options, rand_bin, autn_bin):
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: