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) { |