Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2012-10-15 21:21:37 +0400
committerLukas Reschke <lukas@statuscode.ch>2012-10-15 21:23:37 +0400
commit3ca5c71a0bbc330241a9b031c607aa81042fffa5 (patch)
tree1870d872998cd08097fb296cd57028ae7fc7e03b /lib
parent7f06f93e9e4f402d5ed0826149d1effa47ccaa15 (diff)
Use /dev/urandom instead of /dev/random
The usage of /dev/urandom is enough secure
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/util.php b/lib/util.php
index 8db3c307f95..26e8579f6f1 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -475,8 +475,8 @@ class OC_Util {
}
}
- // Try to use /dev/random
- $fp = @file_get_contents('/dev/random', false, null, 0, $length);
+ // Try to use /dev/urandom
+ $fp = @file_get_contents('/dev/urandom', false, null, 0, $length);
if ($fp !== FALSE) {
$string = substr(bin2hex($fp), 0, $length);
return $string;
@@ -509,12 +509,12 @@ class OC_Util {
}
}
- // Check /dev/random
- $fp = @file_get_contents('/dev/random', false, null, 0, 1);
+ // Check /dev/urandom
+ $fp = @file_get_contents('/dev/urandom', false, null, 0, 1);
if ($fp !== FALSE) {
return true;
}
return false;
}
-} \ No newline at end of file
+}