File src/dinoex_ssl.c

* by Dirk Meyer (dinoex) * Copyright (C) 2004-2011 Dirk Meyer * * By using this file, you agree to the terms and conditions set * forth in the GNU General Public License. More information is * available in the LICENSE file. * * If you received this file without documentation, it can be * downloaded from http://iroffer.dinoex.net/ * * $Id: dinoex_ssl.c,v 1.27 2012/07/19 17:48:47 cvs Exp $ *


Included Files

include the headers


Preprocessor definitions

#define _LONGLONG 1

Global Function close_server()

close connection to server, shutdown SSL if active

void close_server ( void )

Prototyped in: src/dinoex_ssl.h
Calls: shutdown_close() src/dinoex_kqueue.c
  SSL_free()
Called by: ir_parseline2() src/dinoex_irc.c
  irc_perform() src/dinoex_irc.c
  irc_server_timeout() src/dinoex_irc.c
  mainloop() src/iroffer_main.c
  quit_server() src/iroffer_misc.c
  retry_ssl() src/dinoex_ssl.c
  sendserver() src/iroffer_misc.c
  setup_ssl() src/dinoex_ssl.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function handshake_ssl()

setup ssl connection if configured

void handshake_ssl ( void )

Prototyped in: src/dinoex_ssl.h
Calls: handshake2_ssl() src/dinoex_ssl.c
  initirc() src/iroffer_misc.c
  updatecontext_f() src/iroffer_utilities.c
Called by: irc_perform() src/dinoex_irc.c

Global Function readserver_ssl()

read buffer from server, use SSL if active

ssize_t readserver_ssl ( void* buf, size_t nbytes )

Prototyped in: src/dinoex_ssl.h
Calls: SSL_read(), recv()
Called by: irc_perform() src/dinoex_irc.c
References Variables: gnetwork src/dinoex_main.c

Global Function ssl_startup()

setup SSL lib

void ssl_startup ( void )

Prototyped in: src/dinoex_ssl.h
Calls: SSL_library_init(), SSL_load_error_strings()
Called by: startup_dinoex() src/dinoex_misc.c

Global Function writeserver_ssl()

write out buffer to server, use SSL if active

ssize_t writeserver_ssl ( const void* buf, size_t nbytes )

Prototyped in: src/dinoex_ssl.h
Calls: SSL_write(), send()
Called by: mainloop() src/iroffer_main.c
  sendserver() src/iroffer_misc.c
  shutdowniroffer() src/iroffer_misc.c
  vwriteserver() src/iroffer_misc.c
References Variables: gnetwork src/dinoex_main.c

Local Function handshake2_ssl()

static int handshake2_ssl ( void )
Calls: retry_ssl() src/dinoex_ssl.c
  setup_ssl() src/dinoex_ssl.c
Called by: handshake_ssl() src/dinoex_ssl.c
References Variables: gnetwork src/dinoex_main.c

Local Function keyfile_present()

static char* keyfile_present ( const char* suffix )
Calls: mydelete2() src/iroffer_utilities.c
  mystrsuffix2() src/dinoex_utilities.c
  close(), open()
Called by: load_network_key() src/dinoex_ssl.c
References Variables: gnetwork src/dinoex_main.c

Local Function load_network_key()

static void load_network_key ( void )
Calls: keyfile_present() src/dinoex_ssl.c
  load_ssl_cert() src/dinoex_ssl.c
  load_ssl_key() src/dinoex_ssl.c
  mydelete2() src/iroffer_utilities.c
Called by: setup_ssl() src/dinoex_ssl.c

Local Function load_ssl_cert()

static void load_ssl_cert ( const char* filename )
Calls: outerror_ssl() src/dinoex_ssl.c
  SSL_CTX_use_certificate_file()
Called by: load_network_key() src/dinoex_ssl.c
References Variables: gnetwork src/dinoex_main.c

Local Function load_ssl_key()

static void load_ssl_key ( const char* filename )
Calls: outerror_ssl() src/dinoex_ssl.c
  SSL_CTX_use_PrivateKey_file()
Called by: load_network_key() src/dinoex_ssl.c
References Variables: gnetwork src/dinoex_main.c

Local Function outerror_ssl()

static unsigned long outerror_ssl ( void )
Calls: outerror() src/iroffer_utilities.c
  ERR_error_string(), ERR_get_error()
Called by: load_ssl_cert() src/dinoex_ssl.c
  load_ssl_key() src/dinoex_ssl.c
  retry_ssl() src/dinoex_ssl.c
  setup_ssl() src/dinoex_ssl.c

Local Function retry_ssl()

retry setup an SSL connection

static int retry_ssl ( void )

Calls: close_server() src/dinoex_ssl.c
  outerror() src/iroffer_utilities.c
  outerror_ssl() src/dinoex_ssl.c
  updatecontext_f() src/iroffer_utilities.c
  SSL_connect()
Called by: handshake2_ssl() src/dinoex_ssl.c
  setup_ssl() src/dinoex_ssl.c
References Variables: gnetwork src/dinoex_main.c

Local Function setup_ssl()

setup an SSL connection

static int setup_ssl ( void )

Calls: close_server() src/dinoex_ssl.c
  load_network_key() src/dinoex_ssl.c
  outerror() src/iroffer_utilities.c
  outerror_ssl() src/dinoex_ssl.c
  retry_ssl() src/dinoex_ssl.c
  updatecontext_f() src/iroffer_utilities.c
  SSL_CTX_new(), SSL_new(), SSL_set_fd(), SSLv3_client_method()
Called by: handshake2_ssl() src/dinoex_ssl.c
References Variables: gnetwork src/dinoex_main.c