aboutsummaryrefslogtreecommitdiffstats
path: root/src/pbe/pbes2/pbes2.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-05-31 21:08:09 +0000
committerlloyd <[email protected]>2012-05-31 21:08:09 +0000
commit149a855bd7b090eb3868efff272e455e568eade4 (patch)
tree08df5d122f0dceb00ac4576c0714a3ab048967c7 /src/pbe/pbes2/pbes2.h
parentb82642c328d98f2aaa1ac17aa0999e69e7152ae8 (diff)
Allow arbitrary ciphers and hashes with PKCS #5 v2.0. The only
requirement is that OIDS for "<cipher>/CBC" and "HMAC(<hash>)" are defined. This does assume the normal parameter set of just the IV, so doesn't work right for (IIRC) RC5, but we don't have an OID set for RC5/CBC anyway. Continue to default to SHA-1 plus AES-256 as prior versions of the library can't handle any hashes other than SHA-1 or any ciphers other than AES or DES. OpenSSL 1.0.0j seems to understand SHA-256 + AES-256, though. BER_Decoder::decode_optional was assuming optional values were explicitly tagged. Now, only take that behavior if the input class tag was for a context specific tagging. Remove abort call for debugging from BER_Decoder Add a new version of DER_Encoder::encode_if for single objects.
Diffstat (limited to 'src/pbe/pbes2/pbes2.h')
-rw-r--r--src/pbe/pbes2/pbes2.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/pbe/pbes2/pbes2.h b/src/pbe/pbes2/pbes2.h
index 635837b42..4c9eb9b8a 100644
--- a/src/pbe/pbes2/pbes2.h
+++ b/src/pbe/pbes2/pbes2.h
@@ -10,7 +10,7 @@
#include <botan/pbe.h>
#include <botan/block_cipher.h>
-#include <botan/hash.h>
+#include <botan/mac.h>
#include <botan/pipe.h>
namespace Botan {
@@ -21,12 +21,6 @@ namespace Botan {
class BOTAN_DLL PBE_PKCS5v20 : public PBE
{
public:
- /**
- * @param cipher names a block cipher
- * @return true iff PKCS #5 knows how to use this cipher
- */
- static bool known_cipher(const std::string& cipher);
-
OID get_oid() const;
std::vector<byte> encode_params() const;
@@ -49,7 +43,7 @@ class BOTAN_DLL PBE_PKCS5v20 : public PBE
* @param hash the hash function to use
*/
PBE_PKCS5v20(BlockCipher* cipher,
- HashFunction* hash,
+ MessageAuthenticationCode* mac,
const std::string& passphrase,
std::chrono::milliseconds msec,
RandomNumberGenerator& rng);
@@ -60,7 +54,7 @@ class BOTAN_DLL PBE_PKCS5v20 : public PBE
Cipher_Dir direction;
BlockCipher* block_cipher;
- HashFunction* hash_function;
+ MessageAuthenticationCode* m_prf;
secure_vector<byte> salt, key, iv;
size_t iterations, key_length;
Pipe pipe;