diff options
author | lloyd <[email protected]> | 2010-06-28 19:54:46 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-06-28 19:54:46 +0000 |
commit | be41b79db735f10d09f5f73e4c2d438cee2d4ab7 (patch) | |
tree | cfdbaf5dbc183587331cc886d30640a050e76fdd /checks/dolook.cpp | |
parent | 78465d7229c14478b81ecf56fad69a3b598a7415 (diff) |
Give all Filter objects a method for querying their name
Diffstat (limited to 'checks/dolook.cpp')
-rw-r--r-- | checks/dolook.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/checks/dolook.cpp b/checks/dolook.cpp index e9be25614..1eecfa9fc 100644 --- a/checks/dolook.cpp +++ b/checks/dolook.cpp @@ -62,8 +62,11 @@ using namespace Botan; class S2K_Filter : public Filter { public: + std::string name() const { return s2k->name(); } + void write(const byte in[], u32bit len) { passphrase += std::string(reinterpret_cast<const char*>(in), len); } + void end_msg() { SymmetricKey x = s2k->derive_key(outlen, passphrase, @@ -71,14 +74,15 @@ class S2K_Filter : public Filter iterations); send(x.bits_of()); } + S2K_Filter(S2K* algo, const SymmetricKey& s, u32bit o, u32bit i) { s2k = algo; outlen = o; iterations = i; salt = s.bits_of(); - } + ~S2K_Filter() { delete s2k; } private: std::string passphrase; @@ -91,6 +95,8 @@ class S2K_Filter : public Filter class RNG_Filter : public Filter { public: + std::string name() const { return rng->name(); } + void write(const byte[], u32bit); RNG_Filter(RandomNumberGenerator* r) : rng(r) {} @@ -102,6 +108,8 @@ class RNG_Filter : public Filter class KDF_Filter : public Filter { public: + std::string name() const { return "KDF_Filter"; } + void write(const byte in[], u32bit len) { secret.append(in, len); } void end_msg() |