<p>fixeria <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-msc/+/26391">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ran_msg_iu: do not pass UEA0 to ranap_new_msg_sec_mod_cmd2()<br><br>On the protocol level, it's impossible to indicate UEA0 together<br>with the other algorithms.  The encryption is either a) disabled,<br>so the Encryption Information IE is not present, or b) enabled,<br>so the Encryption Information IE indicates UEA1 and/or UEA2.<br><br>Because of that, the ranap_new_msg_sec_mod_cmd2() would fail to<br>generate the RANAP PDU if the given bitmask has the UEA0 bit set.<br><br>Fixes: 505a94a610fc ("Make UTRAN encryption algorithms configurable")<br>Change-Id: I3271d27c09fc8d70a912bce998ceffbce64dd95e<br>---<br>M src/libmsc/ran_msg_iu.c<br>1 file changed, 3 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/libmsc/ran_msg_iu.c b/src/libmsc/ran_msg_iu.c</span><br><span>index cf57d35..b894df2 100644</span><br><span>--- a/src/libmsc/ran_msg_iu.c</span><br><span>+++ b/src/libmsc/ran_msg_iu.c</span><br><span>@@ -377,7 +377,8 @@</span><br><span> {</span><br><span>  /* TODO: make the choice of available UIA algorithms configurable */</span><br><span>         const uint8_t uia_mask = (1 << OSMO_UTRAN_UIA1) | (1 << OSMO_UTRAN_UIA2);</span><br><span style="color: hsl(0, 100%, 40%);">-   bool use_encryption = cm->utran.uea_encryption_mask > (1 << OSMO_UTRAN_UEA0);</span><br><span style="color: hsl(120, 100%, 40%);">+     const uint8_t uea_mask = cm->utran.uea_encryption_mask & ~(1 << OSMO_UTRAN_UEA0);</span><br><span style="color: hsl(120, 100%, 40%);">+        bool use_encryption = uea_mask != 0x00;</span><br><span> </span><br><span>  LOG_RAN_IU_ENC(caller_fi, LOGL_DEBUG, "Tx RANAP SECURITY MODE COMMAND to RNC, IK=%s, CK=%s\n",</span><br><span>                     osmo_hexdump_nospc(cm->vec->ik, 16),</span><br><span>@@ -388,7 +389,7 @@</span><br><span>                                       use_encryption ? cm->vec->ck : NULL,</span><br><span>                                           RANAP_KeyStatus_new,</span><br><span>                                         (uia_mask << 1), /* API treats LSB as UIA0 */</span><br><span style="color: hsl(0, 100%, 40%);">-                                     cm->utran.uea_encryption_mask);</span><br><span style="color: hsl(120, 100%, 40%);">+                                    uea_mask);</span><br><span> }</span><br><span> </span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-msc/+/26391">change 26391</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-msc/+/26391"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I3271d27c09fc8d70a912bce998ceffbce64dd95e </div>
<div style="display:none"> Gerrit-Change-Number: 26391 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>