aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2018-01-26 15:51:19 +0900
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2018-01-26 15:51:19 +0900
commitb5208b554496c2f7a27bb07789c8d09e2f069a2a (patch)
treecf2e193d7e67fbe1a98069cd7492ba7e54810801
parent4dabfda193543c96f9f3b0fffcf2231ca09e87ed (diff)
cards: Add ability to read/set A3/A8 algorithm for Fairwaves SIM cards.
-rw-r--r--pySim/cards.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/pySim/cards.py b/pySim/cards.py
index 802828f..f1775dd 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -553,6 +553,14 @@ class FairwavesSIM(Card):
byte 1 = 0x01, bytes 2-17: OPC;
byte 1 = 0x00, bytes 2-17: OP;
3F00/7F20/FF02: Ki
+ 3F00/7F20/FF03: 2G/3G auth algorithm
+ byte 1 = GSM SIM A3/A8 algorithm selection
+ byte 2 = USIM A3/A8 algorithm selection
+ Algorithms:
+ 0x01 = Milenage
+ 0x03 = COMP128v1
+ 0x06 = COMP128v2
+ 0x07 = COMP128v3
"""
name = 'Fairwaves SIM'
@@ -560,10 +568,12 @@ class FairwavesSIM(Card):
_EF_num = {
'Ki': 'FF02',
'OP/OPC': 'FF01',
+ 'A3A8': 'FF03',
}
_EF = {
'Ki': DF['GSM']+[_EF_num['Ki']],
'OP/OPC': DF['GSM']+[_EF_num['OP/OPC']],
+ 'A3A8': DF['GSM']+[_EF_num['A3A8']],
}
def __init__(self, ssc):
@@ -647,6 +657,14 @@ class FairwavesSIM(Card):
data, sw = self._scc.update_binary(self._EF['OP/OPC'], content)
return sw
+ def read_a3a8(self):
+ (ef, sw) = self._scc.read_binary(self._EF['A3A8'])
+ return (ef, sw)
+
+ def update_a3a8(self, content):
+ (ef, sw) = self._scc.update_binary(self._EF['A3A8'], content)
+ return (ef, sw)
+
def program(self, p):
# authenticate as ADM1