Handle the case where we get an -ERR message during the SASL exchange.
if (line == NULL)
return NOTOK;
- if (len < 2 || (len == 2 && strcmp(line, "+ ") != 0)) {
+
+ /*
+ * If we get an -ERR reply, bubble that back up
+ */
+
+ if (has_prefix(line, "-ERR")) {
+ netsec_err(errstr, "%s", line);
+ return NOTOK;
+ }
+
+ /*
+ * Make sure we get someting back a valid response
+ */
+
+ if (!has_prefix(line, "+ ")) {
netsec_err(errstr, "Invalid format for SASL response");
return NOTOK;
}