]> Cypherpunks.ru repositories - govpn.git/commitdiff
Use /dev/urandom for new client identity generation
authorSergey Matveev <stargrave@stargrave.org>
Wed, 13 May 2015 14:00:55 +0000 (17:00 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 13 May 2015 14:00:55 +0000 (17:00 +0300)
* FreeBSD has /dev/random and it never blocks, giving as much entropy as requested
* GNU/Linux has /dev/random can give shorter output
* /dev/urandom exists in both systems and never blocks

Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
utils/newclient.sh

index ab86a7fdb23dde0009948ccba3190ad063387927..e741130957a6f30d6c8956988bcd3c3b58e2f940 100755 (executable)
@@ -3,7 +3,7 @@
 getrand()
 {
     local size=$1
-    dd if=/dev/random bs=$size count=1 2>/dev/null | hexdump -ve '"%02x"'
+    dd if=/dev/urandom bs=$size count=1 2>/dev/null | hexdump -ve '"%02x"'
 }
 
 [ -n "$1" ] || {