~ubuntu-branches/debian/squeeze/nginx/squeeze

« back to all changes in this revision

Viewing changes to src/mail/ngx_mail_ssl_module.c

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2009-11-08 09:53:46 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20091108095346-yt4eypw2l176tl53
Tags: 0.7.63-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
static char *ngx_mail_ssl_session_cache(ngx_conf_t *cf, ngx_command_t *cmd,
23
23
    void *conf);
24
24
 
25
 
#if !defined (SSL_OP_CIPHER_SERVER_PREFERENCE)
26
 
 
27
 
static char *ngx_mail_ssl_nosupported(ngx_conf_t *cf, ngx_command_t *cmd,
28
 
    void *conf);
29
 
 
30
 
static char  ngx_mail_ssl_openssl097[] = "OpenSSL 0.9.7 and higher";
31
 
 
32
 
#endif
33
 
 
34
25
 
35
26
static ngx_conf_enum_t  ngx_http_starttls_state[] = {
36
27
    { ngx_string("off"), NGX_MAIL_STARTTLS_OFF },
102
93
 
103
94
    { ngx_string("ssl_prefer_server_ciphers"),
104
95
      NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_FLAG,
105
 
#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
106
96
      ngx_conf_set_flag_slot,
107
97
      NGX_MAIL_SRV_CONF_OFFSET,
108
98
      offsetof(ngx_mail_ssl_conf_t, prefer_server_ciphers),
109
99
      NULL },
110
 
#else
111
 
      ngx_mail_ssl_nosupported, 0, 0, ngx_mail_ssl_openssl097 },
112
 
#endif
113
100
 
114
101
    { ngx_string("ssl_session_cache"),
115
102
      NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE12,
166
153
 
167
154
    scf = ngx_pcalloc(cf->pool, sizeof(ngx_mail_ssl_conf_t));
168
155
    if (scf == NULL) {
169
 
        return NGX_CONF_ERROR;
 
156
        return NULL;
170
157
    }
171
158
 
172
159
    /*
297
284
        }
298
285
    }
299
286
 
300
 
#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
301
 
 
302
287
    if (conf->prefer_server_ciphers) {
303
288
        SSL_CTX_set_options(conf->ssl.ctx, SSL_OP_CIPHER_SERVER_PREFERENCE);
304
289
    }
305
290
 
306
 
#endif
307
 
 
308
291
    if (ngx_ssl_generate_rsa512_key(&conf->ssl) != NGX_OK) {
309
292
        return NGX_CONF_ERROR;
310
293
    }
492
475
 
493
476
    return NGX_CONF_ERROR;
494
477
}
495
 
 
496
 
 
497
 
#if !defined (SSL_OP_CIPHER_SERVER_PREFERENCE)
498
 
 
499
 
static char *
500
 
ngx_mail_ssl_nosupported(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
501
 
{
502
 
    ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
503
 
                       "\"%V\" directive is available only in %s,",
504
 
                       &cmd->name, cmd->post);
505
 
 
506
 
    return NGX_CONF_ERROR;
507
 
}
508
 
 
509
 
#endif