5a6d262f65e639aab149da30ad1da2c33f5e731e
[radsecproxy.git] / 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 SSL_CTX *tlsgetctx(uint8_t type, struct tls *t);
30 X509 *verifytlscert(SSL *ssl);
31 int subjectaltnameaddr(X509 *cert, int family, const struct in6_addr *addr);
32 int subjectaltnameregexp(X509 *cert, int type, const char *exact,  const regex_t *regex);
33 int cnregexp(X509 *cert, const char *exact, const regex_t *regex);
34 #endif
35
36 #if defined (__cplusplus)
37 }
38 #endif
39
40 /* Local Variables: */
41 /* c-file-style: "stroustrup" */
42 /* End: */