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
17 /* Options specific to the tls authentication mechanism. */
19 optionlist auth_tls_options[] = {
20 { "server_param", opt_stringptr,
21 OPT_OFF(auth_tls_options_block, server_param1) },
22 { "server_param1", opt_stringptr,
23 OPT_OFF(auth_tls_options_block, server_param1) },
24 { "server_param2", opt_stringptr,
25 OPT_OFF(auth_tls_options_block, server_param2) },
26 { "server_param3", opt_stringptr,
27 OPT_OFF(auth_tls_options_block, server_param3) },
30 /* Size of the options list. An extern variable has to be used so that its
31 address can appear in the tables drtables.c. */
33 int auth_tls_options_count = nelem(auth_tls_options);
35 /* Default private options block for the authentication method. */
37 auth_tls_options_block auth_tls_option_defaults = {
38 NULL, /* server_param1 */
39 NULL, /* server_param2 */
40 NULL, /* server_param3 */
47 void auth_tls_init(auth_instance *ablock) {}
48 int auth_tls_server(auth_instance *ablock, uschar *data) {return 0;}
49 int auth_tls_client(auth_instance *ablock, void * sx,
50 int timeout, uschar *buffer, int buffsize) {return 0;}
52 #else /*!MACRO_PREDEF*/
57 /*************************************************
58 * Initialization entry point *
59 *************************************************/
61 /* Called for each instance, after its options have been read, to
62 enable consistency checks to be done, or anything else that needs
66 auth_tls_init(auth_instance *ablock)
68 ablock->public_name = ablock->name; /* needed for core code */
73 /*************************************************
74 * Server entry point *
75 *************************************************/
77 /* For interface, see auths/README */
80 auth_tls_server(auth_instance *ablock, uschar *data)
82 auth_tls_options_block * ob = (auth_tls_options_block *)ablock->options_block;
84 if (ob->server_param1)
85 auth_vars[expand_nmax++] = expand_string(ob->server_param1);
86 if (ob->server_param2)
87 auth_vars[expand_nmax++] = expand_string(ob->server_param2);
88 if (ob->server_param3)
89 auth_vars[expand_nmax++] = expand_string(ob->server_param3);
90 return auth_check_serv_cond(ablock);
94 #endif /*!MACRO_PREDEF*/