aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/misc/pbes2
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/misc/pbes2')
-rw-r--r--src/lib/misc/pbes2/pbes2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/misc/pbes2/pbes2.cpp b/src/lib/misc/pbes2/pbes2.cpp
index ec5a10ba8..c66b293e8 100644
--- a/src/lib/misc/pbes2/pbes2.cpp
+++ b/src/lib/misc/pbes2/pbes2.cpp
@@ -82,7 +82,7 @@ pbes2_encrypt(const secure_vector<byte>& key_bits,
std::unique_ptr<Cipher_Mode> enc(get_cipher_mode(cipher, ENCRYPTION));
if(!enc)
- throw Encoding_Error("PBE-PKCS5 cannot encrypt no cipher " + cipher);
+ throw Decoding_Error("PBE-PKCS5 cannot encrypt no cipher " + cipher);
std::unique_ptr<PBKDF> pbkdf(get_pbkdf("PBKDF2(" + prf + ")"));
@@ -157,7 +157,7 @@ pbes2_decrypt(const secure_vector<byte>& key_bits,
std::unique_ptr<PBKDF> pbkdf(get_pbkdf("PBKDF2(" + prf + ")"));
std::unique_ptr<Cipher_Mode> dec(get_cipher_mode(cipher, DECRYPTION));
- if(!enc)
+ if(!dec)
throw Decoding_Error("PBE-PKCS5 cannot decrypt no cipher " + cipher);
if(key_length == 0)