Hex Artifact Content

Artifact 01c1c3f41818380dff4da69b6495670ddea87959:


0000: 41 43 5f 44 45 46 55 4e 28 5b 54 43 4c 54 4c 53  AC_DEFUN([TCLTLS
0010: 5f 53 53 4c 5f 4f 50 45 4e 53 53 4c 5d 2c 20 5b  _SSL_OPENSSL], [
0020: 0a 09 64 6e 6c 20 55 73 65 20 70 6b 67 2d 63 6f  ..dnl Use pkg-co
0030: 6e 66 69 67 20 74 6f 20 66 69 6e 64 20 74 68 65  nfig to find the
0040: 20 6c 69 62 72 61 72 69 65 73 0a 09 54 43 4c 54   libraries..TCLT
0050: 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d 22 60 22 24  LS_SSL_LIBS="`"$
0060: 7b 50 4b 47 43 4f 4e 46 49 47 7d 22 20 6f 70 65  {PKGCONFIG}" ope
0070: 6e 73 73 6c 20 2d 2d 6c 69 62 73 60 22 20 7c 7c  nssl --libs`" ||
0080: 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55   AC_MSG_ERROR([U
0090: 6e 61 62 6c 65 20 74 6f 20 67 65 74 20 4f 70 65  nable to get Ope
00a0: 6e 53 53 4c 20 43 6f 6e 66 69 67 75 72 61 74 69  nSSL Configurati
00b0: 6f 6e 5d 29 0a 09 54 43 4c 54 4c 53 5f 53 53 4c  on])..TCLTLS_SSL
00c0: 5f 43 46 4c 41 47 53 3d 22 60 22 24 7b 50 4b 47  _CFLAGS="`"${PKG
00d0: 43 4f 4e 46 49 47 7d 22 20 6f 70 65 6e 73 73 6c  CONFIG}" openssl
00e0: 20 2d 2d 63 66 6c 61 67 73 2d 6f 6e 6c 79 2d 6f   --cflags-only-o
00f0: 74 68 65 72 60 22 20 7c 7c 20 41 43 5f 4d 53 47  ther`" || AC_MSG
0100: 5f 45 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74  _ERROR([Unable t
0110: 6f 20 67 65 74 20 4f 70 65 6e 53 53 4c 20 43 6f  o get OpenSSL Co
0120: 6e 66 69 67 75 72 61 74 69 6f 6e 5d 29 0a 09 54  nfiguration])..T
0130: 43 4c 54 4c 53 5f 53 53 4c 5f 43 50 50 46 4c 41  CLTLS_SSL_CPPFLA
0140: 47 53 3d 22 60 22 24 7b 50 4b 47 43 4f 4e 46 49  GS="`"${PKGCONFI
0150: 47 7d 22 20 6f 70 65 6e 73 73 6c 20 2d 2d 63 66  G}" openssl --cf
0160: 6c 61 67 73 2d 6f 6e 6c 79 2d 49 60 22 20 7c 7c  lags-only-I`" ||
0170: 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55   AC_MSG_ERROR([U
0180: 6e 61 62 6c 65 20 74 6f 20 67 65 74 20 4f 70 65  nable to get Ope
0190: 6e 53 53 4c 20 43 6f 6e 66 69 67 75 72 61 74 69  nSSL Configurati
01a0: 6f 6e 5d 29 0a 0a 09 64 6e 6c 20 53 61 76 65 20  on])...dnl Save 
01b0: 63 6f 6d 70 69 6c 65 2d 61 6c 74 65 72 69 6e 67  compile-altering
01c0: 20 76 61 72 69 61 62 6c 65 73 20 77 65 20 61 72   variables we ar
01d0: 65 20 63 68 61 6e 67 69 6e 67 0a 09 53 41 56 45  e changing..SAVE
01e0: 5f 4c 49 42 53 3d 22 24 7b 4c 49 42 53 7d 22 0a  _LIBS="${LIBS}".
01f0: 09 53 41 56 45 5f 43 46 4c 41 47 53 3d 22 24 7b  .SAVE_CFLAGS="${
0200: 43 46 4c 41 47 53 7d 22 0a 09 53 41 56 45 5f 43  CFLAGS}"..SAVE_C
0210: 50 50 46 4c 41 47 53 3d 22 24 7b 43 50 50 46 4c  PPFLAGS="${CPPFL
0220: 41 47 53 7d 22 0a 0a 09 64 6e 6c 20 55 70 64 61  AGS}"...dnl Upda
0230: 74 65 20 63 6f 6d 70 69 6c 65 2d 61 6c 74 65 72  te compile-alter
0240: 69 6e 67 20 76 61 72 69 61 62 6c 65 73 20 74 6f  ing variables to
0250: 20 69 6e 63 6c 75 64 65 20 74 68 65 20 4f 70 65   include the Ope
0260: 6e 53 53 4c 20 6c 69 62 72 61 72 69 65 73 0a 09  nSSL libraries..
0270: 4c 49 42 53 3d 22 24 7b 53 41 56 45 5f 4c 49 42  LIBS="${SAVE_LIB
0280: 53 7d 20 24 7b 54 43 4c 54 4c 53 5f 53 53 4c 5f  S} ${TCLTLS_SSL_
0290: 4c 49 42 53 7d 22 0a 09 43 46 4c 41 47 53 3d 22  LIBS}"..CFLAGS="
02a0: 24 7b 53 41 56 45 5f 43 46 4c 41 47 53 7d 20 24  ${SAVE_CFLAGS} $
02b0: 7b 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41  {TCLTLS_SSL_CFLA
02c0: 47 53 7d 22 0a 09 43 50 50 46 4c 41 47 53 3d 22  GS}"..CPPFLAGS="
02d0: 24 7b 53 41 56 45 5f 43 50 50 46 4c 41 47 53 7d  ${SAVE_CPPFLAGS}
02e0: 20 24 7b 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 50   ${TCLTLS_SSL_CP
02f0: 50 46 4c 41 47 53 7d 22 0a 0a 09 64 6e 6c 20 56  PFLAGS}"...dnl V
0300: 65 72 69 66 79 20 74 68 61 74 20 62 61 73 69 63  erify that basic
0310: 20 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79 20 69   functionality i
0320: 73 20 74 68 65 72 65 0a 09 41 43 5f 4c 41 4e 47  s there..AC_LANG
0330: 5f 50 55 53 48 28 43 29 0a 09 41 43 5f 4d 53 47  _PUSH(C)..AC_MSG
0340: 5f 43 48 45 43 4b 49 4e 47 28 5b 69 66 20 61 20  _CHECKING([if a 
0350: 62 61 73 69 63 20 4f 70 65 6e 53 53 4c 20 70 72  basic OpenSSL pr
0360: 6f 67 72 61 6d 20 77 6f 72 6b 73 5d 29 0a 09 41  ogram works])..A
0370: 43 5f 4c 49 4e 4b 5f 49 46 45 4c 53 45 28 5b 41  C_LINK_IFELSE([A
0380: 43 5f 4c 41 4e 47 5f 50 52 4f 47 52 41 4d 28 5b  C_LANG_PROGRAM([
0390: 0a 23 69 6e 63 6c 75 64 65 20 3c 6f 70 65 6e 73  .#include <opens
03a0: 73 6c 2f 73 73 6c 2e 68 3e 0a 23 69 66 20 28 53  sl/ssl.h>.#if (S
03b0: 53 4c 45 41 59 5f 56 45 52 53 49 4f 4e 5f 4e 55  SLEAY_VERSION_NU
03c0: 4d 42 45 52 20 3e 3d 20 30 78 30 39 30 37 30 30  MBER >= 0x090700
03d0: 30 4c 29 0a 23 20 69 6e 63 6c 75 64 65 20 3c 6f  0L).# include <o
03e0: 70 65 6e 73 73 6c 2f 63 6f 6e 66 2e 68 3e 0a 23  penssl/conf.h>.#
03f0: 65 6e 64 69 66 0a 09 09 5d 2c 20 5b 0a 20 20 28  endif...], [.  (
0400: 76 6f 69 64 29 53 53 4c 5f 6c 69 62 72 61 72 79  void)SSL_library
0410: 5f 69 6e 69 74 28 29 3b 0a 20 20 53 53 4c 5f 6c  _init();.  SSL_l
0420: 6f 61 64 5f 65 72 72 6f 72 5f 73 74 72 69 6e 67  oad_error_string
0430: 73 28 29 3b 0a 20 20 4f 50 45 4e 53 53 4c 5f 63  s();.  OPENSSL_c
0440: 6f 6e 66 69 67 28 4e 55 4c 4c 29 3b 0a 09 09 5d  onfig(NULL);...]
0450: 29 5d 2c 20 5b 0a 09 09 41 43 5f 4d 53 47 5f 52  )], [...AC_MSG_R
0460: 45 53 55 4c 54 28 5b 79 65 73 5d 29 0a 09 5d 2c  ESULT([yes])..],
0470: 20 5b 0a 09 09 41 43 5f 4d 53 47 5f 52 45 53 55   [...AC_MSG_RESU
0480: 4c 54 28 5b 6e 6f 5d 29 0a 09 09 41 43 5f 4d 53  LT([no])...AC_MS
0490: 47 5f 45 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20  G_ERROR([Unable 
04a0: 74 6f 20 63 6f 6d 70 69 6c 65 20 61 20 62 61 73  to compile a bas
04b0: 69 63 20 70 72 6f 67 72 61 6d 20 75 73 69 6e 67  ic program using
04c0: 20 4f 70 65 6e 53 53 4c 5d 29 0a 09 5d 29 0a 09   OpenSSL])..])..
04d0: 41 43 5f 4c 41 4e 47 5f 50 4f 50 28 5b 43 5d 29  AC_LANG_POP([C])
04e0: 0a 0a 09 64 6e 6c 20 44 65 74 65 72 6d 69 6e 65  ...dnl Determine
04f0: 20 69 66 20 53 53 4c 76 32 20 69 73 20 73 75 70   if SSLv2 is sup
0500: 70 6f 72 74 65 64 0a 09 41 43 5f 43 48 45 43 4b  ported..AC_CHECK
0510: 5f 46 55 4e 43 28 53 53 4c 76 32 5f 6d 65 74 68  _FUNC(SSLv2_meth
0520: 6f 64 2c 2c 20 5b 0a 09 09 41 43 5f 44 45 46 49  od,, [...AC_DEFI
0530: 4e 45 28 4e 4f 5f 53 53 4c 32 2c 20 5b 31 5d 2c  NE(NO_SSL2, [1],
0540: 20 5b 44 65 66 69 6e 65 20 74 68 69 73 20 74 6f   [Define this to
0550: 20 64 69 73 61 62 6c 65 20 53 53 4c 76 32 20 69   disable SSLv2 i
0560: 6e 20 4f 70 65 6e 53 53 4c 20 73 75 70 70 6f 72  n OpenSSL suppor
0570: 74 5d 29 0a 09 5d 29 0a 0a 09 64 6e 6c 20 44 65  t])..])...dnl De
0580: 74 65 72 6d 69 6e 65 20 69 66 20 53 53 4c 76 33  termine if SSLv3
0590: 20 69 73 20 73 75 70 70 6f 72 74 65 64 0a 09 41   is supported..A
05a0: 43 5f 43 48 45 43 4b 5f 46 55 4e 43 28 53 53 4c  C_CHECK_FUNC(SSL
05b0: 76 33 5f 6d 65 74 68 6f 64 2c 2c 20 5b 0a 09 09  v3_method,, [...
05c0: 41 43 5f 44 45 46 49 4e 45 28 4e 4f 5f 53 53 4c  AC_DEFINE(NO_SSL
05d0: 33 2c 20 5b 31 5d 2c 20 5b 44 65 66 69 6e 65 20  3, [1], [Define 
05e0: 74 68 69 73 20 74 6f 20 64 69 73 61 62 6c 65 20  this to disable 
05f0: 53 53 4c 76 33 20 69 6e 20 4f 70 65 6e 53 53 4c  SSLv3 in OpenSSL
0600: 20 73 75 70 70 6f 72 74 5d 29 0a 09 5d 29 0a 0a   support])..])..
0610: 09 64 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20 69  .dnl Determine i
0620: 66 20 54 4c 53 76 31 2e 30 20 69 73 20 73 75 70  f TLSv1.0 is sup
0630: 70 6f 72 74 65 64 0a 09 41 43 5f 43 48 45 43 4b  ported..AC_CHECK
0640: 5f 46 55 4e 43 28 54 4c 53 76 31 5f 6d 65 74 68  _FUNC(TLSv1_meth
0650: 6f 64 2c 2c 20 5b 0a 09 09 41 43 5f 44 45 46 49  od,, [...AC_DEFI
0660: 4e 45 28 4e 4f 5f 54 4c 53 31 2c 20 5b 31 5d 2c  NE(NO_TLS1, [1],
0670: 20 5b 44 65 66 69 6e 65 20 74 68 69 73 20 74 6f   [Define this to
0680: 20 64 69 73 61 62 6c 65 20 54 4c 53 76 31 2e 30   disable TLSv1.0
0690: 20 69 6e 20 4f 70 65 6e 53 53 4c 20 73 75 70 70   in OpenSSL supp
06a0: 6f 72 74 5d 29 0a 09 5d 29 0a 0a 09 64 6e 6c 20  ort])..])...dnl 
06b0: 44 65 74 65 72 6d 69 6e 65 20 69 66 20 54 4c 53  Determine if TLS
06c0: 76 31 2e 31 20 69 73 20 73 75 70 70 6f 72 74 65  v1.1 is supporte
06d0: 64 0a 09 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43  d..AC_CHECK_FUNC
06e0: 28 54 4c 53 76 31 5f 31 5f 6d 65 74 68 6f 64 2c  (TLSv1_1_method,
06f0: 2c 20 5b 0a 09 09 41 43 5f 44 45 46 49 4e 45 28  , [...AC_DEFINE(
0700: 4e 4f 5f 54 4c 53 31 5f 31 2c 20 5b 31 5d 2c 20  NO_TLS1_1, [1], 
0710: 5b 44 65 66 69 6e 65 20 74 68 69 73 20 74 6f 20  [Define this to 
0720: 64 69 73 61 62 6c 65 20 54 4c 53 76 31 2e 31 20  disable TLSv1.1 
0730: 69 6e 20 4f 70 65 6e 53 53 4c 20 73 75 70 70 6f  in OpenSSL suppo
0740: 72 74 5d 29 0a 09 5d 29 0a 0a 09 64 6e 6c 20 44  rt])..])...dnl D
0750: 65 74 65 72 6d 69 6e 65 20 69 66 20 54 4c 53 76  etermine if TLSv
0760: 31 2e 32 20 69 73 20 73 75 70 70 6f 72 74 65 64  1.2 is supported
0770: 0a 09 41 43 5f 43 48 45 43 4b 5f 46 55 4e 43 28  ..AC_CHECK_FUNC(
0780: 54 4c 53 76 31 5f 32 5f 6d 65 74 68 6f 64 2c 2c  TLSv1_2_method,,
0790: 20 5b 0a 09 09 41 43 5f 44 45 46 49 4e 45 28 4e   [...AC_DEFINE(N
07a0: 4f 5f 54 4c 53 31 5f 32 2c 20 5b 31 5d 2c 20 5b  O_TLS1_2, [1], [
07b0: 44 65 66 69 6e 65 20 74 68 69 73 20 74 6f 20 64  Define this to d
07c0: 69 73 61 62 6c 65 20 54 4c 53 76 31 2e 32 20 69  isable TLSv1.2 i
07d0: 6e 20 4f 70 65 6e 53 53 4c 20 73 75 70 70 6f 72  n OpenSSL suppor
07e0: 74 5d 29 0a 09 5d 29 0a 0a 09 64 6e 6c 20 52 65  t])..])...dnl Re
07f0: 73 74 6f 72 65 20 63 6f 6d 70 69 6c 65 2d 61 6c  store compile-al
0800: 74 65 72 69 6e 67 20 76 61 72 69 61 62 6c 65 73  tering variables
0810: 0a 09 4c 49 42 53 3d 22 24 7b 53 41 56 45 5f 4c  ..LIBS="${SAVE_L
0820: 49 42 53 7d 22 0a 09 43 46 4c 41 47 53 3d 22 24  IBS}"..CFLAGS="$
0830: 7b 53 41 56 45 5f 43 46 4c 41 47 53 7d 22 0a 09  {SAVE_CFLAGS}"..
0840: 43 50 50 46 4c 41 47 53 3d 22 24 7b 53 41 56 45  CPPFLAGS="${SAVE
0850: 5f 43 50 50 46 4c 41 47 53 7d 22 0a 5d 29 0a     _CPPFLAGS}".]).