~ubuntu-branches/debian/sid/kamailio/sid

« back to all changes in this revision

Viewing changes to modules/tls/tls_init.c

  • Committer: Package Import Robot
  • Author(s): Victor Seva
  • Date: 2014-01-06 11:47:13 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20140106114713-t8xidp4arzrnyeya
Tags: 4.1.1-1
* New upstream release
* debian/patches:
  - add upstream fixes
* Added tls outbound websocket autheph dnssec modules
  - openssl exception added to their license
* removing sparc and ia64 from supported archs
  for mono module (Closes: #728915)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * $Id$
3
 
 *
4
 
 * TLS module - OpenSSL initialization funtions
5
 
 *
6
 
 * Copyright (C) 2001-2003 FhG FOKUS
7
 
 * Copyright (C) 2004,2005 Free Software Foundation, Inc.
 
1
/* 
 
2
 * TLS module
 
3
 *
8
4
 * Copyright (C) 2005,2006 iptelorg GmbH
9
5
 *
10
 
 * This file is part of SIP-router, a free SIP server.
11
 
 *
12
 
 * SIP-router is free software; you can redistribute it and/or modify
13
 
 * it under the terms of the GNU General Public License as published by
14
 
 * the Free Software Foundation; either version 2 of the License, or
15
 
 * (at your option) any later version
16
 
 *
17
 
 * SIP-router is distributed in the hope that it will be useful,
18
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 
 * GNU General Public License for more details.
21
 
 *
22
 
 * You should have received a copy of the GNU General Public License 
23
 
 * along with this program; if not, write to the Free Software 
24
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
 
 */
26
 
/*
27
 
 * History:
28
 
 * --------
29
 
 *  2007-01-26  openssl kerberos malloc bug detection/workaround (andrei)
30
 
 *  2007-02-23  openssl low memory bugs workaround (andrei)
 
6
 * Permission to use, copy, modify, and distribute this software for any
 
7
 * purpose with or without fee is hereby granted, provided that the above
 
8
 * copyright notice and this permission notice appear in all copies.
 
9
 *
 
10
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 
11
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 
12
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 
13
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 
14
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 
15
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 
16
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
31
17
 */
32
18
 
33
19
/*! \defgroup tls SIP-router TLS support
132
118
int openssl_kssl_malloc_bug=0; /* is openssl bug #1467 present ? */
133
119
#endif
134
120
 
135
 
const SSL_METHOD* ssl_methods[TLS_USE_SSLv23 + 1];
 
121
const SSL_METHOD* ssl_methods[TLS_METHOD_MAX];
136
122
 
137
123
#ifdef NO_TLS_MALLOC_DBG
138
124
#undef TLS_MALLOC_DBG /* extra malloc debug info from openssl */
341
327
 */
342
328
static void init_ssl_methods(void)
343
329
{
 
330
        memset(ssl_methods, 0, sizeof(ssl_methods));
 
331
 
344
332
#ifndef OPENSSL_NO_SSL2
345
333
        ssl_methods[TLS_USE_SSLv2_cli - 1] = SSLv2_client_method();
346
334
        ssl_methods[TLS_USE_SSLv2_srv - 1] = SSLv2_server_method();
350
338
        ssl_methods[TLS_USE_SSLv3_cli - 1] = SSLv3_client_method();
351
339
        ssl_methods[TLS_USE_SSLv3_srv - 1] = SSLv3_server_method();
352
340
        ssl_methods[TLS_USE_SSLv3 - 1] = SSLv3_method();
353
 
        
 
341
 
354
342
        ssl_methods[TLS_USE_TLSv1_cli - 1] = TLSv1_client_method();
355
343
        ssl_methods[TLS_USE_TLSv1_srv - 1] = TLSv1_server_method();
356
344
        ssl_methods[TLS_USE_TLSv1 - 1] = TLSv1_method();
357
 
        
 
345
 
358
346
        ssl_methods[TLS_USE_SSLv23_cli - 1] = SSLv23_client_method();
359
347
        ssl_methods[TLS_USE_SSLv23_srv - 1] = SSLv23_server_method();
360
348
        ssl_methods[TLS_USE_SSLv23 - 1] = SSLv23_method();
 
349
 
 
350
#if OPENSSL_VERSION_NUMBER >= 0x1000100fL
 
351
        ssl_methods[TLS_USE_TLSv1_1_cli - 1] = TLSv1_1_client_method();
 
352
        ssl_methods[TLS_USE_TLSv1_1_srv - 1] = TLSv1_1_server_method();
 
353
        ssl_methods[TLS_USE_TLSv1_1 - 1] = TLSv1_1_method();
 
354
#endif
 
355
 
 
356
#if OPENSSL_VERSION_NUMBER >= 0x1000105fL
 
357
        ssl_methods[TLS_USE_TLSv1_2_cli - 1] = TLSv1_2_client_method();
 
358
        ssl_methods[TLS_USE_TLSv1_2_srv - 1] = TLSv1_2_server_method();
 
359
        ssl_methods[TLS_USE_TLSv1_2 - 1] = TLSv1_2_method();
 
360
#endif
361
361
}
362
362
 
363
363