aboutsummaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-12-14 15:18:05 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-12-18 02:28:58 +0000
commit0af893c79d5f56cc92d68e0ac46ee03e5f7f06d1 (patch)
treede3d34c311dd9367f5e14ec00b6f19734e0caec3 /example
parentb05e36aa384f436b852d7f49acf16a0d1624b2a8 (diff)
osmo_hlr.py: fix auth algo mapping, properly indicate COMP128v1
So far the resources.conf says we're using XOR, but we wrongly map 'xor' to 1, which is actually comp128v1 in enum osmo_auth_algo from libosmocore (which osmo-hlr uses to interpret the numbers from the hlr.db). This explains why our "xor" tests are succeeding even though libosmocore doesn't support XOR at all: we were using comp128v1 all the while. Fix the auth algo mapping: - define correct mappings, copying enum osmo_auth_algo, in util.py - add a function to get the enum value from name, in util.py - use this in osmo_hlr.py Change subscriber_add() API to take the algorithm string instead of a number. The number is libosmocore internal and we should not expose it within our API beyond above dict. There are no callers using this parameter yet anyway. Adjust resources.conf to indicate COMP128v1 which we are actually using and which means we're still using algorithm number 1 after this change. BTW, osmo-nitb uses the ctrl interface which interprets the names, so is not vulnerable to mapping wrong numbers and needs no fix. (If osmo-hlr featured similar CTRL, which it doesn't yet, this code could be more robust.) Related: OS#2758 Change-Id: I7a6ce92468a6ae46136ad4f62381da261fd196c8
Diffstat (limited to 'example')
-rw-r--r--example/resources.conf8
1 files changed, 4 insertions, 4 deletions
diff --git a/example/resources.conf b/example/resources.conf
index 35e3a2d..bec17b4 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -71,7 +71,7 @@ modem:
path: '/sierra_1'
imsi: '901700000009031'
ki: '80A37E6FDEA931EAC92FFA5F671EFEAD'
- auth_algo: 'xor'
+ auth_algo: 'comp128v1'
ciphers: [a5_0, a5_1]
features: ['sms', 'voice', 'ussd', 'gprs']
@@ -79,7 +79,7 @@ modem:
path: '/sierra_2'
imsi: '901700000009029'
ki: '00969E283349D354A8239E877F2E0866'
- auth_algo: 'xor'
+ auth_algo: 'comp128v1'
ciphers: [a5_0, a5_1]
features: ['sms', 'voice', 'ussd', 'gprs']
@@ -87,7 +87,7 @@ modem:
path: '/gobi_0'
imsi: '901700000009030'
ki: 'BB70807226393CDBAC8DD3439FF54252'
- auth_algo: 'xor'
+ auth_algo: 'comp128v1'
ciphers: [a5_0, a5_1]
features: ['sms', 'ussd', 'gprs']
@@ -95,6 +95,6 @@ modem:
path: '/gobi_3'
imsi: '901700000009032'
ki: '2F70DCA43C45ACB97E947FDD0C7CA30A'
- auth_algo: 'xor'
+ auth_algo: 'comp128v1'
ciphers: [a5_0, a5_1]
features: ['gprs']