Use own format to specify encryption algorithm

... instead of using the one from from osmo vty directly.

This way we avoid having multiple word attribute value and we can skip
using quotes in the conf files.

Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d
This commit is contained in:
Pau Espin 2017-09-04 16:26:08 +02:00 committed by Neels Hofmeyr
parent cbc724204c
commit abd556ab3d
9 changed files with 26 additions and 13 deletions

View File

@ -5,7 +5,7 @@ nitb:
short_name: osmo-gsm-tester-nitb
long_name: osmo-gsm-tester-nitb
auth_policy: closed
encryption: a5 0
encryption: a5_0
bsc:
net:
@ -14,7 +14,7 @@ bsc:
short_name: osmo-gsm-tester-msc
long_name: osmo-gsm-tester-msc
auth_policy: closed
encryption: a5 0
encryption: a5_0
authentication: optional
msc:
@ -24,7 +24,7 @@ msc:
short_name: osmo-gsm-tester-msc
long_name: osmo-gsm-tester-msc
auth_policy: closed
encryption: a5 0
encryption: a5_0
authentication: optional
bsc_bts:

View File

@ -24,7 +24,7 @@ network
long name ${net_name_long}
auth policy ${net_auth_policy}
location updating reject cause 13
encryption a5 ${encryption}
encryption ${encryption}
neci 1
rrlp mode none
mm info 1

View File

@ -81,7 +81,10 @@ class OsmoBsc(log.Origin):
# runtime parameters:
if self.encryption is not None:
config.overlay(values, dict(bsc=dict(net=dict(encryption=self.encryption))))
encryption_vty = util.encryption2osmovty(self.encryption)
else:
encryption_vty = util.encryption2osmovty(values['bsc']['net']['encryption'])
config.overlay(values, dict(bsc=dict(net=dict(encryption=encryption_vty))))
self.dbg('BSC CONFIG:\n' + pprint.pformat(values))

View File

@ -81,7 +81,10 @@ class OsmoMsc(log.Origin):
# runtime parameters:
if self.encryption is not None:
config.overlay(values, dict(msc=dict(net=dict(encryption=self.encryption))))
encryption_vty = util.encryption2osmovty(self.encryption)
else:
encryption_vty = util.encryption2osmovty(values['msc']['net']['encryption'])
config.overlay(values, dict(msc=dict(net=dict(encryption=encryption_vty))))
if self.authentication is not None:
config.overlay(values, dict(msc=dict(net=dict(authentication=self.authentication))))

View File

@ -82,7 +82,10 @@ class OsmoNitb(log.Origin):
# runtime parameters:
if self.encryption is not None:
config.overlay(values, dict(nitb=dict(net=dict(encryption=self.encryption))))
encryption_vty = util.encryption2osmovty(self.encryption)
else:
encryption_vty = util.encryption2osmovty(values['nitb']['net']['encryption'])
config.overlay(values, dict(nitb=dict(net=dict(encryption=encryption_vty))))
self.config = values

View File

@ -337,4 +337,8 @@ def empty_instance_type(t):
return ()
raise ValueError('type %r not supported!' % t)
def encryption2osmovty(val):
assert val[:3] == 'a5_'
return 'a5 ' + val[3:]
# vim: expandtab tabstop=4 shiftwidth=4

View File

@ -11,8 +11,8 @@ ms = suite.modem()
print('start network...')
msc.set_authentication(False)
msc.set_encryption('a5 0')
bsc.set_encryption('a5 0')
msc.set_encryption('a5_0')
bsc.set_encryption('a5_0')
hlr.start()
stp.start()
msc.start()

View File

@ -11,8 +11,8 @@ ms = suite.modem()
print('start network...')
msc.set_authentication(True)
msc.set_encryption('a5 0')
bsc.set_encryption('a5 0')
msc.set_encryption('a5_0')
bsc.set_encryption('a5_0')
hlr.start()
stp.start()
msc.start()

View File

@ -11,8 +11,8 @@ ms = suite.modem()
print('start network...')
msc.set_authentication(True)
msc.set_encryption('a5 1')
bsc.set_encryption('a5 1')
msc.set_encryption('a5_1')
bsc.set_encryption('a5_1')
hlr.start()
stp.start()
msc.start()