/*
 * Copyright (c) 2005 Sendmail, Inc. and its suppliers.
 *	All rights reserved.
 *
 * By using this file, you agree to the terms and conditions set
 * forth in the LICENSE file which can be found at the top level of
 * the sendmail distribution.
 *
 * $Id: tlscnfs.h,v 1.4 2007/05/01 04:27:04 ca Exp $
 */

#ifndef SM_TLSCNFS_H
#define SM_TLSCNFS_H 1

#include "sm/generic.h"
#include "sm/types.h"
#include "sm/sm-conf.h"
#include "sm/mta.h"
#include "sm/cnf.h"

#if MTA_USE_TLS

#define TLS_DEFS(strct, sn)	\
{ SM_CONF_DEF_MAGIC, "cert_file",	sm_conf_type_string,	\
	offsetof(strct, sn##_cnf_cert),	0,	\
	SM_MTA_CERT,	\
	0,	NULL,	NULL,	NULL,	\
	"File with certificate in PEM format"	\
	SM_LC_NO_ISSET SM_LC_SET_MAGIC(0) },	\
{ SM_CONF_DEF_MAGIC, "key_file",	sm_conf_type_string,	\
	offsetof(strct, sn##_cnf_key),	0,	\
	SM_MTA_KEY,	\
	0,	NULL,	NULL,	NULL,	\
	"File with private key for certificate in PEM format"	\
	SM_LC_NO_ISSET SM_LC_SET_MAGIC(0) },	\
{ SM_CONF_DEF_MAGIC, "DSA_cert_file",	sm_conf_type_string,	\
	offsetof(strct, sn##_cnf_dsa_cert),	0,	\
	NULL,	0,	NULL,	NULL,	NULL,	\
	"File with DSA certificate in PEM format"	\
	SM_LC_NO_ISSET SM_LC_SET_MAGIC(0) },	\
{ SM_CONF_DEF_MAGIC, "DSA_key_file",	sm_conf_type_string,	\
	offsetof(strct, sn##_cnf_dsa_key),	0,	\
	NULL,	0,	NULL,	NULL,	NULL,	\
	"File with private key for DSA certificate in PEM format"	\
	SM_LC_NO_ISSET SM_LC_SET_MAGIC(0) },	\
{ SM_CONF_DEF_MAGIC, "CAcert_file",	sm_conf_type_string,	\
	offsetof(strct, sn##_cnf_cacert),	0,	\
	SM_MTA_CACERT,	\
	0,	NULL,	NULL,	NULL,	\
	"File with CA certificate in PEM format"	\
	SM_LC_NO_ISSET SM_LC_SET_MAGIC(0) },	\
{ SM_CONF_DEF_MAGIC, "CAcert_directory",	sm_conf_type_string,	\
	offsetof(strct, sn##_cnf_certpath),	0,	\
	SM_MTA_CERTP,	\
	0,	NULL,	NULL,	NULL,	\
	"Directory with (symbolic links for) CA certificates in PEM format"	\
	SM_LC_NO_ISSET SM_LC_SET_MAGIC(0) }

#define TLS_STRUCTS(sn)				\
	char		*sn##_cnf_cert;		\
	char		*sn##_cnf_key;		\
	char		*sn##_cnf_dsa_cert;	\
	char		*sn##_cnf_dsa_key;	\
	char		*sn##_cnf_certpath;	\
	char		*sn##_cnf_cacert;	\
						\
	char		*sn##_cnf_cert_abs;	\
	char		*sn##_cnf_key_abs;	\
	char		*sn##_cnf_dsa_cert_abs;	\
	char		*sn##_cnf_dsa_key_abs;	\
	char		*sn##_cnf_certpath_abs;	\
	char		*sn##_cnf_cacert_abs;	\

#else /* MTA_USE_TLS */

#define TLS_DEFS(strct, sn)
#define TLS_STRUCTS(sn)

#endif /* MTA_USE_TLS */

#endif /* SM_TLSCNFS_H */


syntax highlighted by Code2HTML, v. 0.9.1