Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: crypto/ec_private_key.h

Issue 2608453002: Remove the password parameter for ECPrivateKey::ExportEncryptedPrivateKey. (Closed)
Patch Set: fmt Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: crypto/ec_private_key.h
diff --git a/crypto/ec_private_key.h b/crypto/ec_private_key.h
index 8e5fe5e99bb89ecc4cb4120244f1f8ec37b3caaa..432019be5d7eb9610febd69e76df5beb4aac452f 100644
--- a/crypto/ec_private_key.h
+++ b/crypto/ec_private_key.h
@@ -41,13 +41,12 @@ class CRYPTO_EXPORT ECPrivateKey {
// Creates a new instance by importing an existing key pair.
// The key pair is given as an ASN.1-encoded PKCS #8 EncryptedPrivateKeyInfo
- // block and an X.509 SubjectPublicKeyInfo block.
+ // block with empty password and an X.509 SubjectPublicKeyInfo block.
// Returns nullptr if initialization fails.
//
// This function is deprecated. Use CreateFromPrivateKeyInfo for new code.
// See https://crbug.com/603319.
static std::unique_ptr<ECPrivateKey> CreateFromEncryptedPrivateKeyInfo(
- const std::string& password,
const std::vector<uint8_t>& encrypted_private_key_info,
const std::vector<uint8_t>& subject_public_key_info);
@@ -60,16 +59,12 @@ class CRYPTO_EXPORT ECPrivateKey {
bool ExportPrivateKey(std::vector<uint8_t>* output) const;
// Exports the private key as an ASN.1-encoded PKCS #8 EncryptedPrivateKeyInfo
- // block and the public key as an X.509 SubjectPublicKeyInfo block.
- // The |password| and |iterations| are used as inputs to the key derivation
- // function for generating the encryption key. PKCS #5 recommends a minimum
- // of 1000 iterations, on modern systems a larger value may be preferrable.
+ // block wth empty password. This was historically used as a workaround for
+ // NSS API deficiencies and does not provide security.
//
// This function is deprecated. Use ExportPrivateKey for new code. See
// https://crbug.com/603319.
- bool ExportEncryptedPrivateKey(const std::string& password,
- int iterations,
- std::vector<uint8_t>* output) const;
+ bool ExportEncryptedPrivateKey(std::vector<uint8_t>* output) const;
// Exports the public key to an X.509 SubjectPublicKeyInfo block.
bool ExportPublicKey(std::vector<uint8_t>* output) const;

Powered by Google App Engine
This is Rietveld 408576698