Mercurial > hg > nginx
diff src/mail/ngx_mail_smtp_handler.c @ 1485:b3488fc2675a
create salt just before it will be used
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 14 Sep 2007 15:00:19 +0000 |
parents | c788d2b877be |
children | 0e7074ef7303 |
line wrap: on
line diff
--- a/src/mail/ngx_mail_smtp_handler.c Fri Sep 14 14:56:46 2007 +0000 +++ b/src/mail/ngx_mail_smtp_handler.c Fri Sep 14 15:00:19 2007 +0000 @@ -46,13 +46,6 @@ cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); - if (cscf->smtp_auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED) { - if (ngx_mail_salt(s, c, cscf) != NGX_OK) { - ngx_mail_session_internal_server_error(s); - return; - } - } - timeout = cscf->smtp_greeting_delay ? cscf->smtp_greeting_delay: cscf->timeout; ngx_add_timer(c->read, timeout); @@ -422,6 +415,12 @@ return NGX_MAIL_PARSE_INVALID_COMMAND; } + if (s->salt.data == NULL) { + if (ngx_mail_salt(s, c, cscf) != NGX_OK) { + return NGX_ERROR; + } + } + if (ngx_mail_auth_cram_md5_salt(s, c, "334 ", 4) == NGX_OK) { s->mail_state = ngx_smtp_auth_cram_md5; return NGX_OK;