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

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: rebase 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
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 119392c87cf1ed103b8cab8bd6634d9e9b6c0e54..ee4679eb41b8d897b7768485549b5833faaf8b6f 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -990,9 +990,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_);
@@ -1002,22 +1000,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;
}
@@ -1025,7 +1008,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);

Powered by Google App Engine
This is Rietveld 408576698