summaryrefslogtreecommitdiffstats
path: root/roles/common/files/usr/local/bin/gendhparam.sh
diff options
context:
space:
mode:
Diffstat (limited to 'roles/common/files/usr/local/bin/gendhparam.sh')
-rwxr-xr-xroles/common/files/usr/local/bin/gendhparam.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/roles/common/files/usr/local/bin/gendhparam.sh b/roles/common/files/usr/local/bin/gendhparam.sh
index 074986b..a94175a 100755
--- a/roles/common/files/usr/local/bin/gendhparam.sh
+++ b/roles/common/files/usr/local/bin/gendhparam.sh
@@ -1,13 +1,10 @@
#!/bin/sh
set -ue
PATH=/usr/bin:/bin
-privkey="$1"
+out="$1"
bits="${2:-2048}"
-rand=
-mv -f "$(mktemp)" "$privkey"
-chmod og-rwx "$privkey"
-
-openssl dhparam -rand "${rand:-/dev/urandom}" "$bits" >"$privkey"
+install --mode=0644 /dev/null "$out"
+openssl dhparam -rand /dev/urandom "$bits" >"$out"