Change in osmo-msc[master]: Make UTRAN encryption algorithms configurable

dexter gerrit-no-reply at lists.osmocom.org
Mon Apr 19 13:42:37 UTC 2021


dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/22766 )

Change subject: Make UTRAN encryption algorithms configurable
......................................................................


Patch Set 1: Code-Review+1

(2 comments)

This looks good to me, however I find it a bit difficult to read. On the one hand the code is handling the encryption parameter as a bitbask on the other hand it handles the same encryption parameter as an integer variable with a value from 0-2.

https://gerrit.osmocom.org/c/osmo-msc/+/22766/1/src/libmsc/gsm_04_08.c 
File src/libmsc/gsm_04_08.c:

https://gerrit.osmocom.org/c/osmo-msc/+/22766/1/src/libmsc/gsm_04_08.c@415 
PS1, Line 415: 				is_utran ? net->uea_encryption_mask > 0x01 : net->a5_encryption_mask > 0x01,
This logic > 0x01 is a bit confusion to read. Apparently you are comparing the algorithm number (1-2) here. So if a number from 1-2 is set, then the encryption is present, if the number is 0 then no encryption is active at all. The 0x gives the impression that some bitmask is compared in a wired way. Maybe just writing ... > 1 makes the code more readable. Also a comment might be helpful.


https://gerrit.osmocom.org/c/osmo-msc/+/22766/1/src/libmsc/msc_net_init.c 
File src/libmsc/msc_net_init.c:

https://gerrit.osmocom.org/c/osmo-msc/+/22766/1/src/libmsc/msc_net_init.c@71 
PS1, Line 71: 	net->uea_encryption_mask = (1 << 2) | (1 << 1);
Maybe it is better to add some define constants, also together with the greater-then logic in gsm_04_08.c its a bit difficult to understand what is going on.

Is uea_encryption_mask a mask of discrete bits or does it contain the algorithm number?

0 = 00 off
1 = 01 UEA1
2 = 10 UEA2



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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I91f9e50f9c1439aa19528f887b83ae9de628fcfd
Gerrit-Change-Number: 22766
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Comment-Date: Mon, 19 Apr 2021 13:42:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210419/3221310a/attachment.htm>


More information about the gerrit-log mailing list