jabberd2  2.3.3
Functions | Variables
ssl.c File Reference
#include "sx.h"
#include <openssl/x509_vfy.h>

Go to the source code of this file.

Functions

static int _sx_ssl_verify_callback (int preverify_ok, X509_STORE_CTX *ctx)
 this plugin implements the traditional SSL "wrappermode" streams and STARTTLS extension documented in xmpp-core More...
 
static int _sx_pem_passwd_callback (char *buf, int size, int rwflag, void *password)
 
static void _sx_ssl_starttls_notify_proceed (sx_t s, void *arg)
 
static int _sx_ssl_process (sx_t s, sx_plugin_t p, nad_t nad)
 
static void _sx_ssl_features (sx_t s, sx_plugin_t p, nad_t nad)
 
static void _sx_ssl_get_external_id (sx_t s, _sx_ssl_conn_t sc)
 
static int _sx_ssl_handshake (sx_t s, _sx_ssl_conn_t sc)
 
static int _sx_ssl_wio (sx_t s, sx_plugin_t p, sx_buf_t buf)
 
static int _sx_ssl_rio (sx_t s, sx_plugin_t p, sx_buf_t buf)
 
static void _sx_ssl_client (sx_t s, sx_plugin_t p)
 
static void _sx_ssl_server (sx_t s, sx_plugin_t p)
 
static void _sx_ssl_free (sx_t s, sx_plugin_t p)
 cleanup More...
 
static void _sx_ssl_unload (sx_plugin_t p)
 
int sx_ssl_init (sx_env_t env, sx_plugin_t p, va_list args)
 args: name, pemfile, cachain, mode More...
 
static RSA * sx_ssl_tmp_rsa_callback (SSL *ssl, int export, int keylength)
 
static DH * get_dh512 (void)
 
static DH * get_dh1024 (void)
 
static DH * sx_ssl_tmp_dh_callback (SSL *ssl, int export, int keylength)
 
static EC_KEY * sx_ssl_tmp_ecdh_callback (SSL *ssl, int export, int keylength)
 
int sx_ssl_server_addcert (sx_plugin_t p, const char *name, const char *pemfile, const char *cachain, int mode, const char *password)
 args: name, pemfile, cachain, mode More...
 
int sx_ssl_client_starttls (sx_plugin_t p, sx_t s, const char *pemfile, const char *private_key_password)
 

Variables

int sx_openssl_initialized = 0
 
RSA * rsa_512 = NULL
 
RSA * rsa_1024 = NULL
 
static unsigned char dh512_p []
 
static unsigned char dh512_g []
 
static unsigned char dh1024_p []
 
static unsigned char dh1024_g []
 
DH * dh_512 = NULL
 
DH * dh_1024 = NULL
 
EC_KEY * ec_256 = NULL
 

Function Documentation

static int _sx_ssl_verify_callback ( int  preverify_ok,
X509_STORE_CTX *  ctx 
)
static

this plugin implements the traditional SSL "wrappermode" streams and STARTTLS extension documented in xmpp-core

Definition at line 31 of file ssl.c.

References _sx_debug, and ZONE.

Referenced by sx_ssl_server_addcert().

static int _sx_pem_passwd_callback ( char *  buf,
int  size,
int  rwflag,
void *  password 
)
static

Definition at line 78 of file ssl.c.

Referenced by _sx_ssl_client(), and sx_ssl_server_addcert().

static void _sx_ssl_starttls_notify_proceed ( sx_t  s,
void *  arg 
)
static

Definition at line 85 of file ssl.c.

References _sx_debug, _sx_reset(), _sx_st::flags, _sx_st::req_to, sx_server_init(), SX_SSL_WRAPPER, and ZONE.

Referenced by _sx_ssl_process().

static int _sx_ssl_process ( sx_t  s,
sx_plugin_t  p,
nad_t  nad 
)
static
static void _sx_ssl_features ( sx_t  s,
sx_plugin_t  p,
nad_t  nad 
)
static
static void _sx_ssl_get_external_id ( sx_t  s,
_sx_ssl_conn_t  sc 
)
static

Definition at line 222 of file ssl.c.

References _sx_debug, SX_CONN_EXTERNAL_ID_MAX_COUNT, and ZONE.

Referenced by _sx_ssl_handshake().

static int _sx_ssl_handshake ( sx_t  s,
_sx_ssl_conn_t  sc 
)
static
static int _sx_ssl_wio ( sx_t  s,
sx_plugin_t  p,
sx_buf_t  buf 
)
static
static int _sx_ssl_rio ( sx_t  s,
sx_plugin_t  p,
sx_buf_t  buf 
)
static
static void _sx_ssl_client ( sx_t  s,
sx_plugin_t  p 
)
static
static void _sx_ssl_server ( sx_t  s,
sx_plugin_t  p 
)
static
static void _sx_ssl_free ( sx_t  s,
sx_plugin_t  p 
)
static
static void _sx_ssl_unload ( sx_plugin_t  p)
static

Definition at line 817 of file ssl.c.

References _sx_plugin_st::private, xhash_free(), xhash_iter_first(), xhash_iter_get(), and xhash_iter_next().

Referenced by sx_ssl_init().

int sx_ssl_init ( sx_env_t  env,
sx_plugin_t  p,
va_list  args 
)
static RSA* sx_ssl_tmp_rsa_callback ( SSL *  ssl,
int  export,
int  keylength 
)
static

Definition at line 882 of file ssl.c.

References rsa_1024, and rsa_512.

Referenced by sx_ssl_server_addcert().

static DH* get_dh512 ( void  )
static

Definition at line 909 of file ssl.c.

References dh512_g, and dh512_p.

Referenced by sx_ssl_tmp_dh_callback().

static DH* get_dh1024 ( void  )
static

Definition at line 942 of file ssl.c.

References dh1024_g, and dh1024_p.

Referenced by sx_ssl_tmp_dh_callback().

static DH* sx_ssl_tmp_dh_callback ( SSL *  ssl,
int  export,
int  keylength 
)
static

Definition at line 960 of file ssl.c.

References dh_1024, dh_512, get_dh1024(), and get_dh512().

Referenced by sx_ssl_server_addcert().

static EC_KEY* sx_ssl_tmp_ecdh_callback ( SSL *  ssl,
int  export,
int  keylength 
)
static

Definition at line 976 of file ssl.c.

References ec_256.

Referenced by sx_ssl_server_addcert().

int sx_ssl_server_addcert ( sx_plugin_t  p,
const char *  name,
const char *  pemfile,
const char *  cachain,
int  mode,
const char *  password 
)
int sx_ssl_client_starttls ( sx_plugin_t  p,
sx_t  s,
const char *  pemfile,
const char *  private_key_password 
)

Variable Documentation

int sx_openssl_initialized = 0

Definition at line 830 of file ssl.c.

Referenced by sx_ssl_init(), and sx_ssl_server_addcert().

RSA* rsa_512 = NULL

Definition at line 880 of file ssl.c.

Referenced by sx_ssl_tmp_rsa_callback().

RSA* rsa_1024 = NULL

Definition at line 881 of file ssl.c.

Referenced by sx_ssl_tmp_rsa_callback().

unsigned char dh512_p[]
static
Initial value:
= {
0xEC,0xAC,0xF9,0x92,0x4C,0x4E,0x5F,0x56,0xEC,0x15,0x7D,0xFD,
0xFD,0xAC,0x0B,0xC6,0xDB,0xAD,0x0D,0x62,0x76,0x43,0x07,0xAB,
0x1D,0x5A,0x8C,0xB6,0xE2,0xA7,0x48,0xEA,0xBE,0x91,0x22,0x9A,
0x6E,0xB2,0xC8,0xF6,0x4F,0xF5,0x7A,0xA5,0x7F,0x6E,0x08,0x7D,
0x4A,0x89,0xA0,0x54,0x2A,0x68,0x2D,0x06,0x59,0x89,0x32,0xF3,
0x3D,0xF7,0x74,0x1B,
}

Definition at line 897 of file ssl.c.

Referenced by get_dh512().

unsigned char dh512_g[]
static
Initial value:
= {
0x02,
}

Definition at line 905 of file ssl.c.

Referenced by get_dh512().

unsigned char dh1024_p[]
static

Definition at line 925 of file ssl.c.

Referenced by get_dh1024().

unsigned char dh1024_g[]
static
Initial value:
= {
0x02,
}

Definition at line 938 of file ssl.c.

Referenced by get_dh1024().

DH* dh_512 = NULL

Definition at line 958 of file ssl.c.

Referenced by sx_ssl_tmp_dh_callback().

DH* dh_1024 = NULL

Definition at line 959 of file ssl.c.

Referenced by sx_ssl_tmp_dh_callback().

EC_KEY* ec_256 = NULL

Definition at line 975 of file ssl.c.

Referenced by sx_ssl_tmp_ecdh_callback().