0000: 23 21 20 2f 75 73 72 2f 62 69 6e 2f 65 6e 76 20 #! /usr/bin/env
0010: 73 68 0a 0a 62 69 74 73 3d 27 32 30 34 38 27 0a sh..bits='2048'.
0020: 0a 6f 70 65 6e 73 73 6c 5f 64 68 70 61 72 61 6d .openssl_dhparam
0030: 28 29 20 7b 0a 09 69 66 20 5b 20 2d 78 20 22 60 () {..if [ -x "`
0040: 77 68 69 63 68 20 6f 70 65 6e 73 73 6c 20 32 3e which openssl 2>
0050: 2f 64 65 76 2f 6e 75 6c 6c 60 22 20 5d 3b 20 74 /dev/null`" ]; t
0060: 68 65 6e 0a 09 09 6f 5f 6f 75 74 70 75 74 3d 22 hen...o_output="
0070: 60 6f 70 65 6e 73 73 6c 20 64 68 70 61 72 61 6d `openssl dhparam
0080: 20 2d 43 20 22 24 40 22 20 32 3e 2f 64 65 76 2f -C "$@" 2>/dev/
0090: 6e 75 6c 6c 60 22 20 7c 7c 20 72 65 74 75 72 6e null`" || return
00a0: 20 31 0a 09 09 6f 5f 6f 75 74 70 75 74 3d 22 60 1...o_output="`
00b0: 65 63 68 6f 20 22 24 7b 6f 5f 6f 75 74 70 75 74 echo "${o_output
00c0: 7d 22 20 7c 20 73 65 64 20 27 73 2f 67 65 74 5f }" | sed 's/get_
00d0: 64 68 5b 30 2d 39 5d 5c 2b 2f 67 65 74 5f 64 68 dh[0-9]\+/get_dh
00e0: 50 61 72 61 6d 73 2f 27 60 22 20 7c 7c 20 72 65 Params/'`" || re
00f0: 74 75 72 6e 20 31 0a 09 09 6f 5f 6f 75 74 70 75 turn 1...o_outpu
0100: 74 3d 22 60 65 63 68 6f 20 22 24 7b 6f 5f 6f 75 t="`echo "${o_ou
0110: 74 70 75 74 7d 22 20 7c 20 73 65 64 20 27 2f 5e tput}" | sed '/^
0120: 2d 2d 2d 2d 2d 42 45 47 49 4e 20 44 48 20 50 41 -----BEGIN DH PA
0130: 52 41 4d 45 54 45 52 53 2d 2d 2d 2d 2d 24 2f 2c RAMETERS-----$/,
0140: 2f 5e 2d 2d 2d 2d 2d 45 4e 44 20 44 48 20 50 41 /^-----END DH PA
0150: 52 41 4d 45 54 45 52 53 2d 2d 2d 2d 2d 24 2f 20 RAMETERS-----$/
0160: 64 3b 2f 5e 23 2f 20 64 27 60 22 20 7c 7c 20 72 d;/^#/ d'`" || r
0170: 65 74 75 72 6e 20 31 0a 0a 09 09 65 63 68 6f 20 eturn 1....echo
0180: 22 24 7b 6f 5f 6f 75 74 70 75 74 7d 22 0a 0a 09 "${o_output}"...
0190: 09 72 65 74 75 72 6e 20 30 0a 09 66 69 0a 0a 09 .return 0..fi...
01a0: 72 65 74 75 72 6e 20 31 0a 7d 0a 0a 67 65 6e 5f return 1.}..gen_
01b0: 64 68 5f 70 61 72 61 6d 73 5f 6f 70 65 6e 73 73 dh_params_openss
01c0: 6c 28 29 20 7b 0a 09 6f 70 65 6e 73 73 6c 5f 64 l() {..openssl_d
01d0: 68 70 61 72 61 6d 20 22 24 7b 62 69 74 73 7d 22 hparam "${bits}"
01e0: 20 3c 20 2f 64 65 76 2f 6e 75 6c 6c 20 7c 7c 20 < /dev/null ||
01f0: 72 65 74 75 72 6e 20 31 0a 09 72 65 74 75 72 6e return 1..return
0200: 20 30 0a 7d 0a 0a 67 65 6e 5f 64 68 5f 70 61 72 0.}..gen_dh_par
0210: 61 6d 73 5f 72 65 6d 6f 74 65 28 29 20 7b 0a 09 ams_remote() {..
0220: 75 72 6c 3d 22 68 74 74 70 73 3a 2f 2f 32 74 6f url="https://2to
0230: 6e 2e 63 6f 6d 2e 61 75 2f 64 68 70 61 72 61 6d n.com.au/dhparam
0240: 2f 24 7b 62 69 74 73 7d 22 0a 0a 09 72 5f 69 6e /${bits}"...r_in
0250: 70 75 74 3d 22 60 63 75 72 6c 20 2d 73 53 20 22 put="`curl -sS "
0260: 24 7b 75 72 6c 7d 22 60 22 20 7c 7c 20 5c 0a 09 ${url}"`" || \..
0270: 09 72 5f 69 6e 70 75 74 3d 22 60 77 67 65 74 20 .r_input="`wget
0280: 2d 4f 20 2d 20 2d 6f 20 2f 64 65 76 2f 6e 75 6c -O - -o /dev/nul
0290: 6c 20 22 24 7b 75 72 6c 7d 22 60 22 20 7c 7c 20 l "${url}"`" ||
02a0: 72 65 74 75 72 6e 20 31 0a 0a 09 69 66 20 72 5f return 1...if r_
02b0: 6f 75 74 70 75 74 3d 22 60 65 63 68 6f 20 22 24 output="`echo "$
02c0: 7b 72 5f 69 6e 70 75 74 7d 22 20 7c 20 6f 70 65 {r_input}" | ope
02d0: 6e 73 73 6c 5f 64 68 70 61 72 61 6d 60 22 3b 20 nssl_dhparam`";
02e0: 74 68 65 6e 0a 09 09 65 63 68 6f 20 22 24 7b 72 then...echo "${r
02f0: 5f 6f 75 74 70 75 74 7d 22 0a 0a 09 09 72 65 74 _output}"....ret
0300: 75 72 6e 20 30 0a 09 66 69 0a 0a 09 72 65 74 75 urn 0..fi...retu
0310: 72 6e 20 31 0a 7d 0a 0a 67 65 6e 5f 64 68 5f 70 rn 1.}..gen_dh_p
0320: 61 72 61 6d 73 5f 66 61 6c 6c 62 61 63 6b 28 29 arams_fallback()
0330: 20 7b 0a 09 69 66 20 5b 20 22 24 7b 62 69 74 73 {..if [ "${bits
0340: 7d 22 20 3d 20 27 32 30 34 38 27 20 5d 3b 20 74 }" = '2048' ]; t
0350: 68 65 6e 0a 09 09 63 61 74 20 3c 3c 20 5c 5f 45 hen...cat << \_E
0360: 4f 46 5f 0a 44 48 20 2a 67 65 74 5f 64 68 50 61 OF_.DH *get_dhPa
0370: 72 61 6d 73 28 76 6f 69 64 29 20 7b 0a 09 73 74 rams(void) {..st
0380: 61 74 69 63 20 75 6e 73 69 67 6e 65 64 20 63 68 atic unsigned ch
0390: 61 72 20 64 68 70 5f 32 30 34 38 5b 5d 20 3d 20 ar dhp_2048[] =
03a0: 7b 0a 09 09 30 78 43 31 2c 30 78 35 31 2c 30 78 {...0xC1,0x51,0x
03b0: 35 38 2c 30 78 36 39 2c 30 78 46 42 2c 30 78 45 58,0x69,0xFB,0xE
03c0: 38 2c 30 78 36 43 2c 30 78 34 37 2c 30 78 32 42 8,0x6C,0x47,0x2B
03d0: 2c 30 78 38 36 2c 30 78 36 31 2c 30 78 34 46 2c ,0x86,0x61,0x4F,
03e0: 0a 09 09 30 78 32 30 2c 30 78 32 45 2c 30 78 44 ...0x20,0x2E,0xD
03f0: 33 2c 30 78 46 43 2c 30 78 31 39 2c 30 78 45 45 3,0xFC,0x19,0xEE
0400: 2c 30 78 42 38 2c 30 78 46 33 2c 30 78 33 35 2c ,0xB8,0xF3,0x35,
0410: 30 78 37 44 2c 30 78 42 41 2c 30 78 38 36 2c 0a 0x7D,0xBA,0x86,.
0420: 09 09 30 78 32 41 2c 30 78 43 33 2c 30 78 43 38 ..0x2A,0xC3,0xC8
0430: 2c 30 78 36 45 2c 30 78 46 34 2c 30 78 39 39 2c ,0x6E,0xF4,0x99,
0440: 30 78 37 35 2c 30 78 36 35 2c 30 78 44 33 2c 30 0x75,0x65,0xD3,0
0450: 78 37 41 2c 30 78 39 45 2c 30 78 44 46 2c 0a 09 x7A,0x9E,0xDF,..
0460: 09 30 78 44 34 2c 30 78 31 46 2c 30 78 38 38 2c .0xD4,0x1F,0x88,
0470: 30 78 45 33 2c 30 78 31 37 2c 30 78 46 43 2c 30 0xE3,0x17,0xFC,0
0480: 78 41 31 2c 30 78 45 44 2c 30 78 41 32 2c 30 78 xA1,0xED,0xA2,0x
0490: 42 36 2c 30 78 37 37 2c 30 78 38 34 2c 0a 09 09 B6,0x77,0x84,...
04a0: 30 78 41 41 2c 30 78 30 38 2c 30 78 46 32 2c 30 0xAA,0x08,0xF2,0
04b0: 78 39 37 2c 30 78 35 39 2c 30 78 37 41 2c 30 78 x97,0x59,0x7A,0x
04c0: 41 30 2c 30 78 30 33 2c 30 78 30 44 2c 30 78 33 A0,0x03,0x0D,0x3
04d0: 45 2c 30 78 37 45 2c 30 78 36 44 2c 0a 09 09 30 E,0x7E,0x6D,...0
04e0: 78 36 35 2c 30 78 36 41 2c 30 78 41 34 2c 30 78 x65,0x6A,0xA4,0x
04f0: 45 41 2c 30 78 35 34 2c 30 78 41 39 2c 30 78 35 EA,0x54,0xA9,0x5
0500: 32 2c 30 78 35 46 2c 30 78 36 33 2c 30 78 42 34 2,0x5F,0x63,0xB4
0510: 2c 30 78 42 43 2c 30 78 39 38 2c 0a 09 09 30 78 ,0xBC,0x98,...0x
0520: 34 45 2c 30 78 46 36 2c 30 78 45 31 2c 30 78 41 4E,0xF6,0xE1,0xA
0530: 34 2c 30 78 45 45 2c 30 78 31 36 2c 30 78 30 41 4,0xEE,0x16,0x0A
0540: 2c 30 78 42 30 2c 30 78 30 31 2c 30 78 42 44 2c ,0xB0,0x01,0xBD,
0550: 30 78 39 46 2c 30 78 41 31 2c 0a 09 09 30 78 45 0x9F,0xA1,...0xE
0560: 38 2c 30 78 32 33 2c 30 78 32 39 2c 30 78 35 36 8,0x23,0x29,0x56
0570: 2c 30 78 34 30 2c 30 78 39 35 2c 30 78 31 33 2c ,0x40,0x95,0x13,
0580: 30 78 45 42 2c 30 78 43 42 2c 30 78 44 35 2c 30 0xEB,0xCB,0xD5,0
0590: 78 46 43 2c 30 78 37 36 2c 0a 09 09 30 78 31 41 xFC,0x76,...0x1A
05a0: 2c 30 78 34 31 2c 30 78 32 36 2c 30 78 43 45 2c ,0x41,0x26,0xCE,
05b0: 30 78 32 30 2c 30 78 45 42 2c 30 78 33 30 2c 30 0x20,0xEB,0x30,0
05c0: 78 31 30 2c 30 78 31 37 2c 30 78 30 37 2c 30 78 x10,0x17,0x07,0x
05d0: 45 31 2c 30 78 38 43 2c 0a 09 09 30 78 41 43 2c E1,0x8C,...0xAC,
05e0: 30 78 35 37 2c 30 78 33 37 2c 30 78 38 42 2c 30 0x57,0x37,0x8B,0
05f0: 78 45 38 2c 30 78 30 31 2c 30 78 44 45 2c 30 78 xE8,0x01,0xDE,0x
0600: 41 39 2c 30 78 45 46 2c 30 78 41 34 2c 30 78 43 A9,0xEF,0xA4,0xC
0610: 32 2c 30 78 41 34 2c 0a 09 09 30 78 36 45 2c 30 2,0xA4,...0x6E,0
0620: 78 34 38 2c 30 78 32 35 2c 30 78 31 31 2c 30 78 x48,0x25,0x11,0x
0630: 33 33 2c 30 78 31 31 2c 30 78 44 34 2c 30 78 35 33,0x11,0xD4,0x5
0640: 32 2c 30 78 37 39 2c 30 78 38 37 2c 30 78 39 46 2,0x79,0x87,0x9F
0650: 2c 30 78 37 35 2c 0a 09 09 30 78 36 31 2c 30 78 ,0x75,...0x61,0x
0660: 46 37 2c 30 78 39 43 2c 30 78 37 44 2c 30 78 33 F7,0x9C,0x7D,0x3
0670: 36 2c 30 78 34 31 2c 30 78 43 42 2c 30 78 45 43 6,0x41,0xCB,0xEC
0680: 2c 30 78 38 46 2c 30 78 45 41 2c 30 78 34 41 2c ,0x8F,0xEA,0x4A,
0690: 30 78 34 37 2c 0a 09 09 30 78 36 41 2c 30 78 33 0x47,...0x6A,0x3
06a0: 36 2c 30 78 33 37 2c 30 78 37 35 2c 30 78 42 39 6,0x37,0x75,0xB9
06b0: 2c 30 78 38 45 2c 30 78 46 35 2c 30 78 35 46 2c ,0x8E,0xF5,0x5F,
06c0: 30 78 36 37 2c 30 78 43 46 2c 30 78 31 46 2c 30 0x67,0xCF,0x1F,0
06d0: 78 44 38 2c 0a 09 09 30 78 43 41 2c 30 78 37 30 xD8,...0xCA,0x70
06e0: 2c 30 78 34 32 2c 30 78 43 37 2c 30 78 41 32 2c ,0x42,0xC7,0xA2,
06f0: 30 78 45 44 2c 30 78 30 46 2c 30 78 37 44 2c 30 0xED,0x0F,0x7D,0
0700: 78 42 45 2c 30 78 34 33 2c 30 78 30 38 2c 30 78 xBE,0x43,0x08,0x
0710: 32 38 2c 0a 09 09 30 78 36 36 2c 30 78 33 44 2c 28,...0x66,0x3D,
0720: 30 78 44 44 2c 30 78 38 37 2c 30 78 30 44 2c 30 0xDD,0x87,0x0D,0
0730: 78 36 31 2c 30 78 36 45 2c 30 78 44 30 2c 30 78 x61,0x6E,0xD0,0x
0740: 45 37 2c 30 78 34 39 2c 30 78 44 31 2c 30 78 37 E7,0x49,0xD1,0x7
0750: 30 2c 0a 09 09 30 78 41 39 2c 30 78 34 44 2c 30 0,...0xA9,0x4D,0
0760: 78 44 35 2c 30 78 46 44 2c 30 78 45 44 2c 30 78 xD5,0xFD,0xED,0x
0770: 46 32 2c 30 78 36 44 2c 30 78 33 32 2c 30 78 31 F2,0x6D,0x32,0x1
0780: 37 2c 30 78 39 37 2c 30 78 35 42 2c 30 78 30 36 7,0x97,0x5B,0x06
0790: 2c 0a 09 09 30 78 36 30 2c 30 78 39 43 2c 30 78 ,...0x60,0x9C,0x
07a0: 35 46 2c 30 78 41 33 2c 30 78 35 44 2c 30 78 33 5F,0xA3,0x5D,0x3
07b0: 34 2c 30 78 31 34 2c 30 78 37 45 2c 30 78 36 33 4,0x14,0x7E,0x63
07c0: 2c 30 78 35 34 2c 30 78 45 34 2c 30 78 37 45 2c ,0x54,0xE4,0x7E,
07d0: 0a 09 09 30 78 30 39 2c 30 78 38 46 2c 30 78 42 ...0x09,0x8F,0xB
07e0: 42 2c 30 78 38 45 2c 30 78 41 30 2c 30 78 44 30 B,0x8E,0xA0,0xD0
07f0: 2c 30 78 39 36 2c 30 78 41 43 2c 30 78 33 30 2c ,0x96,0xAC,0x30,
0800: 30 78 32 30 2c 30 78 33 39 2c 30 78 33 42 2c 0a 0x20,0x39,0x3B,.
0810: 09 09 30 78 38 43 2c 30 78 39 32 2c 30 78 36 35 ..0x8C,0x92,0x65
0820: 2c 30 78 33 37 2c 30 78 30 41 2c 30 78 38 46 2c ,0x37,0x0A,0x8F,
0830: 30 78 45 43 2c 30 78 37 32 2c 30 78 38 42 2c 30 0xEC,0x72,0x8B,0
0840: 78 36 31 2c 30 78 37 44 2c 30 78 36 32 2c 0a 09 x61,0x7D,0x62,..
0850: 09 30 78 32 34 2c 30 78 35 34 2c 30 78 45 39 2c .0x24,0x54,0xE9,
0860: 30 78 31 44 2c 30 78 30 31 2c 30 78 36 38 2c 30 0x1D,0x01,0x68,0
0870: 78 38 39 2c 30 78 43 34 2c 30 78 37 42 2c 30 78 x89,0xC4,0x7B,0x
0880: 33 43 2c 30 78 34 38 2c 30 78 36 32 2c 0a 09 09 3C,0x48,0x62,...
0890: 30 78 39 42 2c 30 78 38 33 2c 30 78 31 31 2c 30 0x9B,0x83,0x11,0
08a0: 78 33 41 2c 30 78 30 42 2c 30 78 30 44 2c 30 78 x3A,0x0B,0x0D,0x
08b0: 45 46 2c 30 78 35 41 2c 30 78 45 34 2c 30 78 37 EF,0x5A,0xE4,0x7
08c0: 41 2c 30 78 41 30 2c 30 78 36 39 2c 0a 09 09 30 A,0xA0,0x69,...0
08d0: 78 46 34 2c 30 78 35 34 2c 30 78 42 35 2c 30 78 xF4,0x54,0xB5,0x
08e0: 35 42 2c 0a 09 7d 3b 0a 09 73 74 61 74 69 63 20 5B,..};..static
08f0: 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 64 68 unsigned char dh
0900: 67 5f 32 30 34 38 5b 5d 20 3d 20 7b 0a 09 09 30 g_2048[] = {...0
0910: 78 30 32 2c 0a 09 7d 3b 0a 0a 09 44 48 20 2a 64 x02,..};...DH *d
0920: 68 20 3d 20 44 48 5f 6e 65 77 28 29 3b 3b 0a 09 h = DH_new();;..
0930: 42 49 47 4e 55 4d 20 2a 64 68 70 5f 62 6e 2c 20 BIGNUM *dhp_bn,
0940: 2a 64 68 67 5f 62 6e 3b 0a 0a 09 69 66 20 28 64 *dhg_bn;...if (d
0950: 68 20 3d 3d 20 4e 55 4c 4c 29 20 7b 0a 09 09 72 h == NULL) {...r
0960: 65 74 75 72 6e 20 4e 55 4c 4c 3b 0a 09 7d 0a 0a eturn NULL;..}..
0970: 09 64 68 70 5f 62 6e 20 3d 20 42 4e 5f 62 69 6e .dhp_bn = BN_bin
0980: 32 62 6e 28 64 68 70 5f 32 30 34 38 2c 20 73 69 2bn(dhp_2048, si
0990: 7a 65 6f 66 20 28 64 68 70 5f 32 30 34 38 29 2c zeof (dhp_2048),
09a0: 20 4e 55 4c 4c 29 3b 0a 09 64 68 67 5f 62 6e 20 NULL);..dhg_bn
09b0: 3d 20 42 4e 5f 62 69 6e 32 62 6e 28 64 68 67 5f = BN_bin2bn(dhg_
09c0: 32 30 34 38 2c 20 73 69 7a 65 6f 66 20 28 64 68 2048, sizeof (dh
09d0: 67 5f 32 30 34 38 29 2c 20 4e 55 4c 4c 29 3b 0a g_2048), NULL);.
09e0: 0a 23 69 66 64 65 66 20 54 43 4c 54 4c 53 5f 4f .#ifdef TCLTLS_O
09f0: 50 45 4e 53 53 4c 5f 50 52 45 5f 31 5f 31 5f 41 PENSSL_PRE_1_1_A
0a00: 50 49 0a 09 64 68 2d 3e 70 20 3d 20 64 68 70 5f PI..dh->p = dhp_
0a10: 62 6e 3b 0a 09 64 68 2d 3e 67 20 3d 20 64 68 67 bn;..dh->g = dhg
0a20: 5f 62 6e 3b 0a 0a 09 69 66 20 28 64 68 70 5f 62 _bn;...if (dhp_b
0a30: 6e 20 3d 3d 20 4e 55 4c 4c 20 7c 7c 20 64 68 67 n == NULL || dhg
0a40: 5f 62 6e 20 3d 3d 20 4e 55 4c 4c 29 20 7b 0a 23 _bn == NULL) {.#
0a50: 65 6c 73 65 0a 09 69 66 20 28 64 68 70 5f 62 6e else..if (dhp_bn
0a60: 20 3d 3d 20 4e 55 4c 4c 20 7c 7c 20 64 68 67 5f == NULL || dhg_
0a70: 62 6e 20 3d 3d 20 4e 55 4c 4c 20 7c 7c 20 21 44 bn == NULL || !D
0a80: 48 5f 73 65 74 30 5f 70 71 67 28 64 68 2c 20 64 H_set0_pqg(dh, d
0a90: 68 70 5f 62 6e 2c 20 4e 55 4c 4c 2c 20 64 68 67 hp_bn, NULL, dhg
0aa0: 5f 62 6e 29 29 20 7b 0a 23 65 6e 64 69 66 0a 09 _bn)) {.#endif..
0ab0: 09 44 48 5f 66 72 65 65 28 64 68 29 3b 0a 09 09 .DH_free(dh);...
0ac0: 42 4e 5f 66 72 65 65 28 64 68 70 5f 62 6e 29 3b BN_free(dhp_bn);
0ad0: 0a 09 09 42 4e 5f 66 72 65 65 28 64 68 67 5f 62 ...BN_free(dhg_b
0ae0: 6e 29 3b 0a 09 09 72 65 74 75 72 6e 28 4e 55 4c n);...return(NUL
0af0: 4c 29 3b 0a 09 7d 0a 0a 09 72 65 74 75 72 6e 28 L);..}...return(
0b00: 64 68 29 3b 0a 7d 0a 5f 45 4f 46 5f 0a 0a 09 09 dh);.}._EOF_....
0b10: 72 65 74 75 72 6e 20 30 0a 09 66 69 0a 0a 09 72 return 0..fi...r
0b20: 65 74 75 72 6e 20 31 0a 7d 0a 0a 23 20 45 6e 61 eturn 1.}..# Ena
0b30: 62 6c 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 ble support for
0b40: 67 69 76 69 6e 67 20 74 68 65 20 73 61 6d 65 20 giving the same
0b50: 44 48 20 70 61 72 61 6d 73 20 65 61 63 68 20 74 DH params each t
0b60: 69 6d 65 0a 69 66 20 5b 20 22 24 31 22 20 3d 20 ime.if [ "$1" =
0b70: 27 66 61 6c 6c 62 61 63 6b 27 20 5d 3b 20 74 68 'fallback' ]; th
0b80: 65 6e 0a 09 67 65 6e 5f 64 68 5f 70 61 72 61 6d en..gen_dh_param
0b90: 73 5f 66 61 6c 6c 62 61 63 6b 20 26 26 20 65 78 s_fallback && ex
0ba0: 69 74 20 30 0a 0a 09 65 63 68 6f 20 22 55 6e 61 it 0...echo "Una
0bb0: 62 6c 65 20 74 6f 20 67 65 6e 65 72 61 74 65 20 ble to generate
0bc0: 66 61 6c 6c 62 61 63 6b 20 70 61 72 61 6d 65 74 fallback paramet
0bd0: 65 72 73 20 66 6f 72 20 44 48 20 6f 66 20 24 7b ers for DH of ${
0be0: 62 69 74 73 7d 20 62 69 74 73 22 20 3e 26 32 0a bits} bits" >&2.
0bf0: 0a 09 65 78 69 74 20 31 0a 66 69 0a 0a 65 63 68 ..exit 1.fi..ech
0c00: 6f 20 22 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a o "*************
0c10: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0c20: 22 20 3e 26 32 0a 65 63 68 6f 20 22 2a 2a 20 47 " >&2.echo "** G
0c30: 65 6e 65 72 61 74 69 6e 67 20 44 48 20 50 72 69 enerating DH Pri
0c40: 6d 65 73 2e 20 20 20 2a 2a 22 20 3e 26 32 0a 65 mes. **" >&2.e
0c50: 63 68 6f 20 22 2a 2a 20 54 68 69 73 20 77 69 6c cho "** This wil
0c60: 6c 20 74 61 6b 65 20 61 20 77 68 69 6c 65 2e 20 l take a while.
0c70: 2a 2a 22 20 3e 26 32 0a 65 63 68 6f 20 22 2a 2a **" >&2.echo "**
0c80: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0c90: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 22 20 3e 26 32 ***********" >&2
0ca0: 0a 67 65 6e 5f 64 68 5f 70 61 72 61 6d 73 5f 6f .gen_dh_params_o
0cb0: 70 65 6e 73 73 6c 20 26 26 20 65 78 69 74 20 30 penssl && exit 0
0cc0: 0a 67 65 6e 5f 64 68 5f 70 61 72 61 6d 73 5f 72 .gen_dh_params_r
0cd0: 65 6d 6f 74 65 20 26 26 20 65 78 69 74 20 30 0a emote && exit 0.
0ce0: 67 65 6e 5f 64 68 5f 70 61 72 61 6d 73 5f 66 61 gen_dh_params_fa
0cf0: 6c 6c 62 61 63 6b 20 26 26 20 65 78 69 74 20 30 llback && exit 0
0d00: 0a 0a 65 63 68 6f 20 22 55 6e 61 62 6c 65 20 74 ..echo "Unable t
0d10: 6f 20 67 65 6e 65 72 61 74 65 20 70 61 72 61 6d o generate param
0d20: 65 74 65 72 73 20 66 6f 72 20 44 48 20 6f 66 20 eters for DH of
0d30: 24 7b 62 69 74 73 7d 20 62 69 74 73 22 20 3e 26 ${bits} bits" >&
0d40: 32 0a 0a 65 78 69 74 20 31 0a 2..exit 1.