/usr/lib/courier/mkdhparams is in courier-ssl 0.73.1-1.6.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #! /bin/bash
#
# Copyright 2013 Double Precision, Inc. See COPYING for
# distribution information.
#
# Run this script monthly to generate DH parameters.
if test -f /etc/courier/dhparams.pem
then
if test "`find /etc/courier/dhparams.pem -mtime +25 -print `" = ""
then
# Less than 25 days old
exit 0
fi
fi
set -e
cp /dev/null /etc/courier/dhparams.pem.tmp
chmod 600 /etc/courier/dhparams.pem.tmp
chown daemon /etc/courier/dhparams.pem.tmp
BITS="$DH_BITS"
if test "openssl" = "openssl"
then
if test "$BITS" = ""
then
BITS=768
fi
dd if=/dev/urandom of=/etc/courier/dhparams.rand.tmp count=1 2>/dev/null
/usr/bin/openssl dhparam -rand /etc/courier/dhparams.rand.tmp -outform PEM $BITS >/etc/courier/dhparams.pem.tmp
rm -f /etc/courier/dhparams.rand.tmp
mv -f /etc/courier/dhparams.pem.tmp /etc/courier/dhparams.pem
else
if test "$BITS" = ""
then
BITS=high
fi
/usr/local/bin/certtool --generate-dh-params --sec-param $BITS >/etc/courier/dhparams.pem.tmp
mv -f /etc/courier/dhparams.pem.tmp /etc/courier/dhparams.pem
fi
|