]>
jfr.im git - solanum.git/blob - librb/src/nossl.c
2 * librb: 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
26 #include <librb_config.h>
28 #if !defined(HAVE_OPENSSL) && !defined(HAVE_GNUTLS) && !defined(HAVE_MBEDTLS)
30 #include "arc4random.h"
32 #include <commio-int.h>
33 #include <commio-ssl.h>
36 rb_setup_ssl_server(const char *cert
__attribute__((unused
)), const char *keyfile
__attribute__((unused
)), const char *dhfile
__attribute__((unused
)), const char *cipher_list
__attribute__((unused
)))
51 rb_ssl_listen(rb_fde_t
*F
__attribute__((unused
)), int backlog
__attribute__((unused
)), int defer_accept
__attribute__((unused
)))
58 rb_stir_arc4random(void *unused
__attribute__((unused
)))
65 rb_init_prng(const char *path
__attribute__((unused
)), prng_seed_t seed_type
__attribute__((unused
)))
67 /* xxx this ignores the parameters above */
69 rb_event_addish("rb_stir_arc4random", rb_stir_arc4random
, NULL
, 300);
74 rb_get_random(void *buf
, size_t length
)
78 for(i
= 0; i
< length
; i
++)
89 rb_get_ssl_strerror(rb_fde_t
*F
__attribute__((unused
)))
91 static const char *nosupport
= "SSL/TLS not supported";
96 rb_get_ssl_certfp(rb_fde_t
*F
__attribute__((unused
)), uint8_t certfp
[RB_SSL_CERTFP_LEN
] __attribute__((unused
)), int method
__attribute__((unused
)))
102 rb_get_ssl_certfp_file(const char *filename
__attribute__((unused
)), uint8_t certfp
[RB_SSL_CERTFP_LEN
] __attribute__((unused
)), int method
__attribute__((unused
)))
108 rb_ssl_start_accepted(rb_fde_t
*new_F
__attribute__((unused
)), ACCB
* cb
__attribute__((unused
)), void *data
__attribute__((unused
)), int timeout
__attribute__((unused
)))
114 rb_ssl_start_connected(rb_fde_t
*F
__attribute__((unused
)), CNCB
* callback
__attribute__((unused
)), void *data
__attribute__((unused
)), int timeout
__attribute__((unused
)))
120 rb_connect_tcp_ssl(rb_fde_t
*F
__attribute__((unused
)), struct sockaddr
*dest
__attribute__((unused
)),
121 struct sockaddr
*clocal
__attribute__((unused
)), CNCB
* callback
__attribute__((unused
)), void *data
__attribute__((unused
)), int timeout
__attribute__((unused
)))
127 rb_supports_ssl(void)
133 rb_ssl_shutdown(rb_fde_t
*F
__attribute__((unused
)))
139 rb_ssl_accept_setup(rb_fde_t
*F
__attribute__((unused
)), rb_fde_t
*new_F
__attribute__((unused
)), struct sockaddr
*st
__attribute__((unused
)), int addrlen
__attribute__((unused
)))
145 rb_ssl_read(rb_fde_t
*F
__attribute__((unused
)), void *buf
__attribute__((unused
)), size_t count
__attribute__((unused
)))
152 rb_ssl_write(rb_fde_t
*F
__attribute__((unused
)), const void *buf
__attribute__((unused
)), size_t count
__attribute__((unused
)))
159 rb_ssl_handshake_count(rb_fde_t
*F
__attribute__((unused
)))
165 rb_ssl_clear_handshake_count(rb_fde_t
*F
__attribute__((unused
)))
171 rb_get_ssl_info(char *buf
__attribute__((unused
)), size_t len
__attribute__((unused
)))
173 snprintf(buf
, len
, "Not compiled with SSL support");
177 rb_ssl_get_cipher(rb_fde_t
*F
__attribute__((unused
)))
183 #endif /* !HAVE_OPENSSL */