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