Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 28 lines (22 sloc) 0.66 kb
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
#!/bin/sh

set -e
gensizes="512 1024 2048 4096"

gendhparam() {
typeset size="$1"
typeset outfile="$2"

openssl dhparam -C -2 "$size" | sed -e '1 i/* openssl dhparam -C -2 '"$size"' */
' -e 's/^DH \*get_dh/static &/' -e '/-----BEGIN DH PARAMETERS-----/ { i/*
}' -e '$ {a */
}' > "$outfile"
}

usage() {
echo "This script must be ran from the contrib dir in cherokee source directory."
echo "It will overwrite the files cherokee/cryptor_libssl_dh_{512,1024,2048,4096}.c"
exit 1
}

if [ "$(basename $(pwd))" != "contrib" -o ! -d ../cherokee ] ; then
usage
fi

for ksize in $gensizes ; do
gendhparam "$ksize" "../cherokee/cryptor_libssl_dh_$ksize.c"
done
Something went wrong with that request. Please try again.