1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) Jeremy Harris 1995 - 2020 */
6 /* See the file NOTICE for conditions of use and distribution. */
7 /* SPDX-License-Identifier: GPL-2.0-or-later */
9 /* This file provides an Exim authenticator driver for
10 a server to verify a client SSL certificate
16 #ifdef AUTH_TLS /* Remainder of file */
19 /* Options specific to the tls authentication mechanism. */
21 optionlist auth_tls_options[] = {
22 { "server_param", opt_stringptr,
23 OPT_OFF(auth_tls_options_block, server_param1) },
24 { "server_param1", opt_stringptr,
25 OPT_OFF(auth_tls_options_block, server_param1) },
26 { "server_param2", opt_stringptr,
27 OPT_OFF(auth_tls_options_block, server_param2) },
28 { "server_param3", opt_stringptr,
29 OPT_OFF(auth_tls_options_block, server_param3) },
32 /* Size of the options list. An extern variable has to be used so that its
33 address can appear in the tables drtables.c. */
35 int auth_tls_options_count = nelem(auth_tls_options);
37 /* Default private options block for the authentication method. */
39 auth_tls_options_block auth_tls_option_defaults = {
40 NULL, /* server_param1 */
41 NULL, /* server_param2 */
42 NULL, /* server_param3 */
49 void auth_tls_init(auth_instance *ablock) {}
50 int auth_tls_server(auth_instance *ablock, uschar *data) {return 0;}
51 int auth_tls_client(auth_instance *ablock, void * sx,
52 int timeout, uschar *buffer, int buffsize) {return 0;}
54 #else /*!MACRO_PREDEF*/
59 /*************************************************
60 * Initialization entry point *
61 *************************************************/
63 /* Called for each instance, after its options have been read, to
64 enable consistency checks to be done, or anything else that needs
68 auth_tls_init(auth_instance *ablock)
70 ablock->public_name = ablock->name; /* needed for core code */
75 /*************************************************
76 * Server entry point *
77 *************************************************/
79 /* For interface, see auths/README */
82 auth_tls_server(auth_instance *ablock, uschar *data)
84 auth_tls_options_block * ob = (auth_tls_options_block *)ablock->options_block;
86 if (ob->server_param1)
87 auth_vars[expand_nmax++] = expand_string(ob->server_param1);
88 if (ob->server_param2)
89 auth_vars[expand_nmax++] = expand_string(ob->server_param2);
90 if (ob->server_param3)
91 auth_vars[expand_nmax++] = expand_string(ob->server_param3);
92 return auth_check_serv_cond(ablock);
96 #endif /*!MACRO_PREDEF*/