summaryrefslogtreecommitdiffstats
path: root/base/crypto
diff options
context:
space:
mode:
authorglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 13:03:04 +0000
committerglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 13:03:04 +0000
commit0145c2b269a6b0cb1f46698b1d84ccf9412fb50c (patch)
treeb08573e4640b675a5e3d7a9e999cbc8143b05edf /base/crypto
parent65dff99d25854d069e2e7926ee9e8ede11787410 (diff)
downloadchromium_src-0145c2b269a6b0cb1f46698b1d84ccf9412fb50c.zip
chromium_src-0145c2b269a6b0cb1f46698b1d84ccf9412fb50c.tar.gz
chromium_src-0145c2b269a6b0cb1f46698b1d84ccf9412fb50c.tar.bz2
Annotated the scoped leak inside base::RSAPrivateKey::CreateFromPrivateKeyInfo,
removed the annotations from the tests calling it (RSAPrivateKeyUnitTest.* and SignatureCreatorTest.BasicTest) BUG=34742 TBR=wtc Review URL: http://codereview.chromium.org/1271002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42459 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/crypto')
-rw-r--r--base/crypto/rsa_private_key_nss.cc4
-rw-r--r--base/crypto/rsa_private_key_unittest.cc13
-rw-r--r--base/crypto/signature_creator_unittest.cc4
3 files changed, 4 insertions, 17 deletions
diff --git a/base/crypto/rsa_private_key_nss.cc b/base/crypto/rsa_private_key_nss.cc
index 26bb10cc..a6b8ffa 100644
--- a/base/crypto/rsa_private_key_nss.cc
+++ b/base/crypto/rsa_private_key_nss.cc
@@ -11,6 +11,7 @@
#include <iostream>
#include <list>
+#include "base/leak_annotations.h"
#include "base/logging.h"
#include "base/nss_util.h"
#include "base/scoped_ptr.h"
@@ -63,6 +64,9 @@ RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) {
// static
RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfo(
const std::vector<uint8>& input) {
+ // This method currently leaks some memory.
+ // See http://crbug.com/34742.
+ ANNOTATE_SCOPED_MEMORY_LEAK;
scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey);
PK11SlotInfo *slot = PK11_GetInternalSlot();
diff --git a/base/crypto/rsa_private_key_unittest.cc b/base/crypto/rsa_private_key_unittest.cc
index 48940c1..3b0d846 100644
--- a/base/crypto/rsa_private_key_unittest.cc
+++ b/base/crypto/rsa_private_key_unittest.cc
@@ -3,17 +3,12 @@
// found in the LICENSE file.
#include "base/crypto/rsa_private_key.h"
-#include "base/leak_annotations.h"
#include "base/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) {
- // This test currently leaks some memory,
- // see http://crbug.com/34742
- ANNOTATE_SCOPED_MEMORY_LEAK;
-
scoped_ptr<base::RSAPrivateKey> keypair1(base::RSAPrivateKey::Create(1024));
scoped_ptr<base::RSAPrivateKey> keypair2(base::RSAPrivateKey::Create(2048));
ASSERT_TRUE(keypair1.get());
@@ -53,10 +48,6 @@ TEST(RSAPrivateKeyUnitTest, InitRandomTest) {
// Verify that generated public keys look good. This test data was generated
// with the openssl command line tool.
TEST(RSAPrivateKeyUnitTest, PublicKeyTest) {
- // This test currently leaks some memory,
- // see http://crbug.com/34742
- ANNOTATE_SCOPED_MEMORY_LEAK;
-
const uint8 private_key_info[] = {
0x30, 0x82, 0x02, 0x78, 0x02, 0x01, 0x00, 0x30,
0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
@@ -194,10 +185,6 @@ TEST(RSAPrivateKeyUnitTest, PublicKeyTest) {
//
// This test case verifies these two failures modes don't occur.
TEST(RSAPrivateKeyUnitTest, ShortIntegers) {
- // This test currently leaks some memory,
- // see http://crbug.com/34742
- ANNOTATE_SCOPED_MEMORY_LEAK;
-
const uint8 short_integer_with_high_bit[] = {
0x30, 0x82, 0x02, 0x77, 0x02, 0x01, 0x00, 0x30,
0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
diff --git a/base/crypto/signature_creator_unittest.cc b/base/crypto/signature_creator_unittest.cc
index c2335ea..11959cb 100644
--- a/base/crypto/signature_creator_unittest.cc
+++ b/base/crypto/signature_creator_unittest.cc
@@ -6,7 +6,6 @@
#include "base/crypto/signature_creator.h"
#include "base/crypto/signature_verifier.h"
-#include "base/leak_annotations.h"
#include "base/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -18,9 +17,6 @@ TEST(SignatureCreatorTest, BasicTest) {
std::vector<uint8> key_info;
key_original->ExportPrivateKey(&key_info);
- // This test currently leaks some memory,
- // see http://crbug.com/34742
- ANNOTATE_SCOPED_MEMORY_LEAK;
scoped_ptr<base::RSAPrivateKey> key(
base::RSAPrivateKey::CreateFromPrivateKeyInfo(key_info));
ASSERT_TRUE(key.get());