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
diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py
index f9eb858..5fbeea6 100644
--- a/src/osmo_gsm_tester/osmo_bsc.py
+++ b/src/osmo_gsm_tester/osmo_bsc.py
@@ -81,7 +81,10 @@
 
         # 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))
 
diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py
index f023b29..67234e3 100644
--- a/src/osmo_gsm_tester/osmo_msc.py
+++ b/src/osmo_gsm_tester/osmo_msc.py
@@ -81,7 +81,10 @@
 
         # 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))))
 
diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py
index 8f91bbd..b0a706d 100644
--- a/src/osmo_gsm_tester/osmo_nitb.py
+++ b/src/osmo_gsm_tester/osmo_nitb.py
@@ -82,7 +82,10 @@
 
         # 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
 
diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py
index bb4c524..c07bcf2 100644
--- a/src/osmo_gsm_tester/util.py
+++ b/src/osmo_gsm_tester/util.py
@@ -337,4 +337,8 @@
         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