From ab3d205ef6cb0f3913ad3b5ada70bd8720881805 Mon Sep 17 00:00:00 2001 From: Helmuth Gronewold Date: Tue, 26 Aug 2014 22:16:31 +0200 Subject: [PATCH 1/2] Switch blocksize and count when reading from urandom with dd, to prevent getting fewer bytes for the secret key. --- setup/webmail.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/webmail.sh b/setup/webmail.sh index fbb489f4..37b00b41 100755 --- a/setup/webmail.sh +++ b/setup/webmail.sh @@ -36,7 +36,7 @@ if [ ! -d /usr/local/lib/roundcubemail ]; then fi # Generate a safe 24-character secret key of safe characters. -SECRET_KEY=$(dd if=/dev/random bs=20 count=1 2>/dev/null | base64 | fold -w 24 | head -n 1) +SECRET_KEY=$(dd if=/dev/random bs=1 count=18 2>/dev/null | base64 | fold -w 24 | head -n 1) # Create a configuration file. # From 756ba111a3fa50e4178a817bbdc686c898cb6f3b Mon Sep 17 00:00:00 2001 From: Helmuth Gronewold Date: Tue, 26 Aug 2014 22:22:43 +0200 Subject: [PATCH 2/2] Also swith blocksize and count at the owncloud-specific key generation to ensure get as much bytes as you wanted. --- setup/owncloud.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/owncloud.sh b/setup/owncloud.sh index 7b63034a..1c7aa451 100755 --- a/setup/owncloud.sh +++ b/setup/owncloud.sh @@ -69,7 +69,7 @@ EOF # Create an auto-configuration file to fill in database settings # when the install script is run. Make an administrator account # here or else the install can't finish. - adminpassword=$(dd if=/dev/random bs=40 count=1 2>/dev/null | sha1sum | fold -w 30 | head -n 1) + adminpassword=$(dd if=/dev/random bs=1 count=40 2>/dev/null | sha1sum | fold -w 30 | head -n 1) cat - > /usr/local/lib/owncloud/config/autoconfig.php <