Commit 5e2f8ad6 5e2f8ad608c9ec774b952bd39b684baabb8e228a by Simon Josefsson Committed by Sergey Poznyakoff

SASL related fixes.

* imap4d/auth_gsasl.c (auth_gsasl): Make IMAP server wait
for empty final client response.
* include/mailutils/gsasl.h (mu_gsasl_stream_create): Don't
use deprecated GNU SASL types.
1 parent 352b446b
......@@ -109,10 +109,19 @@ auth_gsasl (struct imap4d_command *command, char *auth_type, char **username)
return RESP_NO;
}
/* Some SASL mechanisms output data when GSASL_OK is returned */
/* Some SASL mechanisms output additional data when GSASL_OK is
returned, and clients must respond with an empty response. */
if (output[0])
util_send ("+ %s\r\n", output);
{
util_send ("+ %s\r\n", output);
imap4d_getline (&input_str, &input_size, &input_len);
if (input_len != 0)
{
mu_diag_output (MU_DIAG_NOTICE, _("non-empty client response"));
return RESP_NO;
}
}
free (output);
if (*username == NULL)
......
......@@ -37,8 +37,7 @@ struct mu_gsasl_module_data mu_gsasl_module_data;
#include <gsasl.h>
int mu_gsasl_stream_create (mu_stream_t *stream, mu_stream_t transport,
Gsasl_session_ctx *ctx,
int flags);
Gsasl_session *ctx, int flags);
#endif
......
......@@ -235,7 +235,7 @@ _gsasl_wait (mu_stream_t stream, int *pflags, struct timeval *tvp)
int
mu_gsasl_stream_create (mu_stream_t *stream, mu_stream_t transport,
Gsasl_session *ctx, int flags)
Gsasl_session *ctx, int flags)
{
struct _gsasl_stream *s;
int rc;
......