aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libmsc')
-rw-r--r--openbsc/src/libmsc/Makefile.am1
-rw-r--r--openbsc/src/libmsc/auth.c8
-rw-r--r--openbsc/src/libmsc/db.c12
3 files changed, 10 insertions, 11 deletions
diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am
index c219a35d9..f746f82f5 100644
--- a/openbsc/src/libmsc/Makefile.am
+++ b/openbsc/src/libmsc/Makefile.am
@@ -10,7 +10,6 @@ AM_CFLAGS = \
$(LIBOSMOVTY_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
$(COVERAGE_CFLAGS) \
- $(LIBCRYPTO_CFLAGS) \
$(LIBSMPP34_CFLAGS) \
$(NULL)
diff --git a/openbsc/src/libmsc/auth.c b/openbsc/src/libmsc/auth.c
index 8c8af11c6..85477a34c 100644
--- a/openbsc/src/libmsc/auth.c
+++ b/openbsc/src/libmsc/auth.c
@@ -29,8 +29,6 @@
#include <osmocom/gsm/comp128.h>
#include <osmocom/core/utils.h>
-#include <openssl/rand.h>
-
#include <stdlib.h>
const struct value_string auth_action_names[] = {
@@ -141,8 +139,10 @@ int auth_get_tuple_for_subscr(struct gsm_auth_tuple *atuple,
}
atuple->use_count = 1;
- if (RAND_bytes(atuple->vec.rand, sizeof(atuple->vec.rand)) != 1) {
- LOGP(DMM, LOGL_NOTICE, "RAND_bytes failed, can't generate new auth tuple\n");
+ rc = osmo_get_rand_id(atuple->vec.rand, sizeof(atuple->vec.rand));
+ if (rc < 0) {
+ LOGP(DMM, LOGL_NOTICE, "osmo_get_rand_id failed, can't generate new auth tuple: %s\n",
+ strerror(-rc));
return AUTH_ERROR;
}
diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index 15e7fd4d1..0b61b4f07 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -41,8 +41,6 @@
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/utils.h>
-#include <openssl/rand.h>
-
/* Semi-Private-Interface (SPI) for the subscriber code */
void subscr_direct_free(struct gsm_subscriber *subscr);
@@ -1378,8 +1376,9 @@ int db_subscriber_alloc_tmsi(struct gsm_subscriber *subscriber)
char *tmsi_quoted;
for (;;) {
- if (RAND_bytes((uint8_t *) &subscriber->tmsi, sizeof(subscriber->tmsi)) != 1) {
- LOGP(DDB, LOGL_ERROR, "RAND_bytes failed\n");
+ int rc = osmo_get_rand_id((uint8_t *) &subscriber->tmsi, sizeof(subscriber->tmsi));
+ if (rc < 0) {
+ LOGP(DDB, LOGL_ERROR, "osmo_get_rand_id() failed: %s\n", strerror(-rc));
return 1;
}
if (subscriber->tmsi == GSM_RESERVED_TMSI)
@@ -1458,8 +1457,9 @@ int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, uint32_t *token
uint32_t try;
for (;;) {
- if (RAND_bytes((uint8_t *) &try, sizeof(try)) != 1) {
- LOGP(DDB, LOGL_ERROR, "RAND_bytes failed\n");
+ int rc = osmo_get_rand_id((uint8_t *) &try, sizeof(try));
+ if (rc < 0) {
+ LOGP(DDB, LOGL_ERROR, "osmo_get_rand_id() failed: %s\n", strerror(-rc));
return 1;
}
if (!try) /* 0 is an invalid token */