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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 1076063002: Remove certificates from Channel ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Udpate KeysEqual to fail if preconditions fail Created 5 years, 7 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 | « net/socket/ssl_client_socket_openssl.h ('k') | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 89d2952875b1b5c6c0a720b3c960e457c44100ed..18441a3e1de30c48ef8f88b03f74cd879f5a86df 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -1027,9 +1027,7 @@ int SSLClientSocketOpenSSL::DoChannelIDLookup() {
net_log_.AddEvent(NetLog::TYPE_SSL_CHANNEL_ID_REQUESTED);
GotoState(STATE_CHANNEL_ID_LOOKUP_COMPLETE);
return channel_id_service_->GetOrCreateChannelID(
- host_and_port_.host(),
- &channel_id_private_key_,
- &channel_id_cert_,
+ host_and_port_.host(), &channel_id_key_,
base::Bind(&SSLClientSocketOpenSSL::OnHandshakeIOComplete,
base::Unretained(this)),
&channel_id_request_handle_);
@@ -1039,22 +1037,7 @@ int SSLClientSocketOpenSSL::DoChannelIDLookupComplete(int result) {
if (result < 0)
return result;
- DCHECK_LT(0u, channel_id_private_key_.size());
- // Decode key.
- std::vector<uint8> encrypted_private_key_info;
- std::vector<uint8> subject_public_key_info;
- encrypted_private_key_info.assign(
- channel_id_private_key_.data(),
- channel_id_private_key_.data() + channel_id_private_key_.size());
- subject_public_key_info.assign(
- channel_id_cert_.data(),
- channel_id_cert_.data() + channel_id_cert_.size());
- scoped_ptr<crypto::ECPrivateKey> ec_private_key(
- crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
- ChannelIDService::kEPKIPassword,
- encrypted_private_key_info,
- subject_public_key_info));
- if (!ec_private_key) {
+ if (!channel_id_key_) {
LOG(ERROR) << "Failed to import Channel ID.";
return ERR_CHANNEL_ID_IMPORT_FAILED;
}
@@ -1062,7 +1045,7 @@ int SSLClientSocketOpenSSL::DoChannelIDLookupComplete(int result) {
// Hand the key to OpenSSL. Check for error in case OpenSSL rejects the key
// type.
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
- int rv = SSL_set1_tls_channel_id(ssl_, ec_private_key->key());
+ int rv = SSL_set1_tls_channel_id(ssl_, channel_id_key_->key());
if (!rv) {
LOG(ERROR) << "Failed to set Channel ID.";
int err = SSL_get_error(ssl_, rv);
« no previous file with comments | « net/socket/ssl_client_socket_openssl.h ('k') | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698