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 <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Kévin Redon <[email protected]>
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-CC: Max <[email protected]>

Reply via email to