| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/quic/test_tools/crypto_test_utils.h" | 5 #include "net/quic/test_tools/crypto_test_utils.h" |
| 6 | 6 |
| 7 #include <openssl/bn.h> | 7 #include <openssl/bn.h> |
| 8 #include <openssl/ec.h> | 8 #include <openssl/ec.h> |
| 9 #include <openssl/ecdsa.h> | 9 #include <openssl/ecdsa.h> |
| 10 #include <openssl/evp.h> | 10 #include <openssl/evp.h> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 } // namespace anonymous | 27 } // namespace anonymous |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 | 30 |
| 31 namespace test { | 31 namespace test { |
| 32 | 32 |
| 33 class TestChannelIDKey : public ChannelIDKey { | 33 class TestChannelIDKey : public ChannelIDKey { |
| 34 public: | 34 public: |
| 35 explicit TestChannelIDKey(EVP_PKEY* ecdsa_key) : ecdsa_key_(ecdsa_key) {} | 35 explicit TestChannelIDKey(EVP_PKEY* ecdsa_key) : ecdsa_key_(ecdsa_key) {} |
| 36 virtual ~TestChannelIDKey() { } | 36 virtual ~TestChannelIDKey() OVERRIDE {} |
| 37 | 37 |
| 38 // ChannelIDKey implementation. | 38 // ChannelIDKey implementation. |
| 39 | 39 |
| 40 virtual bool Sign(StringPiece signed_data, | 40 virtual bool Sign(StringPiece signed_data, |
| 41 string* out_signature) const OVERRIDE { | 41 string* out_signature) const OVERRIDE { |
| 42 EVP_MD_CTX md_ctx; | 42 EVP_MD_CTX md_ctx; |
| 43 EVP_MD_CTX_init(&md_ctx); | 43 EVP_MD_CTX_init(&md_ctx); |
| 44 crypto::ScopedOpenSSL<EVP_MD_CTX, EvpMdCtxCleanUp> | 44 crypto::ScopedOpenSSL<EVP_MD_CTX, EvpMdCtxCleanUp> |
| 45 md_ctx_cleanup(&md_ctx); | 45 md_ctx_cleanup(&md_ctx); |
| 46 | 46 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 // static | 169 // static |
| 170 ChannelIDSource* CryptoTestUtils::ChannelIDSourceForTesting() { | 170 ChannelIDSource* CryptoTestUtils::ChannelIDSourceForTesting() { |
| 171 return new TestChannelIDSource(); | 171 return new TestChannelIDSource(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace test | 174 } // namespace test |
| 175 | 175 |
| 176 } // namespace net | 176 } // namespace net |
| OLD | NEW |