Differences From Artifact [78d63b562d]:
- Executable file gen_dh_params — part of check-in [a7c535ae28] at 2016-12-13 05:16:36 on branch trunk — Updated to indicate that this will take a while on stderr -- otherwise it just gets redirected to the file (user: rkeene, size: 3115) [annotate] [blame] [check-ins using] [more...]
To Artifact [045a249871]:
- Executable file gen_dh_params — part of check-in [83b1dea4d4] at 2017-04-18 14:29:27 on branch trunk — Updated references to DH parameter bit sizes and ensure error messages are printed if generating fails entirely (user: rkeene, size: 3402) [annotate] [blame] [check-ins using]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | + | #! /usr/bin/env sh bits='2048' openssl_dhparam() { if [ -x "`which openssl 2>/dev/null`" ]; then o_output="`openssl dhparam -C "$@" 2>/dev/null`" || return 1 o_output="`echo "${o_output}" | sed 's/get_dh[0-9]\+/get_dhParams/'`" || return 1 o_output="`echo "${o_output}" | sed '/^-----BEGIN DH PARAMETERS-----$/,/^-----END DH PARAMETERS-----$/ d;/^#/ d'`" || return 1 echo "${o_output}" return 0 fi |
︙ | |||
32 33 34 35 36 37 38 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | + - - + + | return 0 fi return 1 } gen_dh_params_fallback() { if [ "${bits}" = '2048' ]; then |
︙ | |||
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | + + + + + + + + + | BN_free(dhg_bn); return(NULL); } return(dh); } _EOF_ return 0 fi return 1 } # Enable support for giving the same DH params each time if [ "$1" = 'fallback' ]; then gen_dh_params_fallback && exit 0 echo "Unable to generate fallback parameters for DH of ${bits} bits" >&2 exit 1 fi echo "*****************************" >&2 echo "** Generating DH Primes. **" >&2 echo "** This will take a while. **" >&2 echo "*****************************" >&2 gen_dh_params_openssl && exit 0 gen_dh_params_remote && exit 0 gen_dh_params_fallback && exit 0 echo "Unable to generate parameters for DH of ${bits} bits" >&2 exit 1 |