[vlc-devel] OpenBSD RNG Fix

Joris van Rooij jorrizza at jrrzz.net
Tue May 12 19:43:14 CEST 2009


Rémi Denis-Courmont writes:

>> The attached diff fixes the wrongful assumption that /dev/random is always
>> available on OpenBSD. This caused VLC to drain system resources in an
>> infinite loop, tripping over an EIO (read() wasn't checked) and trying
>> again.
>>
>> It's a quick fix, so feel free to conjure up a nicer looking solution.
> 
> You might as well remove the OpenBSD specifics then...

Well, no. On OpenBSD urandom is only a fallback mechanism in case random 
(e.g. hardware RNG) is not available, and is considered less secure. On 
FreeBSD random and urandom are the same. Hardware support is governed by 
FreeBSD's kernel. On Linux urandom is preferred unless you're generating 
some long term encryption key, which is obviously not the case here. I 
haven't been able to check NetBSD, since my NetBSD box died on me yesterday. 
But according to their rnd(4) it's quite similar to Linux's implementation.

So in short OpenBSD is the only case in which random is (sometimes) 
preferred over urandom.

Greetings,
Joris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090512/08d952ec/attachment.sig>


More information about the vlc-devel mailing list