aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-07-13 23:30:12 +0200
committerHarald Welte <laforge@gnumonks.org>2012-07-13 23:30:12 +0200
commit4807dd9b21bf48b8a203abe53c5c36b9ecc8c038 (patch)
tree1efb1dc78c89b8a1e8b252a6afb85456ed07747a
parentc1cd027c8a65fc255f0d2271e06c525e68ada164 (diff)
add 'ipsec triplets.dat' mode (-I) to osmo-sim-auth.py
-rwxr-xr-xosmo-sim-auth.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/osmo-sim-auth.py b/osmo-sim-auth.py
index a1364ab..29e0226 100755
--- a/osmo-sim-auth.py
+++ b/osmo-sim-auth.py
@@ -65,12 +65,18 @@ def handle_sim(options, rand_bin):
exit(1)
imsi = s.get_imsi()
- print "Testing SIM card with IMSI %s" % imsi
+ if not options.ipsec:
+ print "Testing SIM card with IMSI %s" % imsi
+ print "\nGSM Authentication"
- print "\nGSM Authentication"
ret = s.run_gsm_alg(rand_bin)
- print "SRES:\t%s" % b2a_hex(byteToString(ret[0]))
- print "Kc:\t%s" % b2a_hex(byteToString(ret[1]))
+
+ if not options.ipsec:
+ print "SRES:\t%s" % b2a_hex(byteToString(ret[0]))
+ print "Kc:\t%s" % b2a_hex(byteToString(ret[1]))
+
+ if options.ipsec:
+ print "1%s@uma.mnc%s.mcc%s.3gppnetwork.org,%s,%s,%s" % (imsi, imsi[3:6], imsi[0:3], b2a_hex(byteToString(rand_bin)), b2a_hex(byteToString(ret[0])), b2a_hex(byteToString(ret[1])))
if __name__ == "__main__":
@@ -85,6 +91,9 @@ if __name__ == "__main__":
parser.add_option("-s", "--sim", dest="sim",
help="SIM mode (default: USIM)",
action="store_true", default=False)
+ parser.add_option("-I", "--ipsec", dest="ipsec",
+ help="IPSEC mode for strongswan triplets.dat",
+ action="store_true")
(options, args) = parser.parse_args()