Check-in [b128e0d4e4]
Bounty program for improvements to Tcl and certain Tcl packages.
Overview
Comment:Updated gen_dh_params to support specifying a number of bits -- currently the only supported value is 2048
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b128e0d4e4d93a53d4007806f5751b19450faa68
User & Date: rkeene on 2017-04-18 14:39:04
Other Links: manifest | tags
Context
2017-04-18
18:17
Added pre-computed DH params for fallback values for 4096 and 8192 bit sizes, in addition to 2048 check-in: 6286921174 user: rkeene tags: trunk
14:39
Updated gen_dh_params to support specifying a number of bits -- currently the only supported value is 2048 check-in: b128e0d4e4 user: rkeene tags: trunk
14:29
Updated references to DH parameter bit sizes and ensure error messages are printed if generating fails entirely check-in: 83b1dea4d4 user: rkeene tags: trunk
Changes

Modified gen_dh_params from [045a249871] to [7228959737].

     1      1   #! /usr/bin/env sh
     2      2   
     3      3   bits='2048'
            4  +option_fallback='0'
            5  +for arg in "[email protected]"; do
            6  +	case "${arg}" in
            7  +		fallback)
            8  +			option_fallback='1'
            9  +			;;
           10  +		bits=*)
           11  +			bits="`echo "${arg}" | cut -f 2 -d =`"
           12  +			;;
           13  +	esac
           14  +done
     4     15   
     5     16   openssl_dhparam() {
     6     17   	if [ -x "`which openssl 2>/dev/null`" ]; then
     7     18   		o_output="`openssl dhparam -C "[email protected]" 2>/dev/null`" || return 1
     8     19   		o_output="`echo "${o_output}" | sed 's/get_dh[0-9]\+/get_dhParams/'`" || return 1
     9     20   		o_output="`echo "${o_output}" | sed '/^-----BEGIN DH PARAMETERS-----$/,/^-----END DH PARAMETERS-----$/ d;/^#/ d'`" || return 1
    10     21   
................................................................................
    99    110   		return 0
   100    111   	fi
   101    112   
   102    113   	return 1
   103    114   }
   104    115   
   105    116   # Enable support for giving the same DH params each time
   106         -if [ "$1" = 'fallback' ]; then
          117  +if [ "${option_fallback}" = '1' ]; then
   107    118   	gen_dh_params_fallback && exit 0
   108    119   
   109    120   	echo "Unable to generate fallback parameters for DH of ${bits} bits" >&2
   110    121   
   111    122   	exit 1
   112    123   fi
   113    124