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.
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 */