From 70b7fcde40f7d40e96c559937769df377316c1e5 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 2 Sep 2019 12:03:09 +0200 Subject: [PATCH] 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 --- sysmo_usimsjs1.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sysmo_usimsjs1.py b/sysmo_usimsjs1.py index 03bec90..4da3470 100644 --- a/sysmo_usimsjs1.py +++ b/sysmo_usimsjs1.py @@ -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 try: print " * Authenticating..."