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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 8429034: Upstream: Build net_unittests for Android. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 2 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
Index: net/socket/ssl_client_socket_openssl.cc
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index fa7f2a17857a1bf327b0a94be0ef0f206b14240d..1138ad468bf1d062b83795e6641fc7a4f35eb9de 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -792,10 +792,22 @@ int SSLClientSocketOpenSSL::SelectNextProtoCallback(unsigned char** out,
return SSL_TLSEXT_ERR_OK;
}
- int status = SSL_select_next_proto(
- out, outlen, in, inlen,
- reinterpret_cast<const unsigned char*>(ssl_config_.next_protos.data()),
- ssl_config_.next_protos.size());
+ int status = OPENSSL_NPN_UNSUPPORTED;
+ for (unsigned int i = 0; i < inlen; i++) {
+ for (std::vector<std::string>::const_iterator
+ j = ssl_config_.next_protos.begin();
+ j != ssl_config_.next_protos.end(); j++) {
+ if (in[i] == j->size() &&
+ memcmp(&in[i + 1], j->data(), in[i]) == 0) {
+ *out = (unsigned char *)in + i + 1;
+ *outlen = in[i];
+ status = OPENSSL_NPN_NEGOTIATED;
+ break;
+ }
+ }
+ if (status == OPENSSL_NPN_NEGOTIATED)
+ break;
+ }
michaelbai 2011/11/01 16:37:59 It seemed that this code is not android specific,
Jing Zhao 2011/11/02 16:22:55 http://codereview.chromium.org/8156001/ This chang
npn_proto_.assign(reinterpret_cast<const char*>(*out), *outlen);
switch (status) {
« net/net.gyp ('K') | « net/net.gyp ('k') | net/spdy/spdy_protocol_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698