Skip to content
Newer
Older
100644 29 lines (22 sloc) 660 Bytes
91be2fa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@3259 5dc97367-9…
alobbs authored
1 #!/bin/sh
2
3 set -e
4 gensizes="512 1024 2048 4096"
5
6 gendhparam() {
7 typeset size="$1"
8 typeset outfile="$2"
9
10 openssl dhparam -C -2 "$size" | sed -e '1 i/* openssl dhparam -C -2 '"$size"' */
11 ' -e 's/^DH \*get_dh/static &/' -e '/-----BEGIN DH PARAMETERS-----/ { i/*
12 }' -e '$ {a */
13 }' > "$outfile"
14 }
15
16 usage() {
17 echo "This script must be ran from the contrib dir in cherokee source directory."
18 echo "It will overwrite the files cherokee/cryptor_libssl_dh_{512,1024,2048,4096}.c"
19 exit 1
20 }
21
22 if [ "$(basename $(pwd))" != "contrib" -o ! -d ../cherokee ] ; then
23 usage
24 fi
25
26 for ksize in $gensizes ; do
27 gendhparam "$ksize" "../cherokee/cryptor_libssl_dh_$ksize.c"
28 done
Something went wrong with that request. Please try again.