blob: 88b6519fda05135c408868c2db8e0205b36ca0d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
#! @SHELL@
#
# Copyright 2013-2014 Double Precision, Inc. See COPYING for
# distribution information.
#
# Run this script monthly to generate DH parameters.
# Override from the environment
if test "@ssllib@" = "openssl"
then
LIBRESSL=0
@OPENSSL@ version | grep LibreSSL 1>/dev/null
if test $? = 0
then
LIBRESSL=1
fi
fi
if test "$TLS_DHPARAMS" = ""
then
TLS_DHPARAMS="@certsdir@/dhparams.pem"
fi
if test -f $TLS_DHPARAMS
then
if test "`find $TLS_DHPARAMS -mtime +25 -print `" = ""
then
# Less than 25 days old
exit 0
fi
fi
set -e
umask 077
cp /dev/null $TLS_DHPARAMS.tmp
umask 022
chown @mailuser@ $TLS_DHPARAMS.tmp
BITS="$DH_BITS"
if test "@ssllib@" = "openssl"
then
if test "$BITS" = ""
then
BITS=2048
fi
if test "$LIBRESSL" = 0
then
dd if=@RANDOMV@ of=$TLS_DHPARAMS.rand.tmp count=1 2>/dev/null
@OPENSSL@ dhparam -rand $TLS_DHPARAMS.rand.tmp -outform PEM $BITS >$TLS_DHPARAMS.tmp
rm -f $TLS_DHPARAMS.rand.tmp
else
@OPENSSL@ dhparam -outform PEM $BITS >$TLS_DHPARAMS.tmp
fi
mv -f $TLS_DHPARAMS.tmp $TLS_DHPARAMS
else
if test "$BITS" = ""
then
BITS=high
fi
@CERTTOOL@ --generate-dh-params --sec-param $BITS >$TLS_DHPARAMS.tmp
mv -f $TLS_DHPARAMS.tmp $TLS_DHPARAMS
fi
|