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

Unified Diff: net/spdy/spdy_credential_builder.cc

Issue 10910226: crypto: change ECSignatureCreator defaults to match SPDY. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 8 years, 3 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 | « crypto/ec_signature_creator_unittest.cc ('k') | net/spdy/spdy_test_util_spdy3.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_credential_builder.cc
diff --git a/net/spdy/spdy_credential_builder.cc b/net/spdy/spdy_credential_builder.cc
index accd33d9e2e10bac00e9617f78b36ade98d0e937..8ddda97741d022cd77e143260dbfef0175b02d00 100644
--- a/net/spdy/spdy_credential_builder.cc
+++ b/net/spdy/spdy_credential_builder.cc
@@ -55,7 +55,7 @@ int SpdyCredentialBuilder::Build(const std::string& tls_unique,
public_key = public_key.substr(2, public_key.length());
// Convert the strings into a vector<unit8>
- std::vector<uint8> proof_vector;
+ std::vector<uint8> der_signature;
scoped_ptr<crypto::ECPrivateKey> private_key(
crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
ServerBoundCertService::kEPKIPassword,
@@ -63,7 +63,13 @@ int SpdyCredentialBuilder::Build(const std::string& tls_unique,
scoped_ptr<crypto::ECSignatureCreator> creator(
crypto::ECSignatureCreator::Create(private_key.get()));
creator->Sign(reinterpret_cast<const unsigned char *>(secret.data()),
- secret.length(), &proof_vector);
+ secret.length(), &der_signature);
+
+ std::vector<uint8> proof_vector;
+ if (!creator->DecodeSignature(der_signature, &proof_vector)) {
+ NOTREACHED();
+ return ERR_UNEXPECTED;
+ }
credential->slot = slot;
credential->certs.push_back(public_key.as_string());
« no previous file with comments | « crypto/ec_signature_creator_unittest.cc ('k') | net/spdy/spdy_test_util_spdy3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698