From b6943c39df71ebe511be192d102e6daf4dd99e5c Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 10 Oct 2016 16:33:13 -0700 Subject: [PATCH] Fix POP3 SASL authentication mechanism DIGEST-MD5. (closes #3862) sasl_client_step() returns SASL_OK after the fourth step: server auth confirmation. However, the protocol requires the client send one more blank line to the server, to which the server then replies with "+OK". See https://tools.ietf.org/html/rfc5034#section-6. The code currently only sends a final response if sasl_client_step returns data to send. Change it to always send a final client message after the SASL_OK. --- pop_auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pop_auth.c b/pop_auth.c index 8d8650e10..9eb080c81 100644 --- a/pop_auth.c +++ b/pop_auth.c @@ -121,7 +121,7 @@ static pop_auth_res_t pop_auth_sasl (POP_DATA *pop_data, const char *method) client_start = 0; } - if (rc != SASL_CONTINUE && (olen == 0 || rc != SASL_OK)) + if (rc != SASL_CONTINUE && rc != SASL_OK) break; /* send out response, or line break if none needed */ -- 2.50.0