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(auth_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(auth_instance *ablock)
71 ablock->public_name = ablock->name; /* needed for core code */
76 /*************************************************
77 * Server entry point *
78 *************************************************/
80 /* For interface, see auths/README */
83 auth_tls_server(auth_instance *ablock, uschar *data)
85 auth_tls_options_block * ob = (auth_tls_options_block *)ablock->options_block;
87 if (ob->server_param1)
88 auth_vars[expand_nmax++] = expand_string(ob->server_param1);
89 if (ob->server_param2)
90 auth_vars[expand_nmax++] = expand_string(ob->server_param2);
91 if (ob->server_param3)
92 auth_vars[expand_nmax++] = expand_string(ob->server_param3);
93 return auth_check_serv_cond(ablock);
97 #endif /*!MACRO_PREDEF*/