Attention is currently required from: fixeria.
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/27507 )

Change subject: gsm48_make_ho_cmd(): optionally add Cipher Mode Setting IE
......................................................................


Patch Set 1: Code-Review+2

(1 comment)

File src/osmo-bsc/gsm_04_08_rr.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/27507/comment/7dba7aeb_6fc14bf1
PS1, Line 585: (new_lchan->encr.alg_id - 2) << 1
This looked wrong at first but i figured it out.
I think it would be good to explain this, maybe put it in a separate function.

Explanation:

looking at 44.018 10.5.2.9:

if n is the A5/n number, then from the spec i get to this formula:

  (n - 1) << 1

However, encr.alg_id is (for historical reasons) stored as what seems to be n + 
1,
which makes this formula correct.

Some comments spread around osmo-msc.git explain as:

                        /*! alg_id is in encoded format:
                         * alg_id == 1 means A5/0 i.e. no encryption, alg_id == 
4 means A5/3.
                         * alg_id == 0 means no such IE was present. */

The "encoded format" is in fact the Algorithm Identifier as in 3GPP TS 48.008 
3.2.2.44 Chosen Encryption Algorithm.

If I were to write this from scratch, I'd have rather stored the plain A5/n 
number in encr.alg_id (as encr.alg_a5). Since we have alg_id around everywhere 
already, I think it would be nice to have a macro like ALG_A5_NR_TO_RSL() or a 
seprate function to explicitly show the intended conversion.

can also follow later, we'd like to get this fix out for testing.



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I1d270e82d0a9b12897fc94dae4e8999aa132a22f
Gerrit-Change-Number: 27507
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-Attention: fixeria <[email protected]>
Gerrit-Comment-Date: Mon, 14 Mar 2022 10:53:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Reply via email to