From 64e8603cf9790aa4419d0f2746671bd242e6344d Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 26 May 2015 00:55:19 +0200 Subject: logjam mitigation. --- roles/common/files/usr/local/bin/gendhparam.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 roles/common/files/usr/local/bin/gendhparam.sh (limited to 'roles/common/files/usr/local/bin/gendhparam.sh') diff --git a/roles/common/files/usr/local/bin/gendhparam.sh b/roles/common/files/usr/local/bin/gendhparam.sh new file mode 100755 index 0000000..074986b --- /dev/null +++ b/roles/common/files/usr/local/bin/gendhparam.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +set -ue +PATH=/usr/bin:/bin + +privkey="$1" +bits="${2:-2048}" +rand= + +mv -f "$(mktemp)" "$privkey" +chmod og-rwx "$privkey" + +openssl dhparam -rand "${rand:-/dev/urandom}" "$bits" >"$privkey" -- cgit v1.2.3