<p>Neels Hofmeyr <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/12016">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Pau Espin Pedrol: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">populate gsm_subscriber_connection->encr during Ciph<br><br>The gsm_subscriber_connection->encr is never used. Use it.<br><br>When sending the Ciphering Mode Command, populate the encryption key.<br>When receivint the Ciphering Mode Complete, populate the chosen alg_id.<br><br>Out of paranoia, store the enc key only if the size is large enough.<br><br>Hence the vty_dump_one_conn() now reports the actually chosen A5 algorithm ID<br>used.<br><br>For 3G connections, though, this will still remain 0 in the VTY, since there is<br>no explicit A5 algorithm negotiated on UTRAN. (Security Mode Command and<br>Security Mode Complete instead of the GERAN Ciphering.)<br><br>(Note, 'struct gsm_encr encr' will be renamed to 'struct geran_encr geran_encr'<br>in Idc7ca9da1aa13ae16f5db2cb1024676cbc770820)<br><br>Change-Id: Ice2c470c360612249f97301944c6fdf9443c7dce<br>---<br>M src/libmsc/gsm_04_08.c<br>M src/libmsc/osmo_msc.c<br>2 files changed, 9 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c</span><br><span>index d5cc212..7dd303f 100644</span><br><span>--- a/src/libmsc/gsm_04_08.c</span><br><span>+++ b/src/libmsc/gsm_04_08.c</span><br><span>@@ -1663,6 +1663,13 @@</span><br><span>          memcpy(ei.key, tuple->vec.kc, sizeof(tuple->vec.kc));</span><br><span>  ei.key_len = sizeof(tuple->vec.kc);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+    conn->encr = (struct gsm_encr){};</span><br><span style="color: hsl(120, 100%, 40%);">+  if (ei.key_len <= sizeof(conn->encr.key)) {</span><br><span style="color: hsl(120, 100%, 40%);">+             memcpy(conn->encr.key, ei.key, ei.key_len);</span><br><span style="color: hsl(120, 100%, 40%);">+                conn->encr.key_len = ei.key_len;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+     /* conn->encr.alg_id remains unknown until we receive a Cipher Mode Complete from the BSC */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>    return a_iface_tx_cipher_mode(conn, &ei, retrieve_imeisv);</span><br><span> }</span><br><span> </span><br><span>diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c</span><br><span>index f2c84e6..e3d7055 100644</span><br><span>--- a/src/libmsc/osmo_msc.c</span><br><span>+++ b/src/libmsc/osmo_msc.c</span><br><span>@@ -222,6 +222,8 @@</span><br><span>               }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ conn->encr.alg_id = alg_id;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>     ciph_res.cause = VLR_CIPH_COMPL;</span><br><span>     vlr_subscr_rx_ciph_res(conn->vsub, &ciph_res);</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12016">change 12016</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/12016"/><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-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ice2c470c360612249f97301944c6fdf9443c7dce </div>
<div style="display:none"> Gerrit-Change-Number: 12016 </div>
<div style="display:none"> Gerrit-PatchSet: 8 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>