da2092ea4a3f37d1dc901d90831e9a1b45ca3976
[radsecproxy.git] / lib / radsecproxy / tlscommon.h
1 /* Copyright (c) 2007-2009, UNINETT AS */
2 /* See LICENSE for licensing information. */
3
4 #include <netinet/in.h>
5 #include <openssl/ssl.h>
6
7 #if defined (__cplusplus)
8 extern "C" {
9 #endif
10
11 struct tls {
12     char *name;
13     char *cacertfile;
14     char *cacertpath;
15     char *certfile;
16     char *certkeyfile;
17     char *certkeypwd;
18     uint8_t crlcheck;
19     char **policyoids;
20     uint32_t cacheexpiry;
21     uint32_t tlsexpiry;
22     uint32_t dtlsexpiry;
23     X509_VERIFY_PARAM *vpm;
24     SSL_CTX *tlsctx;
25     SSL_CTX *dtlsctx;
26 };
27
28 #if defined(RADPROT_TLS) || defined(RADPROT_DTLS)
29 void ssl_init();
30 struct tls *tlsgettls(char *alt1, char *alt2);
31 SSL_CTX *tlsgetctx(uint8_t type, struct tls *t);
32 X509 *verifytlscert(SSL *ssl);
33 int subjectaltnameaddr(X509 *cert, int family, const struct in6_addr *addr);
34 int subjectaltnameregexp(X509 *cert, int type, const char *exact,  const regex_t *regex);
35 int cnregexp(X509 *cert, const char *exact, const regex_t *regex);
36 int verifyconfcert(X509 *cert, struct clsrvconf *conf);
37 #endif
38
39 #if defined (__cplusplus)
40 }
41 #endif
42
43 /* Local Variables: */
44 /* c-file-style: "stroustrup" */
45 /* End: */