Framework to build dane support
[exim.git] / src / src / dane.c
1 /*************************************************
2 *     Exim - an Internet mail transport agent    *
3 *************************************************/
4
5 /* Copyright (c) University of Cambridge 1995 - 2012 */
6 /* See the file NOTICE for conditions of use and distribution. */
7
8 /* This module provides TLS (aka SSL) support for Exim. The code for OpenSSL is
9 based on a patch that was originally contributed by Steve Haslam. It was
10 adapted from stunnel, a GPL program by Michal Trojnara. The code for GNU TLS is
11 based on a patch contributed by Nikos Mavroyanopoulos. Because these packages
12 are so very different, the functions for each are kept in separate files. The
13 relevant file is #included as required, after any any common functions.
14
15 No cryptographic code is included in Exim. All this module does is to call
16 functions from the OpenSSL or GNU TLS libraries. */
17
18
19 #include "exim.h"
20
21 /* This module is compiled only when it is specifically requested in the
22 build-time configuration. However, some compilers don't like compiling empty
23 modules, so keep them happy with a dummy when skipping the rest. Make it
24 reference itself to stop picky compilers complaining that it is unused, and put
25 in a dummy argument to stop even pickier compilers complaining about infinite
26 loops. */
27
28 #ifndef EXPERIMENTAL_DANE
29 static void dummy(int x) { dummy(x-1); }
30 #else
31
32 /* Enabling DANE without enabling TLS cannot work. Abort the compilation. */
33 #ifndef SUPPORT_TLS
34 #error DANE support requires that TLS support must be enabled. Abort build.
35 #endif
36
37 #ifdef USE_GNUTLS
38 #include "dane-gnu.c"
39 #else
40 #include "dane-openssl.c"
41 #endif
42
43
44 #endif  /* EXPERIMENTAL_DANE */
45
46 /* End of dane.c */