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