Change in osmo-msc[master]: utran: use new UTRAN encryption enum

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/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Thu Nov 4 15:51:53 UTC 2021


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/26107 )


Change subject: utran: use new UTRAN encryption enum
......................................................................

utran: use new UTRAN encryption enum

Depends: libosmocore.git I4b9baff2c2fbd0e339fc769cc69cce58d3a72cdf
Change-Id: If6978d7ed1a78facc2591cfc30fda2721629bffa
---
M src/libmsc/gsm_04_08.c
M src/libmsc/msc_net_init.c
M tests/msc_vlr/msc_vlr_test_umts_authen.c
M tests/msc_vlr/msc_vlr_tests.h
4 files changed, 12 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/07/26107/1

diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index fc1b2e2..f34b7b6 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -51,6 +51,7 @@
 #include <osmocom/core/fsm.h>
 #include <osmocom/gsm/tlv.h>
 #include <osmocom/crypt/auth.h>
+#include <osmocom/crypt/utran_cipher.h>
 
 #include <osmocom/msc/msub.h>
 #include <osmocom/msc/msc_roles.h>
@@ -414,7 +415,7 @@
 				net->vlr, msc_a, vlr_lu_type, tmsi, imsi,
 				&old_lai, &msc_a->via_cell.lai,
 				is_utran || net->authentication_required,
-				is_utran ? net->uea_encryption_mask > 0x01 : net->a5_encryption_mask > 0x01,
+				is_utran ? net->uea_encryption_mask > (1 << UTRAN_UEA0) : net->a5_encryption_mask > 0x01,
 				lu->key_seq,
 				osmo_gsm48_classmark1_is_r99(&lu->classmark1),
 				is_utran,
@@ -805,7 +806,7 @@
 			 req->cm_service_type,
 			 &mi, &msc_a->via_cell.lai,
 			 is_utran || net->authentication_required,
-			 is_utran ? net->uea_encryption_mask > 0x01 : net->a5_encryption_mask > 0x01,
+			 is_utran ? net->uea_encryption_mask > (1 << UTRAN_UEA0) : net->a5_encryption_mask > 0x01,
 			 req->cipher_key_seq,
 			 osmo_gsm48_classmark2_is_r99(cm2, cm2_len),
 			 is_utran);
@@ -931,7 +932,7 @@
 			 VLR_PR_ARQ_T_CM_RE_ESTABLISH_REQ, 0,
 			 &mi, &msc_a->via_cell.lai,
 			 is_utran || net->authentication_required,
-			 is_utran ? net->uea_encryption_mask > 0x01 : net->a5_encryption_mask > 0x01,
+			 is_utran ? net->uea_encryption_mask > (1 << UTRAN_UEA0) : net->a5_encryption_mask > 0x01,
 			 req->cipher_key_seq,
 			 osmo_gsm48_classmark2_is_r99(cm2, cm2_len),
 			 is_utran);
@@ -1293,7 +1294,7 @@
 			 net->vlr, msc_a,
 			 VLR_PR_ARQ_T_PAGING_RESP, 0, &mi, &msc_a->via_cell.lai,
 			 is_utran || net->authentication_required,
-			 is_utran ? net->uea_encryption_mask > 0x01 : net->a5_encryption_mask > 0x01,
+			 is_utran ? net->uea_encryption_mask > (1 << UTRAN_UEA0) : net->a5_encryption_mask > 0x01,
 			 pr->key_seq,
 			 osmo_gsm48_classmark2_is_r99(cm2, classmark2_len),
 			 is_utran);
diff --git a/src/libmsc/msc_net_init.c b/src/libmsc/msc_net_init.c
index d53156b..93dbfe6 100644
--- a/src/libmsc/msc_net_init.c
+++ b/src/libmsc/msc_net_init.c
@@ -30,6 +30,7 @@
 #include <osmocom/msc/gsup_client_mux.h>
 #include <osmocom/msc/gsm_04_11_gsup.h>
 #include <osmocom/msc/gsm_09_11.h>
+#include <osmocom/crypt/utran_cipher.h>
 
 /* TODO: would be great to have all timer declarations in one place */
 #include <osmocom/msc/ran_infra.h>
@@ -68,7 +69,7 @@
 	/* Permit a compile-time default of A5/3 and A5/1 */
 	net->a5_encryption_mask = (1 << 3) | (1 << 1);
 	/* Permit a compile-time default of UEA2 and UEA1 */
-	net->uea_encryption_mask = (1 << 2) | (1 << 1);
+	net->uea_encryption_mask = (1 << UTRAN_UEA2) | (1 << UTRAN_UEA1);
 
 	net->mncc_guard_timeout = 180;
 	net->ncss_guard_timeout = 30;
diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.c b/tests/msc_vlr/msc_vlr_test_umts_authen.c
index 655183b..0b3bc31 100644
--- a/tests/msc_vlr/msc_vlr_test_umts_authen.c
+++ b/tests/msc_vlr/msc_vlr_test_umts_authen.c
@@ -333,7 +333,7 @@
 static void test_umts_authen_utran()
 {
 	comment_start();
-	net->uea_encryption_mask = 0x01;
+	net->uea_encryption_mask = (1 << UTRAN_UEA0);
 	_test_umts_authen(OSMO_RAT_UTRAN_IU);
 	comment_end();
 }
@@ -341,7 +341,7 @@
 static void test_umts_auth_ciph_utran()
 {
 	comment_start();
-	net->uea_encryption_mask = 0x06;
+	net->uea_encryption_mask = (1 << UTRAN_UEA1 | 1 << UTRAN_UEA2);
 	_test_umts_authen(OSMO_RAT_UTRAN_IU);
 	comment_end();
 }
@@ -588,7 +588,7 @@
 static void test_umts_authen_resync_utran()
 {
 	comment_start();
-	net->uea_encryption_mask = 0x01;
+	net->uea_encryption_mask = (1 << UTRAN_UEA0);
 	_test_umts_authen_resync(OSMO_RAT_UTRAN_IU);
 	comment_end();
 }
@@ -596,7 +596,7 @@
 static void test_umts_auth_ciph_resync_utran()
 {
 	comment_start();
-	net->uea_encryption_mask = 0x06;
+	net->uea_encryption_mask = (1 << UTRAN_UEA1 | 1 << UTRAN_UEA2);
 	_test_umts_authen_resync(OSMO_RAT_UTRAN_IU);
 	comment_end();
 }
diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h
index a2b2f22..1f83013 100644
--- a/tests/msc_vlr/msc_vlr_tests.h
+++ b/tests/msc_vlr/msc_vlr_tests.h
@@ -26,6 +26,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 
+#include <osmocom/crypt/utran_cipher.h>
 #include <osmocom/msc/gsm_data.h>
 #include <osmocom/msc/vlr.h>
 #include <osmocom/msc/msub.h>

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: If6978d7ed1a78facc2591cfc30fda2721629bffa
Gerrit-Change-Number: 26107
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211104/5bc19d6b/attachment.htm>


More information about the gerrit-log mailing list