Merge libradsec-new-client.
[libradsec.git] / lib / rsp_tlscommon.h
1 /*
2  * Copyright (C) 2006-2008 Stig Venaas <venaas@uninett.no>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  */
8
9 #include <netinet/in.h>
10 #include <openssl/ssl.h>
11
12 #if defined (__cplusplus)
13 extern "C" {
14 #endif
15
16 struct tls {
17     char *name;
18     char *cacertfile;
19     char *cacertpath;
20     char *certfile;
21     char *certkeyfile;
22     char *certkeypwd;
23     uint8_t crlcheck;
24     char **policyoids;
25     uint32_t cacheexpiry;
26     uint32_t tlsexpiry;
27     uint32_t dtlsexpiry;
28     X509_VERIFY_PARAM *vpm;
29     SSL_CTX *tlsctx;
30     SSL_CTX *dtlsctx;
31 };
32
33 #if defined(RADPROT_TLS) || defined(RADPROT_DTLS)
34 void ssl_init();
35 struct tls *tlsgettls(char *alt1, char *alt2);
36 SSL_CTX *tlsgetctx(uint8_t type, struct tls *t);
37 X509 *verifytlscert(SSL *ssl);
38 int subjectaltnameaddr(X509 *cert, int family, const struct in6_addr *addr);
39 int subjectaltnameregexp(X509 *cert, int type, const char *exact,  const regex_t *regex);
40 int cnregexp(X509 *cert, const char *exact, const regex_t *regex);
41 int verifyconfcert(X509 *cert, struct clsrvconf *conf);
42 #endif
43
44 #if defined (__cplusplus)
45 }
46 #endif
47
48 /* Local Variables: */
49 /* c-file-style: "stroustrup" */
50 /* End: */