Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Unified Diff: runtime/bin/secure_socket.cc

Issue 1308773005: Fix hostname checking problem in SecureSocket (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/standalone/io/certificates/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/secure_socket.cc
diff --git a/runtime/bin/secure_socket.cc b/runtime/bin/secure_socket.cc
index 12805872fbf3d75f96b8f37b8a1f0c5369cbf429..c32301d6b7adc557c25469a3efac0d7b6a810d7b 100644
--- a/runtime/bin/secure_socket.cc
+++ b/runtime/bin/secure_socket.cc
@@ -880,11 +880,12 @@ void SSLFilter::Connect(const char* hostname,
SetAlpnProtocolList(protocols_handle, ssl_, NULL, false);
// Sets the hostname in the certificate-checking object, so it is checked
// against the certificate presented by the server.
- X509_VERIFY_PARAM* certificate_checking_parameters_ = SSL_get0_param(ssl_);
+ X509_VERIFY_PARAM* certificate_checking_parameters = SSL_get0_param(ssl_);
hostname_ = strdup(hostname);
- X509_VERIFY_PARAM_set_hostflags(certificate_checking_parameters_, 0);
- X509_VERIFY_PARAM_set1_host(certificate_checking_parameters_,
- hostname_, 0);
+ X509_VERIFY_PARAM_set_hostflags(certificate_checking_parameters, 0);
+ X509_VERIFY_PARAM_set1_host(certificate_checking_parameters,
+ hostname_, strlen(hostname_));
+ // TODO(24225) Check return value of set1_host().
// TODO(24186) free hostname_ if it is not freed when SSL is destroyed.
// otherwise, make it a local variable, not a instance field.
}
« no previous file with comments | « no previous file | tests/standalone/io/certificates/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698