<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15201">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">remove ogslib dependency from snow<br><br>* don't use ogslib specific header files<br>* don't use ogs_{malloc,free} but simply use the stack<br><br>Change-Id: I5604c594934b03d2fd83e1e465fc150fc542a475<br>---<br>M mme/snow-3g.c<br>M mme/snow-3g.h<br>2 files changed, 2 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/01/15201/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/mme/snow-3g.c b/mme/snow-3g.c</span><br><span>index 992b107..60bdffd 100644</span><br><span>--- a/mme/snow-3g.c</span><br><span>+++ b/mme/snow-3g.c</span><br><span>@@ -381,7 +381,7 @@</span><br><span>    int n = ( length + 31 ) / 32;</span><br><span>        int i=0;</span><br><span>     int lastbits = (8-(length%8)) % 8;</span><br><span style="color: hsl(0, 100%, 40%);">-      u32 *KS;</span><br><span style="color: hsl(120, 100%, 40%);">+      u32 KS[n];</span><br><span>   </span><br><span>     /*Initialisation*/</span><br><span>   /* Load the confidentiality key for SNOW 3G initialization as in section</span><br><span>@@ -399,7 +399,6 @@</span><br><span>       </span><br><span>     /* Run SNOW 3G algorithm to generate sequence of key stream bits KS*/</span><br><span>        snow_3g_initialize(K,IV);</span><br><span style="color: hsl(0, 100%, 40%);">-       KS = (u32 *)ogs_malloc(4*n);</span><br><span>         snow_3g_generate_key_stream(n,(u32*)KS);</span><br><span>     </span><br><span>     /* Exclusive-OR the input data with keystream to generate the output bit</span><br><span>@@ -412,8 +411,6 @@</span><br><span>               data[4*i+3] ^= (u8) (KS[i] ) & 0xff;</span><br><span>     }</span><br><span>    </span><br><span style="color: hsl(0, 100%, 40%);">-        ogs_free(KS);</span><br><span style="color: hsl(0, 100%, 40%);">-   </span><br><span>     /* zero last bits of data in case its length is not byte-aligned </span><br><span>       this is an addition to the C reference code, which did not handle it */</span><br><span>   if (lastbits)</span><br><span>diff --git a/mme/snow-3g.h b/mme/snow-3g.h</span><br><span>index a5320bb..0ba6a84 100644</span><br><span>--- a/mme/snow-3g.h</span><br><span>+++ b/mme/snow-3g.h</span><br><span>@@ -1,7 +1,7 @@</span><br><span> #ifndef __SNOW_3G__</span><br><span> #define __SNOW_3G__</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#include "ogs-core.h"</span><br><span style="color: hsl(120, 100%, 40%);">+#include <stdint.h></span><br><span> </span><br><span> #ifdef __cplusplus</span><br><span> extern "C" {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15201">change 15201</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-ttcn3-hacks/+/15201"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I5604c594934b03d2fd83e1e465fc150fc542a475 </div>
<div style="display:none"> Gerrit-Change-Number: 15201 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>