libosmocore[master]: Add osmo_rand() function

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Holger Freyther gerrit-no-reply at lists.osmocom.org
Wed Apr 26 17:47:44 UTC 2017


Patch Set 2:

> Sure, that's why getrandom has GRND_NONBLOCK flag and return value
 > indicating actual number of random bits returned. The consensus (as
 > I recall it) was to use osmo_rand() for "small" things like tmsi
 > (with fallback to currently used insecure rand()). The "big" things
 > are only necessary for crypto-related primitives which can use smth
 > like gnutls directly. This got to be thoroughly documented of
 > course.

Okay but then at least seed rand with good crypto on start. But by using the kernel for every request you will get to the -EWOULDBLOCK situation a lot earlier. Something that OpenSSL/GNUtls with their KDF are less prone of.  The time for a NONCE to repeat with the KDF is probably also higher (but I am out of my area of expertise here).

>From an engineer point of view. My SIP code got stuck as I used /dev/urandom to generate a unique call id. And everytime I remotely logged in through VSAT I generated enough entropy to make it continue... Just keep it in mind. :)

-- 
To view, visit https://gerrit.osmocom.org/1526
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-HasComments: No



More information about the gerrit-log mailing list