]>
jfr.im git - solanum.git/blob - libratbox/src/nossl.c
2 * libratbox: a library used by ircd-ratbox and other things
3 * nossl.c: ssl stub code
5 * Copyright (C) 2007-2008 ircd-ratbox development team
6 * Copyright (C) 2007-2008 Aaron Sethman <androsyn@ratbox.org>
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.
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.
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
23 * $Id: commio.c 24808 2008-01-02 08:17:05Z androsyn $
27 #include <libratbox_config.h>
28 #include <ratbox_lib.h>
29 #if !defined(HAVE_OPENSSL) && !defined(HAVE_GNUTLS) && !defined(HAVE_MBEDTLS)
31 #include "arc4random.h"
33 #include <commio-int.h>
34 #include <commio-ssl.h>
37 rb_setup_ssl_server(const char *cert
, const char *keyfile
, const char *dhfile
, const char *cipher_list
)
52 rb_ssl_listen(rb_fde_t
*F
, int backlog
, int defer_accept
)
59 rb_stir_arc4random(void *unused
)
66 rb_init_prng(const char *path
, prng_seed_t seed_type
)
68 /* xxx this ignores the parameters above */
70 rb_event_addish("rb_stir_arc4random", rb_stir_arc4random
, NULL
, 300);
75 rb_get_random(void *buf
, size_t length
)
79 for(i
= 0; i
< length
; i
++)
90 rb_get_ssl_strerror(rb_fde_t
*F
)
92 static const char *nosupport
= "SSL/TLS not supported";
97 rb_get_ssl_certfp(rb_fde_t
*F
, uint8_t certfp
[RB_SSL_CERTFP_LEN
], int method
)
103 rb_ssl_start_accepted(rb_fde_t
*new_F
, ACCB
* cb
, void *data
, int timeout
)
109 rb_ssl_start_connected(rb_fde_t
*F
, CNCB
* callback
, void *data
, int timeout
)
115 rb_connect_tcp_ssl(rb_fde_t
*F
, struct sockaddr
*dest
,
116 struct sockaddr
*clocal
, int socklen
, CNCB
* callback
, void *data
, int timeout
)
122 rb_supports_ssl(void)
128 rb_ssl_shutdown(rb_fde_t
*F
)
134 rb_ssl_accept_setup(rb_fde_t
*F
, rb_fde_t
*new_F
, struct sockaddr
*st
, int addrlen
)
140 rb_ssl_read(rb_fde_t
*F
, void *buf
, size_t count
)
147 rb_ssl_write(rb_fde_t
*F
, const void *buf
, size_t count
)
154 rb_ssl_handshake_count(rb_fde_t
*F
)
160 rb_ssl_clear_handshake_count(rb_fde_t
*F
)
166 rb_get_ssl_info(char *buf
, size_t len
)
168 rb_snprintf(buf
, len
, "Not compiled with SSL support");
172 rb_ssl_get_certfp(rb_fde_t
*F
, uint8_t certfp
[RB_SSL_CERTFP_LEN
])
179 rb_ssl_get_cipher(rb_fde_t
*F
)
185 #endif /* !HAVE_OPENSSL */