diff options
author | DukePyrolator <DukePyrolator@anope.org> | 2011-08-18 07:59:58 +0200 |
---|---|---|
committer | DukePyrolator <DukePyrolator@anope.org> | 2011-08-18 07:59:58 +0200 |
commit | 2f3969b4beaf114586075f08be070c43e3d113dc (patch) | |
tree | 350bb2c5b1b6e7424814c119e727df1c26b56019 /modules | |
parent | ff7479f437c45a44d9c81f5e1102fa5a1ffe96a6 (diff) |
Bug #1317 - fixed sha1 fingerprint hashes in the inspircd protocol modules
Diffstat (limited to 'modules')
-rw-r--r-- | modules/protocol/inspircd12.cpp | 2 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index 60e062359..9a64ec34a 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -287,7 +287,7 @@ bool event_metadata(const Anope::string &source, const std::vector<Anope::string std::string data = params[2].c_str(); size_t pos1 = data.find(' ') + 1; size_t pos2 = data.find(' ', pos1); - if (u && ((pos2 - pos1) == 32)) // fingerprints should always be 32 bytes in size + if ((pos2 - pos1) >= 32) // inspircd supports md5 and sha1 fingerprint hashes -> size 32 or 40 bytes. { u->fingerprint = data.substr(pos1, pos2 - pos1); FOREACH_MOD(I_OnFingerprint, OnFingerprint(u)); diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index b86bc6bf0..a4d4e80aa 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -298,7 +298,7 @@ bool event_metadata(const Anope::string &source, const std::vector<Anope::string std::string data = params[2].c_str(); size_t pos1 = data.find(' ') + 1; size_t pos2 = data.find(' ', pos1); - if ((pos2 - pos1) == 32) // fingerprints should always be 32 bytes in size + if ((pos2 - pos1) >= 32) // inspircd supports md5 and sha1 fingerprint hashes -> size 32 or 40 bytes. { u->fingerprint = data.substr(pos1, pos2 - pos1); FOREACH_MOD(I_OnFingerprint, OnFingerprint(u)); |