summaryrefslogtreecommitdiffstats
path: root/base/crypto
diff options
context:
space:
mode:
authorglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 16:41:13 +0000
committerglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 16:41:13 +0000
commita37bd9baafb3ccc1532b77db9df922d35a10e2f3 (patch)
tree8b9aea5fa5c5d21eb2d09c88dd01fad9b6cbf702 /base/crypto
parentea2b4208e01a8984ca5c28b887102a7ea5844668 (diff)
downloadchromium_src-a37bd9baafb3ccc1532b77db9df922d35a10e2f3.zip
chromium_src-a37bd9baafb3ccc1532b77db9df922d35a10e2f3.tar.gz
chromium_src-a37bd9baafb3ccc1532b77db9df922d35a10e2f3.tar.bz2
Annotated the memory leaks in RSAPrivateKeyUnitTest.* and
SignatureCreatorTest.BasicTest. BUG=34742 TBR=wtc Review URL: http://codereview.chromium.org/1117007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42223 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/crypto')
-rw-r--r--base/crypto/rsa_private_key_unittest.cc13
-rw-r--r--base/crypto/signature_creator_unittest.cc4
2 files changed, 17 insertions, 0 deletions
diff --git a/base/crypto/rsa_private_key_unittest.cc b/base/crypto/rsa_private_key_unittest.cc
index 3b0d846..48940c1 100644
--- a/base/crypto/rsa_private_key_unittest.cc
+++ b/base/crypto/rsa_private_key_unittest.cc
@@ -3,12 +3,17 @@
// 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());
@@ -48,6 +53,10 @@ 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,
@@ -185,6 +194,10 @@ 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 11959cb..c2335ea 100644
--- a/base/crypto/signature_creator_unittest.cc
+++ b/base/crypto/signature_creator_unittest.cc
@@ -6,6 +6,7 @@
#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"
@@ -17,6 +18,9 @@ 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());