security: use DES-EDE3-CBC to encrypt private keys in PKCS #8 format
Change-Id: Ib05f8790fdc446eea6c0a8c4f6956aaf059741c6
diff --git a/src/security/transform/private-key.cpp b/src/security/transform/private-key.cpp
index 17251c4..b7820c3 100644
--- a/src/security/transform/private-key.cpp
+++ b/src/security/transform/private-key.cpp
@@ -312,7 +312,7 @@
opensslInitAlgorithms();
detail::Bio membio(BIO_s_mem());
- if (!i2d_PKCS8PrivateKey_bio(membio, m_impl->key, EVP_des_cbc(), nullptr, 0,
+ if (!i2d_PKCS8PrivateKey_bio(membio, m_impl->key, EVP_des_ede3_cbc(), nullptr, 0,
nullptr, const_cast<char*>(pw)))
BOOST_THROW_EXCEPTION(Error("Cannot convert key to PKCS #8 format"));
@@ -329,7 +329,7 @@
opensslInitAlgorithms();
detail::Bio membio(BIO_s_mem());
- if (!i2d_PKCS8PrivateKey_bio(membio, m_impl->key, EVP_des_cbc(), nullptr, 0,
+ if (!i2d_PKCS8PrivateKey_bio(membio, m_impl->key, EVP_des_ede3_cbc(), nullptr, 0,
&passwordCallbackWrapper, &pwCallback))
BOOST_THROW_EXCEPTION(Error("Cannot convert key to PKCS #8 format"));