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.orglynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/26108 ) Change subject: libmsc/gsm_04_08: refactor require encryption into own inline function ...................................................................... libmsc/gsm_04_08: refactor require encryption into own inline function Change-Id: I9e407f65b282e645feabe714f7f4c3e44fae21e9 --- M include/osmocom/msc/gsm_data.h M src/libmsc/gsm_04_08.c M tests/msc_vlr/msc_vlr_test_umts_authen.c 3 files changed, 13 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/08/26108/1 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 710fd86..1a21b8e 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -13,6 +13,7 @@ #include <osmocom/core/stat_item.h> #include <osmocom/gsm/gsm48.h> #include <osmocom/crypt/auth.h> +#include <osmocom/crypt/utran_cipher.h> #include <osmocom/mgcp_client/mgcp_client.h> @@ -261,6 +262,13 @@ char *sms_db_file_path; }; +static inline bool net_require_encryption(struct gsm_network *net, bool is_utran) { + if (is_utran) + return net->uea_encryption_mask > (1 << UTRAN_UEA0); + else + return net->a5_encryption_mask > 0x1; +} + struct osmo_esme; enum gsm_sms_source_id { diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index f34b7b6..ec92b06 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -415,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 > (1 << UTRAN_UEA0) : net->a5_encryption_mask > 0x01, + net_require_encryption(net, is_utran), lu->key_seq, osmo_gsm48_classmark1_is_r99(&lu->classmark1), is_utran, @@ -806,7 +806,7 @@ req->cm_service_type, &mi, &msc_a->via_cell.lai, is_utran || net->authentication_required, - is_utran ? net->uea_encryption_mask > (1 << UTRAN_UEA0) : net->a5_encryption_mask > 0x01, + net_require_encryption(net, is_utran), req->cipher_key_seq, osmo_gsm48_classmark2_is_r99(cm2, cm2_len), is_utran); @@ -932,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 > (1 << UTRAN_UEA0) : net->a5_encryption_mask > 0x01, + net_require_encryption(net, is_utran), req->cipher_key_seq, osmo_gsm48_classmark2_is_r99(cm2, cm2_len), is_utran); @@ -1294,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 > (1 << UTRAN_UEA0) : net->a5_encryption_mask > 0x01, + net_require_encryption(net, is_utran), pr->key_seq, osmo_gsm48_classmark2_is_r99(cm2, classmark2_len), is_utran); diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.c b/tests/msc_vlr/msc_vlr_test_umts_authen.c index 0b3bc31..9b4af9f 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.c +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.c @@ -49,8 +49,7 @@ "5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e" "d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb" "0c7ac3e9e9b7db05"; - bool encryption = (via_ran == OSMO_RAT_GERAN_A && net->a5_encryption_mask > 0x1) - || (via_ran == OSMO_RAT_UTRAN_IU && net->uea_encryption_mask > 0x1); + bool encryption = net_require_encryption(net, via_ran == OSMO_RAT_UTRAN_IU); net->authentication_required = true; net->vlr->cfg.assign_tmsi = true; -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/26108 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I9e407f65b282e645feabe714f7f4c3e44fae21e9 Gerrit-Change-Number: 26108 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/5bd8d62f/attachment.htm>