tls_init.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  * 
00004  * TLS module - OpenSSL initialization funtions
00005  *
00006  * Copyright (C) 2001-2003 FhG FOKUS
00007  * Copyright (C) 2004,2005 Free Software Foundation, Inc.
00008  * Copyright (C) 2005,2006 iptelorg GmbH
00009  *
00010  * This file is part of ser, a free SIP server.
00011  *
00012  * ser is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version
00016  *
00017  * For a license to use the ser software under conditions
00018  * other than those described here, or to purchase support for this
00019  * software, please contact iptel.org by e-mail at the following addresses:
00020  *    info@iptel.org
00021  *
00022  * ser is distributed in the hope that it will be useful,
00023  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00024  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025  * GNU General Public License for more details.
00026  *
00027  * You should have received a copy of the GNU General Public License 
00028  * along with this program; if not, write to the Free Software 
00029  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00030  */
00039 #ifndef _TLS_INIT_H
00040 #define _TLS_INIT_H
00041 
00042 #include <openssl/ssl.h>
00043 #include "../../ip_addr.h"
00044 #include "tls_domain.h"
00045 
00046 /* openssl < 1. 0 */
00047 #if OPENSSL_VERSION_NUMBER < 0x01000000L
00048 /* alternative: check ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME */
00049 #define OPENSSL_NO_TLSEXT
00050 #endif /* OPENSSL_VERION < 1.0 */
00051 #ifndef OPENSSL_NO_KRB5
00052 /* enable workarround for openssl kerberos wrong malloc bug
00053  * (kssl code uses libc malloc/free/calloc instead of OPENSSL_malloc & 
00054  * friends)*/
00055 #define TLS_KSSL_WORKARROUND
00056 extern int openssl_kssl_malloc_bug; /* is openssl bug #1467 present ? */
00057 #endif
00058 
00059 
00060 extern const SSL_METHOD* ssl_methods[];
00061 
00062 
00063 /*
00064  * just once, pre-initialize the tls subsystem
00065  */
00066 int tls_pre_init(void);
00067 
00068 /*
00069  * just once, initialize the tls subsystem 
00070  */
00071 int init_tls_h(void);
00072 
00073 
00074 /*
00075  * just once before cleanup 
00076  */
00077 void destroy_tls_h(void);
00078 
00079 
00080 /*
00081  * for each socket 
00082  */
00083 int tls_h_init_si(struct socket_info *si);
00084 
00085 /*
00086  * Make sure that all server domains in the configuration have corresponding
00087  * listening socket in SER
00088  */
00089 int tls_check_sockets(tls_domains_cfg_t* cfg);
00090 
00091 #endif /* _TLS_INIT_H */