diff options
author | Vincent Richard <[email protected]> | 2009-07-11 12:21:59 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2009-07-11 12:21:59 +0000 |
commit | a67f0a537e4e0e70c575d3606ce3460f3b16b5f1 (patch) | |
tree | c102bc26d5fa07c9ab7b5dfc8d773f6f606d553a | |
parent | gnutls_x509_crt_list_import does not support multiple DER certificates (Georg... (diff) | |
download | vmime-a67f0a537e4e0e70c575d3606ce3460f3b16b5f1.tar.gz vmime-a67f0a537e4e0e70c575d3606ce3460f3b16b5f1.zip |
Ensure 'unsigned long' is 4 bytes long (Georg Sauthoff).
-rw-r--r-- | src/security/digest/sha1/sha1MessageDigest.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/security/digest/sha1/sha1MessageDigest.cpp b/src/security/digest/sha1/sha1MessageDigest.cpp index a51e250d..51eec6ae 100644 --- a/src/security/digest/sha1/sha1MessageDigest.cpp +++ b/src/security/digest/sha1/sha1MessageDigest.cpp @@ -27,6 +27,7 @@ #include "vmime/security/digest/sha1/sha1MessageDigest.hpp" #include <cstring> +#include <cassert> namespace vmime { @@ -161,8 +162,8 @@ void sha1MessageDigest::finalize() i = j = 0; std::memset(m_buffer, 0, 64); - std::memset(m_state, 0, 20); - std::memset(m_count, 0, 8); + std::memset(m_state, 0, 5 * sizeof(unsigned long)); + std::memset(m_count, 0, 2 * sizeof(unsigned long)); std::memset(&finalcount, 0, 8); } @@ -201,6 +202,8 @@ void sha1MessageDigest::transform unsigned long l[16]; } CHAR64LONG16; + assert(sizeof(unsigned long) == 4); + CHAR64LONG16* block; static unsigned char workspace[64]; |