summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-05-22 17:34:56 +0200
committerGuilhem Moulin <guilhem@fripost.org>2016-05-22 17:53:59 +0200
commit0ee5bf050a9a673d61485426ce62c8efcbb7bcc6 (patch)
tree44ed4d91860ffca9e70e260a2aecd96687ad1a25 /roles
parent8cf4032ecec5b9f58d829e89f231179170432539 (diff)
genkeypair, gendhparam: use -rand /dev/urandom when generating keys or DH parameters.
Diffstat (limited to 'roles')
-rwxr-xr-xroles/common/files/usr/local/bin/gendhparam.sh2
-rwxr-xr-xroles/common/files/usr/local/bin/genkeypair.sh3
2 files changed, 2 insertions, 3 deletions
diff --git a/roles/common/files/usr/local/bin/gendhparam.sh b/roles/common/files/usr/local/bin/gendhparam.sh
index a82a8a5..a94175a 100755
--- a/roles/common/files/usr/local/bin/gendhparam.sh
+++ b/roles/common/files/usr/local/bin/gendhparam.sh
@@ -7,4 +7,4 @@ out="$1"
bits="${2:-2048}"
install --mode=0644 /dev/null "$out"
-openssl dhparam "$bits" >"$out"
+openssl dhparam -rand /dev/urandom "$bits" >"$out"
diff --git a/roles/common/files/usr/local/bin/genkeypair.sh b/roles/common/files/usr/local/bin/genkeypair.sh
index 53cc050..45e2181 100755
--- a/roles/common/files/usr/local/bin/genkeypair.sh
+++ b/roles/common/files/usr/local/bin/genkeypair.sh
@@ -38,7 +38,6 @@ usage=
mode=
owner=
group=
-rand=
usage() {
cat >&2 <<- EOF
@@ -185,7 +184,7 @@ if [ -s "$privkey" -a $force -eq 0 ]; then
exit 1
elif [ ! -s "$privkey" -o $force -ge 2 ]; then
install --mode="${mode:-0600}" ${owner:+--owner="$owner"} ${group:+--group="$group"} /dev/null "$privkey" || exit 2
- openssl $genkey -rand "${rand:-/dev/urandom}" $genkeyargs >"$privkey" || exit 2
+ openssl $genkey -rand /dev/urandom $genkeyargs >"$privkey" || exit 2
[ "$cmd" = dkim ] && { dkiminfo; exit; }
fi