aboutsummaryrefslogtreecommitdiffstats
path: root/src/pbe/pbes1/pbes1.cpp
diff options
context:
space:
mode:
authorlloyd <lloyd@randombit.net>2013-08-15 14:06:24 +0000
committerlloyd <lloyd@randombit.net>2013-08-15 14:06:24 +0000
commite614a76c952107150ba0d4994954e6d77701fa17 (patch)
tree77de38187b841b93ebfce3cc1b35f62c3969bdd1 /src/pbe/pbes1/pbes1.cpp
parent920bd7b871bb2a982b6db7e75aaa5da69e37a3c9 (diff)
Avoid using CBC filters directly in PBES
Diffstat (limited to 'src/pbe/pbes1/pbes1.cpp')
-rw-r--r--src/pbe/pbes1/pbes1.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/pbe/pbes1/pbes1.cpp b/src/pbe/pbes1/pbes1.cpp
index e86a496ac..a30f10a6c 100644
--- a/src/pbe/pbes1/pbes1.cpp
+++ b/src/pbe/pbes1/pbes1.cpp
@@ -9,7 +9,7 @@
#include <botan/pbkdf1.h>
#include <botan/der_enc.h>
#include <botan/ber_dec.h>
-#include <botan/cbc.h>
+#include <botan/lookup.h>
#include <algorithm>
namespace Botan {
@@ -28,14 +28,8 @@ void PBE_PKCS5v15::write(const byte input[], size_t length)
*/
void PBE_PKCS5v15::start_msg()
{
- if(m_direction == ENCRYPTION)
- m_pipe.append(new CBC_Encryption(m_block_cipher->clone(),
- new PKCS7_Padding,
- m_key, m_iv));
- else
- m_pipe.append(new CBC_Decryption(m_block_cipher->clone(),
- new PKCS7_Padding,
- m_key, m_iv));
+ m_pipe.append(get_cipher(m_block_cipher->name() + "/CBC/PKCS7",
+ m_key, m_iv, m_direction));
m_pipe.start_msg();
if(m_pipe.message_count() > 1)