Fix STARTTLS detection. The previous code was not an impressive demonstration of clear thinking and could reject cases where STARTTLS was actually supported. Change-Id: I27ce8b401447a49be93f58c9e4eb5c5d8e7b73d4 Reviewed-on: https://boringssl-review.googlesource.com/10241 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/tool/transport_common.cc b/tool/transport_common.cc index ed1bc0f..23fa3bb 100644 --- a/tool/transport_common.cc +++ b/tool/transport_common.cc
@@ -535,8 +535,7 @@ } // https://tools.ietf.org/html/rfc1869#section-4.3 - if (reply_250.find("\nSTARTTLS\n") == std::string::npos && - reply_250.find("\nSTARTTLS") != reply_250.size() - 8) { + if (("\n" + reply_250 + "\n").find("\nSTARTTLS\n") == std::string::npos) { fprintf(stderr, "Server does not support STARTTLS\n"); return false; }