ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/tls.h
Revision: 7164
Committed: Thu Jan 28 11:41:59 2016 UTC (9 years, 7 months ago) by michael
Content type: text/x-chdr
File size: 2132 byte(s)
Log Message:
- tls*: more copyright fixups

File Contents

# User Rev Content
1 michael 7105 /*
2     * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3     *
4 michael 7148 * Copyright (c) 2015 Attila Molnar <attilamolnar@hush.com>
5     * Copyright (c) 2015 Adam <Adam@anope.org>
6 michael 7164 * Copyright (c) 2015-2016 ircd-hybrid development team
7 michael 7105 *
8     * This program is free software; you can redistribute it and/or modify
9     * it under the terms of the GNU General Public License as published by
10     * the Free Software Foundation; either version 2 of the License, or
11     * (at your option) any later version.
12     *
13     * This program is distributed in the hope that it will be useful,
14     * but WITHOUT ANY WARRANTY; without even the implied warranty of
15     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16     * GNU General Public License for more details.
17     *
18     * You should have received a copy of the GNU General Public License
19     * along with this program; if not, write to the Free Software
20     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
21     * USA
22     */
23    
24     /*! \file tls.h
25     * \brief A header for generic TLS functions
26     * \version $Id$
27     */
28    
29     #ifndef INCLUDED_tls_h
30     #define INCLUDED_tls_h
31    
32     #ifdef HAVE_LIBCRYPTO
33     #include "tls_openssl.h"
34     #elif defined(HAVE_LIBGNUTLS)
35     #include "tls_gnutls.h"
36     #else
37     #include "tls_none.h"
38     #endif
39    
40     typedef enum _tls_role
41     {
42     TLS_ROLE_SERVER,
43     TLS_ROLE_CLIENT
44     } tls_role_t;
45    
46     typedef enum _tls_handshake_status
47     {
48     TLS_HANDSHAKE_DONE,
49     TLS_HANDSHAKE_WANT_READ,
50     TLS_HANDSHAKE_WANT_WRITE,
51     TLS_HANDSHAKE_ERROR
52     } tls_handshake_status_t;
53    
54     extern void tls_init(void);
55     extern int tls_new_cred(void);
56    
57     extern const char *tls_get_cipher(const tls_data_t *);
58    
59     extern int tls_isusing(tls_data_t *);
60     extern int tls_new(tls_data_t *, int, tls_role_t);
61     extern void tls_free(tls_data_t *);
62    
63     extern tls_handshake_status_t tls_handshake(tls_data_t *, tls_role_t, const char **);
64     extern int tls_read(tls_data_t *, char *, size_t, int *);
65     extern int tls_write(tls_data_t *, const char *, size_t, int *);
66    
67     extern void tls_shutdown(tls_data_t *);
68    
69     extern int tls_set_ciphers(tls_data_t *, const char *);
70    
71 michael 7142 extern int tls_verify_cert(tls_data_t *, tls_md_t, char **);
72 michael 7105
73     #endif /* INCLUDED_tls_h */

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision