diff options
author | Christian Pointner <equinox@anytun.org> | 2009-03-17 15:53:22 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2009-03-17 15:53:22 +0000 |
commit | 7d04626ef28ca5d27bc8515660c58bb135aa8c93 (patch) | |
tree | d8affb3523764a4be6aba9b6bd227e875ebb2096 /src/authAlgoFactory.cpp | |
parent | removed key derivation rate entirely (diff) |
added support for configurabel auth tag length
Diffstat (limited to 'src/authAlgoFactory.cpp')
-rw-r--r-- | src/authAlgoFactory.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/authAlgoFactory.cpp b/src/authAlgoFactory.cpp index 8fa16fc..c284f34 100644 --- a/src/authAlgoFactory.cpp +++ b/src/authAlgoFactory.cpp @@ -38,13 +38,25 @@ AuthAlgo* AuthAlgoFactory::create(std::string const& type, kd_dir_t dir) { - if( type == "null" ) + if(type == "null") return new NullAuthAlgo(); #ifndef NO_CRYPT - else if( type == "sha1" ) + else if(type == "sha1") return new Sha1AuthAlgo(dir); #endif else throw std::invalid_argument("auth algo not available"); } +u_int32_t AuthAlgoFactory::getDigestLength(std::string const& type) +{ + if(type == "null") + return NullAuthAlgo::DIGEST_LENGTH; +#ifndef NO_CRYPT + else if(type == "sha1") + return Sha1AuthAlgo::DIGEST_LENGTH; +#endif + else + throw std::invalid_argument("auth algo not available"); +} + |