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

Unified Diff: net/spdy/spdy_session.cc

Issue 9455006: Fix SpdySession::WriteCredentialFrame ECPrivateKey creation args. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: openssl fix Created 8 years, 10 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/spdy/spdy_http_stream_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index b119db4c37a4901fb5a3350d47d03216d5023aab..19e6f46ece2893e3569fa147f4ab714aac2e21d5 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -21,9 +21,11 @@
#include "crypto/ec_signature_creator.h"
#include "crypto/rsa_private_key.h"
#include "crypto/signature_creator.h"
+#include "net/base/asn1_util.h"
#include "net/base/connection_type_histograms.h"
#include "net/base/net_log.h"
#include "net/base/net_util.h"
+#include "net/base/origin_bound_cert_service.h"
#include "net/http/http_network_session.h"
#include "net/http/http_server_properties.h"
#include "net/socket/ssl_client_socket.h"
@@ -657,15 +659,13 @@ int SpdySession::WriteCredentialFrame(const std::string& origin,
break;
}
case CLIENT_CERT_ECDSA_SIGN: {
- // Convert the cert string into a vector<unit8>
- std::vector<uint8> cert_data;
- for (size_t i = 0; i < cert.length(); i++) {
- cert_data.push_back(cert[i]);
- }
+ base::StringPiece spki_piece;
+ asn1::ExtractSPKIFromDERCert(cert, &spki_piece);
+ std::vector<uint8> spki(spki_piece.data(),
+ spki_piece.data() + spki_piece.size());
scoped_ptr<crypto::ECPrivateKey> private_key(
- crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo("",
- key_data,
- cert_data));
+ crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
+ OriginBoundCertService::kEPKIPassword, key_data, spki));
scoped_ptr<crypto::ECSignatureCreator> creator(
crypto::ECSignatureCreator::Create(private_key.get()));
creator->Sign(secret, arraysize(secret), &proof);
« no previous file with comments | « net/spdy/spdy_http_stream_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698