| Index: crypto/rsa_private_key_unittest.cc
|
| ===================================================================
|
| --- crypto/rsa_private_key_unittest.cc (revision 79901)
|
| +++ crypto/rsa_private_key_unittest.cc (working copy)
|
| @@ -2,15 +2,18 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "base/crypto/rsa_private_key.h"
|
| +#include "crypto/rsa_private_key.h"
|
| +
|
| #include "base/memory/scoped_ptr.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| // Generate random private keys with two different sizes. Reimport, then
|
| // export them again. We should get back the same exact bytes.
|
| TEST(RSAPrivateKeyUnitTest, InitRandomTest) {
|
| - scoped_ptr<base::RSAPrivateKey> keypair1(base::RSAPrivateKey::Create(1024));
|
| - scoped_ptr<base::RSAPrivateKey> keypair2(base::RSAPrivateKey::Create(2048));
|
| + scoped_ptr<crypto::RSAPrivateKey> keypair1(
|
| + crypto::RSAPrivateKey::Create(1024));
|
| + scoped_ptr<crypto::RSAPrivateKey> keypair2(
|
| + crypto::RSAPrivateKey::Create(2048));
|
| ASSERT_TRUE(keypair1.get());
|
| ASSERT_TRUE(keypair2.get());
|
|
|
| @@ -24,10 +27,10 @@
|
| ASSERT_TRUE(keypair1->ExportPublicKey(&pubkey1));
|
| ASSERT_TRUE(keypair2->ExportPublicKey(&pubkey2));
|
|
|
| - scoped_ptr<base::RSAPrivateKey> keypair3(
|
| - base::RSAPrivateKey::CreateFromPrivateKeyInfo(privkey1));
|
| - scoped_ptr<base::RSAPrivateKey> keypair4(
|
| - base::RSAPrivateKey::CreateFromPrivateKeyInfo(privkey2));
|
| + scoped_ptr<crypto::RSAPrivateKey> keypair3(
|
| + crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(privkey1));
|
| + scoped_ptr<crypto::RSAPrivateKey> keypair4(
|
| + crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(privkey2));
|
| ASSERT_TRUE(keypair3.get());
|
| ASSERT_TRUE(keypair4.get());
|
|
|
| @@ -159,8 +162,8 @@
|
| input.resize(sizeof(private_key_info));
|
| memcpy(&input.front(), private_key_info, sizeof(private_key_info));
|
|
|
| - scoped_ptr<base::RSAPrivateKey> key(
|
| - base::RSAPrivateKey::CreateFromPrivateKeyInfo(input));
|
| + scoped_ptr<crypto::RSAPrivateKey> key(
|
| + crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(input));
|
| ASSERT_TRUE(key.get());
|
|
|
| std::vector<uint8> output;
|
| @@ -362,10 +365,10 @@
|
| memcpy(&input2.front(), short_integer_without_high_bit,
|
| sizeof(short_integer_without_high_bit));
|
|
|
| - scoped_ptr<base::RSAPrivateKey> keypair1(
|
| - base::RSAPrivateKey::CreateFromPrivateKeyInfo(input1));
|
| - scoped_ptr<base::RSAPrivateKey> keypair2(
|
| - base::RSAPrivateKey::CreateFromPrivateKeyInfo(input2));
|
| + scoped_ptr<crypto::RSAPrivateKey> keypair1(
|
| + crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(input1));
|
| + scoped_ptr<crypto::RSAPrivateKey> keypair2(
|
| + crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(input2));
|
| ASSERT_TRUE(keypair1.get());
|
| ASSERT_TRUE(keypair2.get());
|
|
|
|
|