sysmo_usimsjs1: check ADM1 length

The length of the ADM1 key is currently not checked. The key is 8
digits long for all sysmo-usim-sjs1 cards. Lets make sure that the
length is checked before trying to authenticate.

Change-Id: I10a89d8343c889f6c1b2cf3fc67d08dcf08790cf
This commit is contained in:
Philipp Maier 2019-09-02 12:03:09 +02:00
parent 83760e2c22
commit 70b7fcde40
1 changed files with 4 additions and 0 deletions

View File

@ -236,6 +236,10 @@ def sysmo_usim_admin_auth(sim, adm1, force = False):
print " (double check ADM1 and use option -f to override)"
return False
if(len(adm1) != 8):
print " * Error: Short ADM1, a valid ADM1 is 8 digits long!"
return False
# Try to authenticate
print " * Authenticating..."