Skip to content
Snippets Groups Projects
Commit 56a5852d authored by Bob Mottram's avatar Bob Mottram
Browse files

Make fast calculation of DH params optional

parent 516519ba
No related branches found
No related tags found
No related merge requests found
......@@ -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
;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment