From 6b2e61f991dc163278654b8461aaf3c26c000801 Mon Sep 17 00:00:00 2001 From: "mattm@chromium.org" Date: Tue, 28 Feb 2012 08:06:54 +0000 Subject: Fix SpdySession::WriteCredentialFrame ECPrivateKey creation args. It was passing the DER certificate instead of a SubjectPublicKeyInfo. Also adds ECSignatureCreator::SetFactoryForTesting method to allow easier testing of code that uses ECSignatureCreator. BUG=none TEST=SpdyHttpStreamTest.SendCredentialsEC Review URL: http://codereview.chromium.org/9455006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123940 0039d316-1c4b-4281-b951-d872f2087c98 --- crypto/ec_signature_creator.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 crypto/ec_signature_creator.cc (limited to 'crypto/ec_signature_creator.cc') diff --git a/crypto/ec_signature_creator.cc b/crypto/ec_signature_creator.cc new file mode 100644 index 0000000..cbaa820 --- /dev/null +++ b/crypto/ec_signature_creator.cc @@ -0,0 +1,30 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "crypto/ec_signature_creator.h" + +#include "crypto/ec_signature_creator_impl.h" + +namespace crypto { + +namespace { + +ECSignatureCreatorFactory* g_factory_ = NULL; + +} // namespace + +// static +ECSignatureCreator* ECSignatureCreator::Create(ECPrivateKey* key) { + if (g_factory_) + return g_factory_->Create(key); + return new ECSignatureCreatorImpl(key); +} + +// static +void ECSignatureCreator::SetFactoryForTesting( + ECSignatureCreatorFactory* factory) { + g_factory_ = factory; +} + +} // namespace crypto -- cgit v1.1