summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/schema.py
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-08-24 16:57:17 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-08-24 17:09:11 +0200
commit713ce2cf869f9a3ad325ace03574af22b9ae321e (patch)
tree9c552eb3d2de211b0298f1cabdd5cdd30c1f44f8 /src/osmo_gsm_tester/schema.py
parent387526aa99d526a1e36f8c72015b91011abbfc64 (diff)
Introduce auth_algo modem config attribute
Algorithm to use to generate response for the challenge during authentication time is hardcoded in the sim card and cannot be easily changed. Thus specify in the config of each modem the algorithm used by the SIM Card. This attribute is used add subscriber_add() time, when the IMSI, KI and algorithm to use in the MSC to authenticate a given subscriber is stored in the database. This way we can easily set up a specific algorithm for each SimCard/Modem, in case different SimCards are configured with different algorithms. This can be used to specificially test different algorithms too. For instance, let's imagine we have 2 simcards, one configured to use comp128v1 and another one with xor, and we create a test which ckecks that XOR is algo is working fine. We don't want to accidentally select the modem with comp128v1 in this case. Thus we can use this attribute to create a scenario file matching 'auth_algo: xor' to ensure always the correct modem is picked. Change-Id: Ifdf74630afeb05452994bbc9eb62a745a1d745ce
Diffstat (limited to 'src/osmo_gsm_tester/schema.py')
-rw-r--r--src/osmo_gsm_tester/schema.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py
index 4c9b9cd..4df33f2 100644
--- a/src/osmo_gsm_tester/schema.py
+++ b/src/osmo_gsm_tester/schema.py
@@ -61,6 +61,11 @@ def ki(val):
def msisdn(val):
match_re('MSISDN', MSISDN_RE, val)
+def auth_algo(val):
+ if val in ('none', 'xor', 'comp128v1'):
+ return
+ raise ValueError('Unknown Authentication Algorithm: %r' % val)
+
INT = 'int'
STR = 'str'
BOOL_STR = 'bool_str'
@@ -71,6 +76,7 @@ IMSI = 'imsi'
KI = 'ki'
MSISDN = 'msisdn'
TRX_REMOTE_IP = 'trx_remote_ip'
+AUTH_ALGO = 'auth_algo'
SCHEMA_TYPES = {
INT: int,
STR: str,
@@ -82,6 +88,7 @@ SCHEMA_TYPES = {
KI: ki,
MSISDN: msisdn,
TRX_REMOTE_IP: ipv4,
+ AUTH_ALGO: auth_algo,
}
def validate(config, schema):