~ubuntu-branches/ubuntu/saucy/exim4/saucy

« back to all changes in this revision

Viewing changes to src/tls.c

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-14 15:28:08 UTC
  • mfrom: (2.3.18 experimental) (2.1.22 sid)
  • Revision ID: package-import@ubuntu.com-20120614152808-jeyix4g9r95iy6j9
Tags: 4.80-3ubuntu1
* Merge from Debian unstable. Remaining changes:
  - debian/control: Don't declare a Provides: default-mta; in Ubuntu,
    we want postfix to be the default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Cambridge: exim/src/src/tls.c,v 1.6 2009/11/16 19:50:37 nm4 Exp $ */
2
 
 
3
1
/*************************************************
4
2
*     Exim - an Internet mail transport agent    *
5
3
*************************************************/
6
4
 
7
 
/* Copyright (c) University of Cambridge 1995 - 2009 */
 
5
/* Copyright (c) University of Cambridge 1995 - 2012 */
8
6
/* See the file NOTICE for conditions of use and distribution. */
9
7
 
10
8
/* This module provides TLS (aka SSL) support for Exim. The code for OpenSSL is
32
30
#else
33
31
 
34
32
/* Static variables that are used for buffering data by both sets of
35
 
functions and the common functions below. */
36
 
 
37
 
 
 
33
functions and the common functions below.
 
34
 
 
35
We're moving away from this; GnuTLS is already using a state, which
 
36
can switch, so we can do TLS callouts during ACLs. */
 
37
 
 
38
static const int ssl_xfer_buffer_size = 4096;
 
39
#ifndef USE_GNUTLS
38
40
static uschar *ssl_xfer_buffer = NULL;
39
 
static int ssl_xfer_buffer_size = 4096;
40
41
static int ssl_xfer_buffer_lwm = 0;
41
42
static int ssl_xfer_buffer_hwm = 0;
42
43
static int ssl_xfer_eof = 0;
43
44
static int ssl_xfer_error = 0;
 
45
#endif
44
46
 
 
47
uschar *tls_channelbinding_b64 = NULL;
45
48
 
46
49
 
47
50
/*************************************************
60
63
*/
61
64
 
62
65
static BOOL
63
 
expand_check(uschar *s, uschar *name, uschar **result)
 
66
expand_check(const uschar *s, const uschar *name, uschar **result)
64
67
{
65
68
if (s == NULL) *result = NULL; else
66
69
  {
67
 
  *result = expand_string(s);
 
70
  *result = expand_string(US s); /* need to clean up const some more */
68
71
  if (*result == NULL && !expand_string_forcedfail)
69
72
    {
70
73
    log_write(0, LOG_MAIN|LOG_PANIC, "expansion of %s failed: %s", name,
82
85
 
83
86
#ifdef USE_GNUTLS
84
87
#include "tls-gnu.c"
 
88
 
 
89
#define ssl_xfer_buffer (current_global_tls_state->xfer_buffer)
 
90
#define ssl_xfer_buffer_lwm (current_global_tls_state->xfer_buffer_lwm)
 
91
#define ssl_xfer_buffer_hwm (current_global_tls_state->xfer_buffer_hwm)
 
92
#define ssl_xfer_eof (current_global_tls_state->xfer_eof)
 
93
#define ssl_xfer_error (current_global_tls_state->xfer_error)
 
94
 
85
95
#else
86
96
#include "tls-openssl.c"
87
97
#endif