]> git.sesse.net Git - vlc/blob - include/vlc_tls.h
Initial partial SSL/TLS support (to be continued)
[vlc] / include / vlc_tls.h
1 /*****************************************************************************
2  * tls.c
3  *****************************************************************************
4  * Copyright (C) 2004 VideoLAN
5  * $Id: httpd.c 8263 2004-07-24 09:06:58Z courmisch $
6  *
7  * Authors: Remi Denis-Courmont <courmisch@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24
25 /*****************************************************************************
26  * tls_ServerCreate:
27  *****************************************************************************
28  * Allocates a whole server's TLS credentials.
29  * Returns NULL on error.
30  *****************************************************************************/
31 VLC_EXPORT( tls_server_t *, tls_ServerCreate, ( vlc_object_t *, const char *, const char * ) );
32
33
34 /*****************************************************************************
35  * tls_ServerAddCA:
36  *****************************************************************************
37  * Adds one or more certificate authorities.
38  * Returns -1 on error, 0 on success.
39  *****************************************************************************/
40 VLC_EXPORT( int, tls_ServerAddCA, ( tls_server_t *, const char * ) );
41
42
43 /*****************************************************************************
44  * tls_ServerAddCRL:
45  *****************************************************************************
46  * Adds a certificates revocation list to be sent to TLS clients.
47  * Returns -1 on error, 0 on success.
48  *****************************************************************************/
49 VLC_EXPORT( int, tls_ServerAddCRL, ( tls_server_t *, const char * ) );
50
51
52 VLC_EXPORT( void, tls_ServerDelete, ( tls_server_t * ) );
53
54
55 tls_session_t *
56 tls_ServerSessionPrepare( const tls_server_t *p_server );
57
58 tls_session_t *
59 tls_SessionHandshake( tls_session_t *p_session, int fd );
60
61 void
62 tls_SessionClose( tls_session_t *p_session );
63
64 int
65 tls_Send( tls_session_t *p_session, const char *buf, int i_length );
66
67 int
68 tls_Recv( tls_session_t *p_session, char *buf, int i_length );