summaryrefslogtreecommitdiffstats
path: root/base/crypto
diff options
context:
space:
mode:
authorrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 20:39:52 +0000
committerrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 20:39:52 +0000
commit90a2847df7f4d9bb1e3ea5415d09f09568297274 (patch)
tree0b73d50af04e2526276194a23f2c8aa78b4b0e7f /base/crypto
parent89516b4ebe5b7b49e7dc5cf68087cfc2b3ee8eb5 (diff)
downloadchromium_src-90a2847df7f4d9bb1e3ea5415d09f09568297274.zip
chromium_src-90a2847df7f4d9bb1e3ea5415d09f09568297274.tar.gz
chromium_src-90a2847df7f4d9bb1e3ea5415d09f09568297274.tar.bz2
Add a comment warning against using RSAPrivateKeyImport on untrusted sources.
Review URL: http://codereview.chromium.org/307009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29566 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/crypto')
-rw-r--r--base/crypto/rsa_private_key.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/base/crypto/rsa_private_key.h b/base/crypto/rsa_private_key.h
index 5ce3839..7f562ec 100644
--- a/base/crypto/rsa_private_key.h
+++ b/base/crypto/rsa_private_key.h
@@ -39,7 +39,7 @@ class PrivateKeyInfoCodec {
static const uint8 kNullTag = 0x05;
static const uint8 kOctetStringTag = 0x04;
static const uint8 kSequenceTag = 0x30;
-
+
// |big_endian| here specifies the byte-significance of the integer components
// that will be parsed & serialized (modulus(), etc...) during Import(),
// Export() and ExportPublicKeyInfo() -- not the ASN.1 DER encoding of the
@@ -56,6 +56,8 @@ class PrivateKeyInfoCodec {
// Parses the ASN.1 DER encoding of the PrivateKeyInfo structure in |input|
// and populates the integer components with |big_endian_| byte-significance.
+ // IMPORTANT NOTE: This is currently *not* security-approved for importing
+ // keys from unstrusted sources.
bool Import(const std::vector<uint8>& input);
// Accessors to the contents of the integer components of the PrivateKeyInfo
@@ -74,7 +76,7 @@ class PrivateKeyInfoCodec {
// value.
void PrependInteger(const std::vector<uint8>& in, std::list<uint8>* out);
void PrependInteger(uint8* val, int num_bytes, std::list<uint8>* data);
-
+
// Prepends the integer stored in |val| - |val + num_bytes| with |big_endian|
// byte-significance into |data| as an ASN.1 integer.
void PrependIntegerImpl(uint8* val,
@@ -94,9 +96,9 @@ class PrivateKeyInfoCodec {
// |big_endian| byte-significance.
bool ReadIntegerImpl(uint8** pos,
uint8* end,
- std::vector<uint8>* out,
+ std::vector<uint8>* out,
bool big_endian);
-
+
// Prepends the integer stored in |val|, starting a index |start|, for
// |num_bytes| bytes onto |data|.
void PrependBytes(uint8* val,