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

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: Address wtc's comments 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
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..fd07d520f4ff9dc6cc3c821762cc4911e035f14f 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,11 +63,17 @@ 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::string proof;
+ if (!creator->DecodeSignature(der_signature, &proof)) {
+ NOTREACHED();
+ return ERR_UNEXPECTED;
+ }
credential->slot = slot;
credential->certs.push_back(public_key.as_string());
- credential->proof.assign(proof_vector.begin(), proof_vector.end());
+ credential->proof = proof;
return OK;
}

Powered by Google App Engine
This is Rietveld 408576698