SPDX: license tags (mostly by guesswork)
[exim.git] / src / src / sha_ver.h
1 /*************************************************
2 *     Exim - an Internet mail transport agent    *
3 *************************************************/
4
5 /* Copyright (c) Jeremy Harris 2018 */
6 /* See the file NOTICE for conditions of use and distribution. */
7 /* SPDX-License-Identifier: GPL-2.0-only */
8
9 /* SHA routine selection */
10
11 #include "exim.h"
12
13 /* Please be aware that pulling in extra headers which are not in the system
14  * includes may require careful juggling of CFLAGS in
15  * scripts/Configure-Makefile -- that logic should be kept in sync with this.
16  * In particular, building with just something like USE_OPENSSL_PC=openssl
17  * and not massaging CFLAGS in Local/Makefile is fully supported.
18  */
19
20 #ifndef DISABLE_TLS
21
22 # define EXIM_HAVE_SHA2
23
24 # ifdef USE_GNUTLS
25 #  include <gnutls/gnutls.h>
26
27 #  if GNUTLS_VERSION_NUMBER >= 0x020a00
28 #   define SHA_GNUTLS
29 #   if GNUTLS_VERSION_NUMBER >= 0x030500
30 #    define EXIM_HAVE_SHA3              /*MMMM*/
31 #   endif
32 #  else
33 #   define SHA_GCRYPT
34 #  endif
35 # endif
36
37 # ifdef USE_OPENSSL
38 #  define SHA_OPENSSL
39 #  include <openssl/ssl.h>
40 #  if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
41 #   define EXIM_HAVE_SHA3
42 #  endif
43 # endif
44
45 #else
46 # define SHA_NATIVE
47 #endif
48