comparison src/mail/ngx_mail.h @ 571:5938746e70c2 PATCH_NGINX_MAIL_0_8

Mail: get rid of ugly protocol check in ngx_mail_auth_parse(). Instead, use index of argument which holds authentication mechanism name. For IMAP and POP3 it's 0, for SMTP - 1 as SMTP preserves command in first argument to allow pipelining support. While here, add check that we actually have argument holding authentication mechanism name. Currently IMAP has no appropriate checks before calling ngx_mail_auth_parse() which results in possible access of uninitialized memory.
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 27 Sep 2009 00:52:15 +0400
parents 9773720b845e
children 0b460e61bdcd
comparison
equal deleted inserted replaced
570:9773720b845e 571:5938746e70c2
378 ngx_int_t ngx_mail_auth_login_password(ngx_mail_session_t *s, 378 ngx_int_t ngx_mail_auth_login_password(ngx_mail_session_t *s,
379 ngx_connection_t *c); 379 ngx_connection_t *c);
380 ngx_int_t ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s, 380 ngx_int_t ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s,
381 ngx_connection_t *c, char *prefix, size_t len); 381 ngx_connection_t *c, char *prefix, size_t len);
382 ngx_int_t ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c); 382 ngx_int_t ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c);
383 ngx_int_t ngx_mail_auth_parse(ngx_mail_session_t *s, ngx_connection_t *c); 383 ngx_int_t ngx_mail_auth_parse(ngx_mail_session_t *s, ngx_connection_t *c,
384 ngx_uint_t n);
384 385
385 void ngx_mail_send(ngx_event_t *wev); 386 void ngx_mail_send(ngx_event_t *wev);
386 ngx_int_t ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c); 387 ngx_int_t ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c);
387 void ngx_mail_auth(ngx_mail_session_t *s, ngx_connection_t *c); 388 void ngx_mail_auth(ngx_mail_session_t *s, ngx_connection_t *c);
388 void ngx_mail_close_connection(ngx_connection_t *c); 389 void ngx_mail_close_connection(ngx_connection_t *c);