From 801cd7acc62460a55389f0093558c32c967854d9 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 29 Mar 2018 23:16:43 +0200 Subject: Migrate from OpenSSL to osmo_get_rand_id() Drop OpenSSL/libcrypto dependency, use osmo_get_rand_id() instead. Backport osmo-msc 753c15de2f00e24f76ac9b01a20e1e2ff0f86ce2 = I71cd631704a4dc155c6c752fee2a42cd6e2fa336 " Migrate from OpenSSL to osmo_get_rand_id() This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. " Apply similar changes in bsc-nat, mm_auth_test etc. Tested manually with osmo-nitb and sysmoBTS, and verified that Authentication Requests send heterogenous RAND tokens. Related: OS#1694 Change-Id: I81ebd55c7c90a436c5f2090e6790d78b773d2c92 --- openbsc/src/osmo-bsc_nat/bsc_nat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat.c') diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index daa066d05..f83abe130 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -74,8 +74,6 @@ #include -#include - #include "../../bscconfig.h" #define SCCP_CLOSE_TIME 20 @@ -221,7 +219,7 @@ static void send_id_req(struct bsc_nat *nat, struct bsc_connection *bsc) buf = v_put(buf, 0x23); mrand = bsc->last_rand; - if (RAND_bytes(mrand, 16) != 1) + if (osmo_get_rand_id(mrand, 16) < 0) goto failed_random; memcpy(buf, mrand, 16); @@ -232,7 +230,7 @@ static void send_id_req(struct bsc_nat *nat, struct bsc_connection *bsc) failed_random: /* the timeout will trigger and close this connection */ - LOGP(DNAT, LOGL_ERROR, "Failed to read from urandom.\n"); + LOGP(DNAT, LOGL_ERROR, "osmo_get_rand_id() failed.\n"); return; } -- cgit v1.2.3