Merge pull request #128 from shaungrady/randomize-dh-download

Randomize DH params fetched from 2ton.com.au
This commit is contained in:
redfast00 2016-10-21 08:02:38 +02:00 committed by GitHub
commit 483d88f1e1

View file

@ -746,7 +746,8 @@ confOpenVPN() {
if ([ "$ENCRYPT" -ge "4096" ] && whiptail --backtitle "Setup OpenVPN" --title "Diffie-Hellman Parameters" --defaultno --yesno "Generating Diffie-Hellman parameters for a $ENCRYPT-bits key might take a long time on a Raspberry Pi. Do you want to download them? (If you're paranoid, choose 'No')" $r $c)
then
# Downloading parameters, $KEY_DIR and $KEY_SIZE get set by sourcing ./vars
${SUDOE} curl "https://2ton.com.au/dhparam/${ENCRYPT}" -o "${KEY_DIR}/dh${KEY_SIZE}.pem"
RANDOM_INDEX=$(( RANDOM % 128 ))
${SUDOE} curl "https://2ton.com.au/dhparam/${ENCRYPT}/${RANDOM_INDEX}" -o "${KEY_DIR}/dh${KEY_SIZE}.pem"
else
# Generate Diffie-Hellman key exchange
${SUDOE} ./build-dh