summaryrefslogtreecommitdiffstats
path: root/src/Common
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-08-29 16:19:50 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-08-29 16:19:50 +0200
commit8798ddc04b5cfe78180ca119f12486df0afb1bd0 (patch)
tree4663ce78dd58c04c23d556610bf9ea91f3927ec6 /src/Common
parentbf56fa726e1d6ed228fde841e6312d61122174da (diff)
downloadmad-8798ddc04b5cfe78180ca119f12486df0afb1bd0.tar
mad-8798ddc04b5cfe78180ca119f12486df0afb1bd0.zip
AuthProviderFile: Auslesen von gehashten Passwörtern
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Hash.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Common/Hash.h b/src/Common/Hash.h
index 06562e2..db581b7 100644
--- a/src/Common/Hash.h
+++ b/src/Common/Hash.h
@@ -28,6 +28,7 @@
#include <string>
#include <vector>
+#include <boost/algorithm/string/case_conv.hpp>
#include <boost/cstdint.hpp>
namespace Mad {
@@ -43,7 +44,7 @@ class MAD_COMMON_EXPORT Hash {
std::vector<std::string> list;
void addHash(const std::string &name, unsigned id) {
- map.insert(std::make_pair(name, id));
+ map.insert(std::make_pair(boost::algorithm::to_lower_copy(name), id));
list.push_back(name);
}
@@ -67,13 +68,13 @@ class MAD_COMMON_EXPORT Hash {
}
static bool isHashSupported(const std::string &method) {
- return (hashes.getMap().find(method) != hashes.getMap().end());
+ return (hashes.getMap().find(boost::algorithm::to_lower_copy(method)) != hashes.getMap().end());
}
static std::vector<boost::uint8_t> hash(const std::vector<boost::uint8_t> &in, unsigned int method) throw (Core::Exception);
static std::vector<boost::uint8_t> hash(const std::vector<boost::uint8_t> &in, const std::string &method) throw (Core::Exception) {
- std::map<std::string, unsigned int>::const_iterator methodIt = hashes.getMap().find(method);
+ std::map<std::string, unsigned int>::const_iterator methodIt = hashes.getMap().find(boost::algorithm::to_lower_copy(method));
if(methodIt == hashes.getMap().end())
throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));