Klaus Demo nginx / 945af2a
create salt just before it will be used Igor Sysoev 14 years ago
2 changed file(s) with 12 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
3737
3838 cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
3939
40 if (cscf->imap_auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED) {
41 if (ngx_mail_salt(s, c, cscf) != NGX_OK) {
42 ngx_mail_session_internal_server_error(s);
43 return;
44 }
45 }
46
4740 s->out.len = sizeof(imap_greeting) - 1;
4841 s->out.data = imap_greeting;
4942
390383 return NGX_MAIL_PARSE_INVALID_COMMAND;
391384 }
392385
386 if (s->salt.data == NULL) {
387 if (ngx_mail_salt(s, c, cscf) != NGX_OK) {
388 return NGX_ERROR;
389 }
390 }
391
393392 if (ngx_mail_auth_cram_md5_salt(s, c, "+ ", 2) == NGX_OK) {
394393 s->mail_state = ngx_imap_auth_cram_md5;
395394 return NGX_OK;
4545
4646 cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
4747
48 if (cscf->smtp_auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED) {
49 if (ngx_mail_salt(s, c, cscf) != NGX_OK) {
50 ngx_mail_session_internal_server_error(s);
51 return;
52 }
53 }
54
5548 timeout = cscf->smtp_greeting_delay ? cscf->smtp_greeting_delay:
5649 cscf->timeout;
5750 ngx_add_timer(c->read, timeout);
421414 return NGX_MAIL_PARSE_INVALID_COMMAND;
422415 }
423416
417 if (s->salt.data == NULL) {
418 if (ngx_mail_salt(s, c, cscf) != NGX_OK) {
419 return NGX_ERROR;
420 }
421 }
422
424423 if (ngx_mail_auth_cram_md5_salt(s, c, "334 ", 4) == NGX_OK) {
425424 s->mail_state = ngx_smtp_auth_cram_md5;
426425 return NGX_OK;