Make fast calculation of DH params optional

This commit is contained in:
Bob Mottram 2015-12-02 11:03:20 +00:00
parent 516519ba07
commit 56a5852d8d
1 changed files with 9 additions and 2 deletions

View File

@ -36,16 +36,17 @@ export TEXTDOMAINDIR="/usr/share/locale"
HOSTNAME=
KEYLENGTH=2048
RECALCULATE="no"
FAST=''
function show_help {
echo ''
echo $"${PROJECT_NAME}-dhparam -h [hostname] -l [length in bits] --recalc [yes|no]"
echo $"${PROJECT_NAME}-dhparam -h [hostname] -l [length in bits] --recalc [yes|no] --fast [yes|no]"
echo ''
exit 0
}
function calc_dh {
openssl dhparam -check -text -dsaparam $KEYLENGTH -out ${1}
openssl dhparam -check -text $FAST $KEYLENGTH -out ${1}
if [ ! "$?" = "0" ]; then
exit 3674
fi
@ -85,6 +86,12 @@ case $key in
shift
RECALCULATE=${1}
;;
--fast)
shift
if [[ ${1} == "yes" || ${1} == "y" ]]; then
FAST='-dsaparam'
fi
;;
*)
# unknown option
;;