xref: /freebsd/contrib/sendmail/src/tls.h (revision d39bd2c1388b520fcba9abed1932acacead60fba)
15b0945b5SGregory Neil Shapiro /*
2*d39bd2c1SGregory Neil Shapiro  * Copyright (c) 2015, 2020-2023 Proofpoint, Inc. and its suppliers.
35b0945b5SGregory Neil Shapiro  *	All rights reserved.
45b0945b5SGregory Neil Shapiro  *
55b0945b5SGregory Neil Shapiro  * By using this file, you agree to the terms and conditions set
65b0945b5SGregory Neil Shapiro  * forth in the LICENSE file which can be found at the top level of
75b0945b5SGregory Neil Shapiro  * the sendmail distribution.
85b0945b5SGregory Neil Shapiro  */
95b0945b5SGregory Neil Shapiro 
105b0945b5SGregory Neil Shapiro #ifndef _TLS_H
115b0945b5SGregory Neil Shapiro # define _TLS_H 1
125b0945b5SGregory Neil Shapiro 
135b0945b5SGregory Neil Shapiro #if STARTTLS
145b0945b5SGregory Neil Shapiro # include <openssl/ssl.h>
155b0945b5SGregory Neil Shapiro # if !TLS_NO_RSA
165b0945b5SGregory Neil Shapiro #  if _FFR_FIPSMODE
175b0945b5SGregory Neil Shapiro #   define RSA_KEYLENGTH	1024
185b0945b5SGregory Neil Shapiro #  else
195b0945b5SGregory Neil Shapiro #   define RSA_KEYLENGTH	512
205b0945b5SGregory Neil Shapiro #  endif
215b0945b5SGregory Neil Shapiro # endif /* !TLS_NO_RSA */
225b0945b5SGregory Neil Shapiro 
23*d39bd2c1SGregory Neil Shapiro # if (OPENSSL_VERSION_NUMBER >= 0x10100000L && OPENSSL_VERSION_NUMBER < 0x20000000L) || OPENSSL_VERSION_NUMBER >= 0x30000000L
245b0945b5SGregory Neil Shapiro #  define TLS_version_num OpenSSL_version_num
255b0945b5SGregory Neil Shapiro # else
265b0945b5SGregory Neil Shapiro #  define TLS_version_num SSLeay
275b0945b5SGregory Neil Shapiro # endif
285b0945b5SGregory Neil Shapiro 
292fb4f839SGregory Neil Shapiro #ifndef MTA_HAVE_TLSv1_3
302fb4f839SGregory Neil Shapiro /*
312fb4f839SGregory Neil Shapiro **  HACK: if openssl can disable TLSv1_3 then "assume" it supports all
322fb4f839SGregory Neil Shapiro **   related functions!
332fb4f839SGregory Neil Shapiro */
342fb4f839SGregory Neil Shapiro # ifdef SSL_OP_NO_TLSv1_3
352fb4f839SGregory Neil Shapiro #  define MTA_HAVE_TLSv1_3 1
362fb4f839SGregory Neil Shapiro # endif
372fb4f839SGregory Neil Shapiro #endif
382fb4f839SGregory Neil Shapiro 
395b0945b5SGregory Neil Shapiro #ifdef _DEFINE
405b0945b5SGregory Neil Shapiro # define EXTERN
415b0945b5SGregory Neil Shapiro #else
425b0945b5SGregory Neil Shapiro # define EXTERN extern
435b0945b5SGregory Neil Shapiro #endif
445b0945b5SGregory Neil Shapiro 
455b0945b5SGregory Neil Shapiro #if _FFR_TLS_EC && !defined(TLS_EC)
465b0945b5SGregory Neil Shapiro # define TLS_EC _FFR_TLS_EC
475b0945b5SGregory Neil Shapiro #endif
485b0945b5SGregory Neil Shapiro 
495b0945b5SGregory Neil Shapiro #if DANE
505b0945b5SGregory Neil Shapiro 
51*d39bd2c1SGregory Neil Shapiro # ifndef HAVE_SSL_CTX_dane_enable
52*d39bd2c1SGregory Neil Shapiro #  if (OPENSSL_VERSION_NUMBER >= 0x10101000L && OPENSSL_VERSION_NUMBER < 0x20000000L) || OPENSSL_VERSION_NUMBER >= 0x30000000L
53*d39bd2c1SGregory Neil Shapiro #   define HAVE_SSL_CTX_dane_enable 1
54*d39bd2c1SGregory Neil Shapiro #  endif
55*d39bd2c1SGregory Neil Shapiro # endif
56*d39bd2c1SGregory Neil Shapiro 
57*d39bd2c1SGregory Neil Shapiro extern int ssl_dane_enable __P((dane_vrfy_ctx_P, SSL *));
58*d39bd2c1SGregory Neil Shapiro # define SM_NOTDONE 1
59*d39bd2c1SGregory Neil Shapiro # define SM_FULL 2
60*d39bd2c1SGregory Neil Shapiro 
61*d39bd2c1SGregory Neil Shapiro extern int gettlsa __P((char *, char *, STAB **, unsigned long, unsigned int, unsigned int));
62*d39bd2c1SGregory Neil Shapiro # ifndef MAX_TLSA_RR
63*d39bd2c1SGregory Neil Shapiro #  if HAVE_SSL_CTX_dane_enable
64*d39bd2c1SGregory Neil Shapiro #   define MAX_TLSA_RR	64
65*d39bd2c1SGregory Neil Shapiro #  else
66*d39bd2c1SGregory Neil Shapiro #   define MAX_TLSA_RR	16
67*d39bd2c1SGregory Neil Shapiro #  endif
68*d39bd2c1SGregory Neil Shapiro # endif
69*d39bd2c1SGregory Neil Shapiro 
70*d39bd2c1SGregory Neil Shapiro # define DANE_VRFY_NONE	0	/* no DANE */
71*d39bd2c1SGregory Neil Shapiro /* # define DANE_VRFY_NO	1	* no TLSAs */
72*d39bd2c1SGregory Neil Shapiro # define DANE_VRFY_FAIL	2	/* TLSA check failed */
73*d39bd2c1SGregory Neil Shapiro # define DANE_VRFY_OK	3	/* TLSA check was ok */
74*d39bd2c1SGregory Neil Shapiro # define DANE_VRFY_TEMP	4	/* TLSA check failed temporarily */
755b0945b5SGregory Neil Shapiro 
765b0945b5SGregory Neil Shapiro /* return values for dane_tlsa_chk() */
775b0945b5SGregory Neil Shapiro # define TLSA_BOGUS	(-10)
785b0945b5SGregory Neil Shapiro # define TLSA_UNSUPP	(-1)
795b0945b5SGregory Neil Shapiro /* note: anything >= 0 is ok and refers to the hash algorithm */
80*d39bd2c1SGregory Neil Shapiro # define TLSA_IS_SUPPORTED(r)	((r) >= 0)
815b0945b5SGregory Neil Shapiro # define TLSA_IS_VALID(r)	((r) >= TLSA_UNSUPP)
825b0945b5SGregory Neil Shapiro 
835b0945b5SGregory Neil Shapiro struct dane_tlsa_S
845b0945b5SGregory Neil Shapiro {
855b0945b5SGregory Neil Shapiro 	time_t		 dane_tlsa_exp;
865b0945b5SGregory Neil Shapiro 	int		 dane_tlsa_n;
875b0945b5SGregory Neil Shapiro 	int		 dane_tlsa_dnsrc;
885b0945b5SGregory Neil Shapiro 	unsigned long	 dane_tlsa_flags;
89*d39bd2c1SGregory Neil Shapiro 
90*d39bd2c1SGregory Neil Shapiro 	/*
91*d39bd2c1SGregory Neil Shapiro 	**  Note: all "valid" TLSA RRs are stored,
92*d39bd2c1SGregory Neil Shapiro 	**  not just those which are "supported"
93*d39bd2c1SGregory Neil Shapiro 	*/
94*d39bd2c1SGregory Neil Shapiro 
95*d39bd2c1SGregory Neil Shapiro 	unsigned char	*dane_tlsa_rr[MAX_TLSA_RR];
965b0945b5SGregory Neil Shapiro 	int		 dane_tlsa_len[MAX_TLSA_RR];
975b0945b5SGregory Neil Shapiro 	char		*dane_tlsa_sni;
985b0945b5SGregory Neil Shapiro };
995b0945b5SGregory Neil Shapiro 
1002fb4f839SGregory Neil Shapiro # define TLSAFLNONE	0x00000000
1015b0945b5SGregory Neil Shapiro /* Dane Mode */
1025b0945b5SGregory Neil Shapiro # define TLSAFLALWAYS	0x00000001
1035b0945b5SGregory Neil Shapiro # define TLSAFLSECURE	0x00000002
1045b0945b5SGregory Neil Shapiro # define DANEMODE(fl)	((fl) & 0x3)
1055b0945b5SGregory Neil Shapiro # define TLSAFLNOEXP	0x00000010	/* do not check expiration */
1065b0945b5SGregory Neil Shapiro 
107*d39bd2c1SGregory Neil Shapiro # define TLSAFLNEW	0x00000020
1085b0945b5SGregory Neil Shapiro # define TLSAFLADMX	0x00000100
109*d39bd2c1SGregory Neil Shapiro # define TLSAFLADIP	0x00000200	/* changes with each IP lookup! */
110*d39bd2c1SGregory Neil Shapiro # define TLSAFLNOTLS	0x00000400	/* starttls() failed */
111*d39bd2c1SGregory Neil Shapiro /* treat IPv4 and IPv6 the same - the ad flag should be identical */
112*d39bd2c1SGregory Neil Shapiro /* # define TLSAFLADTLSA		* currently unused */
1135b0945b5SGregory Neil Shapiro 
114*d39bd2c1SGregory Neil Shapiro /* NOTE: "flags" >= TLSAFLTEMP are stored, see TLSA_STORE_FL()! */
1155b0945b5SGregory Neil Shapiro /* could be used to replace DNSRC */
116*d39bd2c1SGregory Neil Shapiro # define TLSAFLTEMP	0x00001000	/* TLSA RR lookup tempfailed */
117*d39bd2c1SGregory Neil Shapiro # define TLSAFL2MANY	0x00004000	/* too many TLSA RRs */
1185b0945b5SGregory Neil Shapiro 
1195b0945b5SGregory Neil Shapiro /*
1205b0945b5SGregory Neil Shapiro **  Do not use this record, and do not look up new TLSA RRs because
1215b0945b5SGregory Neil Shapiro **  the MX/host lookup was not secure.
122*d39bd2c1SGregory Neil Shapiro **  XXX: host->MX lookup info can NOT be stored in dane_tlsa!
1235b0945b5SGregory Neil Shapiro **  XXX: to determine: interaction with DANE=always
1245b0945b5SGregory Neil Shapiro */
1255b0945b5SGregory Neil Shapiro 
126*d39bd2c1SGregory Neil Shapiro /* # define TLSAFLNOADMX	0x00010000 */
127*d39bd2c1SGregory Neil Shapiro /* # define TLSAFLNOADTLSA	0x00020000	* TLSA: no AD - for DANE=always? */
128*d39bd2c1SGregory Neil Shapiro 
129*d39bd2c1SGregory Neil Shapiro # define TLSAFLTEMPVRFY	0x00008000	/* temporary DANE verification failure */
130*d39bd2c1SGregory Neil Shapiro # define TLSAFLNOVRFY	0x00080000	/* do NOT perform DANE verification */
131*d39bd2c1SGregory Neil Shapiro 
132*d39bd2c1SGregory Neil Shapiro # define TLSAFLUNS	0x00100000	/* has unsupported TLSA RRs */
133*d39bd2c1SGregory Neil Shapiro # define TLSAFLSUP	0x00200000	/* has supported TLSA RRs */
1345b0945b5SGregory Neil Shapiro 
1355b0945b5SGregory Neil Shapiro # define TLSA_SET_FL(dane_tlsa, fl)	(dane_tlsa)->dane_tlsa_flags |= (fl)
1365b0945b5SGregory Neil Shapiro # define TLSA_CLR_FL(dane_tlsa, fl)	(dane_tlsa)->dane_tlsa_flags &= ~(fl)
137*d39bd2c1SGregory Neil Shapiro # define TLSA_IS_FL(dane_tlsa, fl)	(((dane_tlsa)->dane_tlsa_flags & (fl)) != 0)
138*d39bd2c1SGregory Neil Shapiro 
139*d39bd2c1SGregory Neil Shapiro /* any TLSA RRs? */
140*d39bd2c1SGregory Neil Shapiro # define TLSA_HAS_RRs(dane_tlsa)	TLSA_IS_FL(dane_tlsa, TLSAFLUNS|TLSAFLSUP)
141*d39bd2c1SGregory Neil Shapiro 
1425b0945b5SGregory Neil Shapiro # define TLSA_STORE_FL(fl)	((fl) >= TLSAFLTEMP)
1435b0945b5SGregory Neil Shapiro 
1445b0945b5SGregory Neil Shapiro /* values for DANE option and dane_vrfy_chk */
145*d39bd2c1SGregory Neil Shapiro # define DANE_NEVER	TLSAFLNONE /* XREF: see sendmail.h: #define Dane */
1465b0945b5SGregory Neil Shapiro # define DANE_ALWAYS	TLSAFLALWAYS	/* NOT documented, testing... */
1475b0945b5SGregory Neil Shapiro # define DANE_SECURE	TLSAFLSECURE
148*d39bd2c1SGregory Neil Shapiro # define CHK_DANE(dane)	(DANEMODE((dane)) != DANE_NEVER)
149*d39bd2c1SGregory Neil Shapiro # define VRFY_DANE(dane_vrfy_chk) (0 == ((dane_vrfy_chk) & TLSAFLNOVRFY))
1505b0945b5SGregory Neil Shapiro 
1515b0945b5SGregory Neil Shapiro /* temp fails? others? */
1525b0945b5SGregory Neil Shapiro # define TLSA_RR_TEMPFAIL(dane_tlsa) (((dane_tlsa) != NULL) && (dane_tlsa)->dane_tlsa_dnsrc == TRY_AGAIN)
1535b0945b5SGregory Neil Shapiro 
154*d39bd2c1SGregory Neil Shapiro # define ONLYUNSUPTLSARR ", status=all TLSA RRs are unsupported"
1555b0945b5SGregory Neil Shapiro #endif /* DANE */
1565b0945b5SGregory Neil Shapiro 
1575b0945b5SGregory Neil Shapiro /*
1585b0945b5SGregory Neil Shapiro **  TLS
1595b0945b5SGregory Neil Shapiro */
1605b0945b5SGregory Neil Shapiro 
1615b0945b5SGregory Neil Shapiro /* what to do in the TLS initialization */
1625b0945b5SGregory Neil Shapiro #define TLS_I_NONE	0x00000000	/* no requirements... */
1635b0945b5SGregory Neil Shapiro #define TLS_I_CERT_EX	0x00000001	/* cert must exist */
1645b0945b5SGregory Neil Shapiro #define TLS_I_CERT_UNR	0x00000002	/* cert must be g/o unreadable */
1655b0945b5SGregory Neil Shapiro #define TLS_I_KEY_EX	0x00000004	/* key must exist */
1665b0945b5SGregory Neil Shapiro #define TLS_I_KEY_UNR	0x00000008	/* key must be g/o unreadable */
1675b0945b5SGregory Neil Shapiro #define TLS_I_CERTP_EX	0x00000010	/* CA cert path must exist */
1685b0945b5SGregory Neil Shapiro #define TLS_I_CERTP_UNR	0x00000020	/* CA cert path must be g/o unreadable */
1695b0945b5SGregory Neil Shapiro #define TLS_I_CERTF_EX	0x00000040	/* CA cert file must exist */
1705b0945b5SGregory Neil Shapiro #define TLS_I_CERTF_UNR	0x00000080	/* CA cert file must be g/o unreadable */
1715b0945b5SGregory Neil Shapiro #define TLS_I_RSA_TMP	0x00000100	/* RSA TMP must be generated */
1725b0945b5SGregory Neil Shapiro #define TLS_I_USE_KEY	0x00000200	/* private key must usable */
1735b0945b5SGregory Neil Shapiro #define TLS_I_USE_CERT	0x00000400	/* certificate must be usable */
1742fb4f839SGregory Neil Shapiro /*
1752fb4f839SGregory Neil Shapiro not "read" anywhere
1762fb4f839SGregory Neil Shapiro #define TLS_I_VRFY_PATH	0x00000800	* load verify path must succeed *
1772fb4f839SGregory Neil Shapiro */
1785b0945b5SGregory Neil Shapiro #define TLS_I_VRFY_LOC	0x00001000	/* load verify default must succeed */
1795b0945b5SGregory Neil Shapiro #define TLS_I_CACHE	0x00002000	/* require cache */
1805b0945b5SGregory Neil Shapiro #define TLS_I_TRY_DH	0x00004000	/* try DH certificate */
1815b0945b5SGregory Neil Shapiro #define TLS_I_REQ_DH	0x00008000	/* require DH certificate */
1825b0945b5SGregory Neil Shapiro #define TLS_I_DHPAR_EX	0x00010000	/* require DH parameters */
1835b0945b5SGregory Neil Shapiro #define TLS_I_DHPAR_UNR	0x00020000	/* DH param. must be g/o unreadable */
1845b0945b5SGregory Neil Shapiro #define TLS_I_DH512	0x00040000	/* generate 512bit DH param */
1855b0945b5SGregory Neil Shapiro #define TLS_I_DH1024	0x00080000	/* generate 1024bit DH param */
1865b0945b5SGregory Neil Shapiro #define TLS_I_DH2048	0x00100000	/* generate 2048bit DH param */
1875b0945b5SGregory Neil Shapiro #define TLS_I_NO_VRFY	0x00200000	/* do not require authentication */
1885b0945b5SGregory Neil Shapiro #define TLS_I_KEY_OUNR	0x00400000	/* Key must be other unreadable */
1895b0945b5SGregory Neil Shapiro #define TLS_I_CRLF_EX	0x00800000	/* CRL file must exist */
1905b0945b5SGregory Neil Shapiro #define TLS_I_CRLF_UNR	0x01000000	/* CRL file must be g/o unreadable */
1915b0945b5SGregory Neil Shapiro #define TLS_I_DHFIXED	0x02000000	/* use fixed DH param */
192*d39bd2c1SGregory Neil Shapiro #define TLS_I_DHAUTO	0x04000000	/* */
1935b0945b5SGregory Neil Shapiro 
1945b0945b5SGregory Neil Shapiro /* require server cert */
1955b0945b5SGregory Neil Shapiro #define TLS_I_SRV_CERT	 (TLS_I_CERT_EX | TLS_I_KEY_EX | \
1965b0945b5SGregory Neil Shapiro 			  TLS_I_KEY_UNR | TLS_I_KEY_OUNR | \
1975b0945b5SGregory Neil Shapiro 			  TLS_I_CERTP_EX | TLS_I_CERTF_EX | \
1985b0945b5SGregory Neil Shapiro 			  TLS_I_USE_KEY | TLS_I_USE_CERT | TLS_I_CACHE)
1995b0945b5SGregory Neil Shapiro 
2005b0945b5SGregory Neil Shapiro /* server requirements */
2012fb4f839SGregory Neil Shapiro #define TLS_I_SRV	(TLS_I_SRV_CERT | TLS_I_RSA_TMP | /*TLS_I_VRFY_PATH|*/ \
2025b0945b5SGregory Neil Shapiro 			 TLS_I_VRFY_LOC | TLS_I_TRY_DH | TLS_I_CACHE)
2035b0945b5SGregory Neil Shapiro 
2045b0945b5SGregory Neil Shapiro /* client requirements */
2055b0945b5SGregory Neil Shapiro #define TLS_I_CLT	(TLS_I_KEY_UNR | TLS_I_KEY_OUNR)
2065b0945b5SGregory Neil Shapiro 
2075b0945b5SGregory Neil Shapiro #define TLS_AUTH_OK	0
2085b0945b5SGregory Neil Shapiro #define TLS_AUTH_NO	1
209*d39bd2c1SGregory Neil Shapiro #define TLS_AUTH_TEMP	2
2105b0945b5SGregory Neil Shapiro #define TLS_AUTH_FAIL	(-1)
2115b0945b5SGregory Neil Shapiro 
2125b0945b5SGregory Neil Shapiro # ifndef TLS_VRFY_PER_CTX
2135b0945b5SGregory Neil Shapiro #  define TLS_VRFY_PER_CTX 1
2145b0945b5SGregory Neil Shapiro # endif
2155b0945b5SGregory Neil Shapiro 
2165b0945b5SGregory Neil Shapiro #define SM_SSL_FREE(ssl)			\
2175b0945b5SGregory Neil Shapiro 	do {					\
2185b0945b5SGregory Neil Shapiro 		if (ssl != NULL)		\
2195b0945b5SGregory Neil Shapiro 		{				\
2205b0945b5SGregory Neil Shapiro 			SSL_free(ssl);		\
2215b0945b5SGregory Neil Shapiro 			ssl = NULL;		\
2225b0945b5SGregory Neil Shapiro 		}				\
2235b0945b5SGregory Neil Shapiro 	} while (0)
2245b0945b5SGregory Neil Shapiro 
2255b0945b5SGregory Neil Shapiro /* functions */
2265b0945b5SGregory Neil Shapiro extern int	endtls __P((SSL **, const char *));
2272fb4f839SGregory Neil Shapiro extern int	get_tls_se_features __P((ENVELOPE *, SSL *, tlsi_ctx_T *, bool));
2285b0945b5SGregory Neil Shapiro extern int	init_tls_library __P((bool _fipsmode));
2295b0945b5SGregory Neil Shapiro extern bool	inittls __P((SSL_CTX **, unsigned long, unsigned long, bool, char *, char *, char *, char *, char *));
2305b0945b5SGregory Neil Shapiro extern bool	initclttls __P((bool));
2315b0945b5SGregory Neil Shapiro extern bool	initsrvtls __P((bool));
2325b0945b5SGregory Neil Shapiro extern bool	load_certkey __P((SSL *, bool, char *, char *));
2335b0945b5SGregory Neil Shapiro /* extern bool	load_crlpath __P((SSL_CTX *, bool , char *)); */
2345b0945b5SGregory Neil Shapiro extern void	setclttls __P((bool));
2355b0945b5SGregory Neil Shapiro extern int	tls_get_info __P((SSL *, bool, char *, MACROS_T *, bool));
2365b0945b5SGregory Neil Shapiro extern void	tlslogerr __P((int, int, const char *));
2375b0945b5SGregory Neil Shapiro extern void	tls_set_verify __P((SSL_CTX *, SSL *, bool));
2385b0945b5SGregory Neil Shapiro # if DANE
239*d39bd2c1SGregory Neil Shapiro extern int dane_tlsa_chk __P((const unsigned char *, int, const char *, bool));
2405b0945b5SGregory Neil Shapiro extern int dane_tlsa_clr __P((dane_tlsa_P));
2415b0945b5SGregory Neil Shapiro extern int dane_tlsa_free __P((dane_tlsa_P));
2425b0945b5SGregory Neil Shapiro # endif
2435b0945b5SGregory Neil Shapiro 
2445b0945b5SGregory Neil Shapiro EXTERN char	*CACertPath;	/* path to CA certificates (dir. with hashes) */
2455b0945b5SGregory Neil Shapiro EXTERN char	*CACertFile;	/* file with CA certificate */
2465b0945b5SGregory Neil Shapiro #if _FFR_CLIENTCA
2475b0945b5SGregory Neil Shapiro EXTERN char	*CltCACertPath;	/* path to CA certificates (dir. with hashes) */
2485b0945b5SGregory Neil Shapiro EXTERN char	*CltCACertFile;	/* file with CA certificate */
2495b0945b5SGregory Neil Shapiro #endif
2505b0945b5SGregory Neil Shapiro EXTERN char	*CltCertFile;	/* file with client certificate */
2515b0945b5SGregory Neil Shapiro EXTERN char	*CltKeyFile;	/* file with client private key */
2525b0945b5SGregory Neil Shapiro EXTERN char	*CipherList;	/* list of ciphers */
2532fb4f839SGregory Neil Shapiro #if MTA_HAVE_TLSv1_3
2542fb4f839SGregory Neil Shapiro EXTERN char	*CipherSuites;	/* cipher suites */
2552fb4f839SGregory Neil Shapiro #endif
2565b0945b5SGregory Neil Shapiro EXTERN char	*CertFingerprintAlgorithm;	/* name of fingerprint alg */
2575b0945b5SGregory Neil Shapiro EXTERN const EVP_MD	*EVP_digest;	/* digest for cert fp */
2585b0945b5SGregory Neil Shapiro EXTERN char	*DHParams;	/* file with DH parameters */
2595b0945b5SGregory Neil Shapiro EXTERN char	*RandFile;	/* source of random data */
2605b0945b5SGregory Neil Shapiro EXTERN char	*SrvCertFile;	/* file with server certificate */
2615b0945b5SGregory Neil Shapiro EXTERN char	*SrvKeyFile;	/* file with server private key */
2625b0945b5SGregory Neil Shapiro EXTERN char	*CRLFile;	/* file CRLs */
2635b0945b5SGregory Neil Shapiro EXTERN char	*CRLPath;	/* path to CRLs (dir. with hashes) */
2645b0945b5SGregory Neil Shapiro EXTERN unsigned long	TLS_Srv_Opts;	/* TLS server options */
2655b0945b5SGregory Neil Shapiro EXTERN unsigned long	Srv_SSL_Options, Clt_SSL_Options; /* SSL options */
2665b0945b5SGregory Neil Shapiro EXTERN bool	TLSFallbacktoClear;
2675b0945b5SGregory Neil Shapiro 
2685b0945b5SGregory Neil Shapiro EXTERN char	*SSLEngine;
2695b0945b5SGregory Neil Shapiro EXTERN char	*SSLEnginePath;
2705b0945b5SGregory Neil Shapiro EXTERN bool	SSLEngineprefork;
2715b0945b5SGregory Neil Shapiro 
2725b0945b5SGregory Neil Shapiro # if USE_OPENSSL_ENGINE
2735b0945b5SGregory Neil Shapiro #define TLS_set_engine(id, prefork) SSL_set_engine(id)
2745b0945b5SGregory Neil Shapiro # else
2752fb4f839SGregory Neil Shapiro #  if !defined(OPENSSL_NO_ENGINE)
2765b0945b5SGregory Neil Shapiro int TLS_set_engine __P((const char *, bool));
2772fb4f839SGregory Neil Shapiro #  else
2782fb4f839SGregory Neil Shapiro #define TLS_set_engine(id, prefork)	1
2792fb4f839SGregory Neil Shapiro #  endif
2805b0945b5SGregory Neil Shapiro # endif
2815b0945b5SGregory Neil Shapiro 
2825b0945b5SGregory Neil Shapiro extern int	set_tls_rd_tmo __P((int));
2835b0945b5SGregory Neil Shapiro extern int data2hex __P((unsigned char *, int, unsigned char *, int));
2845b0945b5SGregory Neil Shapiro # if DANE
285*d39bd2c1SGregory Neil Shapiro extern int pubkey_fp __P((X509 *, const char*, unsigned char **));
2865b0945b5SGregory Neil Shapiro extern dane_tlsa_P dane_get_tlsa __P((dane_vrfy_ctx_P));
2875b0945b5SGregory Neil Shapiro # endif
2885b0945b5SGregory Neil Shapiro 
2895b0945b5SGregory Neil Shapiro #else /* STARTTLS */
2905b0945b5SGregory Neil Shapiro # define set_tls_rd_tmo(rd_tmo)	0
2915b0945b5SGregory Neil Shapiro #endif /* STARTTLS */
2925b0945b5SGregory Neil Shapiro #undef EXTERN
2935b0945b5SGregory Neil Shapiro #endif /* ! _TLS_H */
294