[crypto] Bug in md5

20 Dec
2008
20 Dec
'08
9:08 p.m.
Hi All! I just tried crypto library from the vault and immediately hit a bug :) in message_digest.hpp template<class Context> std::string message_digest<Context>::to_string() const { // !!!BUG!!! Should be context_type::digest_length * 2 + 1 char buf[context_type::digest_length * 2]; for (int i = 0; i < context_type::digest_length; ++i) std::sprintf(buf + i * 2, "%02x", static_cast<const unsigned char*>(digest())[i]); return std::string(buf, context_type::digest_length * 2); }
6018
Age (days ago)
6019
Last active (days ago)
1 comments
2 participants
participants (2)
-
Kevin Sopp
-
Konstantin Litvinenko