GNU libmicrohttpd
0.9.29
|
TLS handling using libssl. The current code assumes that blocking I/O is in use. More...
Go to the source code of this file.
Functions | |
static int | spdyf_next_protos_advertised_cb (SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg) |
void | SPDYF_openssl_global_init () |
void | SPDYF_openssl_global_deinit () |
int | SPDYF_openssl_init (struct SPDY_Daemon *daemon) |
void | SPDYF_openssl_deinit (struct SPDY_Daemon *daemon) |
int | SPDYF_openssl_new_session (struct SPDY_Session *session) |
void | SPDYF_openssl_close_session (struct SPDY_Session *session) |
int | SPDYF_openssl_recv (struct SPDY_Session *session, void *buffer, size_t size) |
int | SPDYF_openssl_send (struct SPDY_Session *session, const void *buffer, size_t size) |
int | SPDYF_openssl_is_pending (struct SPDY_Session *session) |
int | SPDYF_openssl_before_write (struct SPDY_Session *session) |
int | SPDYF_openssl_after_write (struct SPDY_Session *session, int was_written) |
TLS handling using libssl. The current code assumes that blocking I/O is in use.
Definition in file io_openssl.c.
|
static |
Callback to advertise spdy ver. 3 in Next Protocol Negotiation
ssl | openssl context for a connection |
out | must be set to the raw data that is advertised in NPN |
outlen | must be set to size of out |
arg |
Definition at line 42 of file io_openssl.c.
Referenced by SPDYF_openssl_init().
int SPDYF_openssl_after_write | ( | struct SPDY_Session * | session, |
int | was_written | ||
) |
Nothing.
session | |
was_written | has the same value as the write function for the session will return |
Definition at line 275 of file io_openssl.c.
Referenced by SPDYF_io_set_session().
int SPDYF_openssl_before_write | ( | struct SPDY_Session * | session | ) |
Nothing.
session |
Definition at line 266 of file io_openssl.c.
References SPDY_YES.
Referenced by SPDYF_io_set_session().
void SPDYF_openssl_close_session | ( | struct SPDY_Session * | session | ) |
Deinitializing openssl for a specific connection. Should be called closing session's socket.
session | SPDY_Session whose socket is used by openssl |
Definition at line 170 of file io_openssl.c.
References SPDY_Session::io_context.
Referenced by SPDYF_io_set_session().
void SPDYF_openssl_deinit | ( | struct SPDY_Daemon * | daemon | ) |
Deinitializing openssl for a daemon. Should be called when the deamon is stopped.
daemon | SPDY_Daemon which is being stopped |
Definition at line 127 of file io_openssl.c.
References SPDY_Daemon::io_context.
Referenced by SPDYF_io_set_daemon().
void SPDYF_openssl_global_deinit | ( | ) |
Global deinitializing of openssl for the whole program. Should be called at the end of the program.
Definition at line 68 of file io_openssl.c.
Referenced by SPDY_deinit().
void SPDYF_openssl_global_init | ( | ) |
Global initializing of openssl. Must be called only once in the program.
Definition at line 56 of file io_openssl.c.
Referenced by SPDY_init().
int SPDYF_openssl_init | ( | struct SPDY_Daemon * | daemon | ) |
Initializing of openssl for a specific daemon. Must be called when the daemon starts.
daemon | SPDY_Daemon for which openssl will be used. Daemon's certificate and key file are used. |
Definition at line 78 of file io_openssl.c.
References SPDY_Daemon::certfile, SPDY_Daemon::io_context, SPDY_Daemon::keyfile, NULL, SPDY_NO, SPDY_YES, SPDYF_DEBUG, and spdyf_next_protos_advertised_cb().
Referenced by SPDYF_io_set_daemon().
int SPDYF_openssl_is_pending | ( | struct SPDY_Session * | session | ) |
Checks if there is data staying in the buffers of the underlying system that waits to be read.
session | which is checked |
Definition at line 255 of file io_openssl.c.
References SPDY_Session::io_context, SPDY_NO, and SPDY_YES.
Referenced by SPDYF_io_set_session().
int SPDYF_openssl_new_session | ( | struct SPDY_Session * | session | ) |
Initializing openssl for a specific connection. Must be called after the connection has been accepted.
session | SPDY_Session whose socket will be used by openssl |
Definition at line 134 of file io_openssl.c.
References SPDY_Session::daemon, SPDY_Session::io_context, SPDY_Daemon::io_context, NULL, SPDY_Session::socket_fd, SPDY_NO, SPDY_YES, and SPDYF_DEBUG.
Referenced by SPDYF_io_set_session().
int SPDYF_openssl_recv | ( | struct SPDY_Session * | session, |
void * | buffer, | ||
size_t | size | ||
) |
Reading from a TLS socket. Reads available data and put it to the buffer.
session | for which data is received |
buffer | where data from the socket will be written to |
size | of the buffer |
Definition at line 184 of file io_openssl.c.
References SPDY_Session::io_context, SPDY_IO_ERROR_AGAIN, and SPDY_IO_ERROR_ERROR.
Referenced by SPDYF_io_set_session().
int SPDYF_openssl_send | ( | struct SPDY_Session * | session, |
const void * | buffer, | ||
size_t | size | ||
) |
Writing to a TLS socket. Writes the data given into the buffer to the TLS socket.
session | whose context is used |
buffer | from where data will be written to the socket |
size | number of bytes to be taken from the buffer |
Definition at line 219 of file io_openssl.c.
References SPDY_Session::io_context, SPDY_IO_ERROR_AGAIN, and SPDY_IO_ERROR_ERROR.
Referenced by SPDYF_io_set_session().