diff options
Diffstat (limited to 'net/spdy')
-rw-r--r-- | net/spdy/spdy_credential_builder.cc | 10 | ||||
-rw-r--r-- | net/spdy/spdy_test_util_spdy3.cc | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/net/spdy/spdy_credential_builder.cc b/net/spdy/spdy_credential_builder.cc index accd33d..8ddda97 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()); diff --git a/net/spdy/spdy_test_util_spdy3.cc b/net/spdy/spdy_test_util_spdy3.cc index cffd9eb..6598a49 100644 --- a/net/spdy/spdy_test_util_spdy3.cc +++ b/net/spdy/spdy_test_util_spdy3.cc @@ -63,6 +63,12 @@ class MockECSignatureCreator : public crypto::ECSignatureCreator { return true; } + virtual bool DecodeSignature(const std::vector<uint8>& signature, + std::vector<uint8>* out_raw_sig) { + *out_raw_sig = signature; + return true; + } + private: crypto::ECPrivateKey* key_; |