Change in osmo-gsm-tester[master]: enb: Set cipher and integrity algos via scenario file

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

ninjab3s gerrit-no-reply at lists.osmocom.org
Fri Dec 4 12:53:44 UTC 2020


ninjab3s has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21533 )


Change subject: enb: Set cipher and integrity algos via scenario file
......................................................................

enb: Set cipher and integrity algos via scenario file

This patch enables setting cipher and integrity algorithms
in Amarisoft eNB and srsENB via scenario files. If no
settings are defined following defaults are applied:
- Cipher algorithm: EEA0, EEA2, EEA1
- Integrity algorithm: EIA2, EIA1, EIA0

Example of setting integrity and chipger algorithms:
- 4g:srsue-rftype at uhd+srsenb-rftype@uhd+cfg-enb-cipher at EEA1+cfg-enb-cipher@EEA0+cfg-enb-integ at EIA2+mod-enb-nprb@6

Change-Id: Id1fbf31c71967d67de11a23d52d32e44c0925061
---
M src/osmo_gsm_tester/core/schema.py
M src/osmo_gsm_tester/obj/enb.py
M src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl
M src/osmo_gsm_tester/templates/srsenb.conf.tmpl
M sysmocom/defaults.conf
A sysmocom/scenarios/cfg-enb-cipher at .conf
A sysmocom/scenarios/cfg-enb-integ at .conf
7 files changed, 34 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/33/21533/1

diff --git a/src/osmo_gsm_tester/core/schema.py b/src/osmo_gsm_tester/core/schema.py
index d56d6ec..adcbe3c 100644
--- a/src/osmo_gsm_tester/core/schema.py
+++ b/src/osmo_gsm_tester/core/schema.py
@@ -106,7 +106,7 @@
     return True
 
 def cipher(val):
-    if val in ('a5_0', 'a5_1', 'a5_2', 'a5_3', 'a5_4', 'a5_5', 'a5_6', 'a5_7'):
+    if val in ('a5_0', 'a5_1', 'a5_2', 'a5_3', 'a5_4', 'a5_5', 'a5_6', 'a5_7', 'EEA0', 'EEA1', 'EEA2'):
         return True
     raise ValueError('Unknown Cipher value: %r' % val)
 
@@ -152,6 +152,11 @@
         return True
     raise ValueError('Invalid duration value: %r' % val)
 
+def integrity_algo(val):
+    if val in ('EIA0', 'EIA1', 'EIA2'):
+        return True
+    raise ValueError('Unknown integrity algorithm')
+
 INT = 'int'
 STR = 'str'
 UINT = 'uint'
@@ -174,6 +179,7 @@
 OSMO_TRX_CLOCK_REF = 'osmo_trx_clock_ref'
 LTE_TRANSMISSION_MODE = 'lte_transmission_mode'
 DURATION = 'duration'
+INTEGRITY_ALGO = 'integrity_algo'
 
 SCHEMA_TYPES = {
         INT: int,
@@ -198,6 +204,7 @@
         OSMO_TRX_CLOCK_REF: osmo_trx_clock_ref,
         LTE_TRANSMISSION_MODE: lte_transmission_mode,
         DURATION: duration,
+        INTEGRITY_ALGO: integrity_algo,
     }
 
 def add(dest, src):
diff --git a/src/osmo_gsm_tester/obj/enb.py b/src/osmo_gsm_tester/obj/enb.py
index cdf9505..1031662 100644
--- a/src/osmo_gsm_tester/obj/enb.py
+++ b/src/osmo_gsm_tester/obj/enb.py
@@ -24,6 +24,12 @@
 from .gnuradio_zmq_broker import GrBroker
 
 def on_register_schemas():
+    config_schema = {
+        'cipher_algo_list[]': schema.CIPHER,
+        'integrity_algo_list[]': schema.INTEGRITY_ALGO,
+        }
+    schema.register_config_schema('enb', config_schema)
+
     resource_schema = {
         'label': schema.STR,
         'type': schema.STR,
diff --git a/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl b/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl
index 4c7aa33..a7fdc63 100644
--- a/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl
@@ -224,9 +224,9 @@
     dpc_pucch_snr_target: 10,
 
     /* RRC/UP ciphering algorithm preference. EEA0 is always the last. */
-    cipher_algo_pref: [],
+    cipher_algo_pref: [${(', '.join(list(dict.fromkeys(enb.cipher_algo)))).replace('EEA', '')}],
     /* RRC integrity algorithm preference. EIA0 is always the last. */
-    integ_algo_pref: [2, 1],
+    integ_algo_pref: [${(', '.join(list(dict.fromkeys(enb.integrity_algo)))).replace('EIA', '')}],
 
     /* (in ms) send RRC connection release after this time of network
        inactivity */
diff --git a/src/osmo_gsm_tester/templates/srsenb.conf.tmpl b/src/osmo_gsm_tester/templates/srsenb.conf.tmpl
index 5df432b..8ebfee9 100644
--- a/src/osmo_gsm_tester/templates/srsenb.conf.tmpl
+++ b/src/osmo_gsm_tester/templates/srsenb.conf.tmpl
@@ -282,5 +282,5 @@
 #link_failure_nof_err = 50
 rrc_inactivity_timer = ${enb.inactivity_timer}
 #max_prach_offset_us  = 30
-#eea_pref_list = EEA0, EEA2, EEA1
-#eia_pref_list = EIA2, EIA1, EIA0
+eea_pref_list = ${', '.join(list(dict.fromkeys(enb.cipher_algo_list)))}
+eia_pref_list = ${', '.join(list(dict.fromkeys(enb.integrity_algo_list)))}
diff --git a/sysmocom/defaults.conf b/sysmocom/defaults.conf
index 7704857..384535b 100644
--- a/sysmocom/defaults.conf
+++ b/sysmocom/defaults.conf
@@ -130,6 +130,14 @@
   a3_hysteresis: 0
   a3_time_to_trigger: 480
   cell_list:
+  cipher_algo_list:
+    - eea_0
+    - eea_2
+    - eea_1
+  integrity_algo_list:
+    - eia_2
+    - eia_1
+    - eia_0
    - cell_id: 0x01
      pci: 0x01
      dl_earfcn: 2850
diff --git a/sysmocom/scenarios/cfg-enb-cipher at .conf b/sysmocom/scenarios/cfg-enb-cipher at .conf
new file mode 100644
index 0000000..b4d64ed
--- /dev/null
+++ b/sysmocom/scenarios/cfg-enb-cipher at .conf
@@ -0,0 +1,4 @@
+config:
+  enb:
+    cipher_algo_list:
+      - ${param1}
\ No newline at end of file
diff --git a/sysmocom/scenarios/cfg-enb-integ at .conf b/sysmocom/scenarios/cfg-enb-integ at .conf
new file mode 100644
index 0000000..2b6c9f9
--- /dev/null
+++ b/sysmocom/scenarios/cfg-enb-integ at .conf
@@ -0,0 +1,4 @@
+config:
+  enb:
+    integrity_algo_list:
+      - ${param1}
\ No newline at end of file

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21533
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Id1fbf31c71967d67de11a23d52d32e44c0925061
Gerrit-Change-Number: 21533
Gerrit-PatchSet: 1
Gerrit-Owner: ninjab3s <nils.fuerste at softwareradiosystems.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201204/cefdedb9/attachment.htm>


More information about the gerrit-log mailing list