diff options
author | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
commit | 26b5e033ffde3d161382fc9addbfa99738379641 (patch) | |
tree | a344f369ca32945f787a02dee35c3dbe342bed7e /src/shared/Auth/Hmac.cpp | |
parent | f21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff) |
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget
--HG--
branch : trunk
Diffstat (limited to 'src/shared/Auth/Hmac.cpp')
-rw-r--r-- | src/shared/Auth/Hmac.cpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/shared/Auth/Hmac.cpp b/src/shared/Auth/Hmac.cpp index 985b4fb9a56..ed68ce8c5df 100644 --- a/src/shared/Auth/Hmac.cpp +++ b/src/shared/Auth/Hmac.cpp @@ -17,40 +17,32 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #include "Auth/Hmac.h" #include "BigNumber.h" - HmacHash::HmacHash(uint32 len, uint8 *seed) { ASSERT(len == SEED_KEY_SIZE); - HMAC_CTX_init(&m_ctx); HMAC_Init_ex(&m_ctx, seed, SEED_KEY_SIZE, EVP_sha1(), NULL); } - HmacHash::~HmacHash() { HMAC_CTX_cleanup(&m_ctx); } - void HmacHash::UpdateBigNumber(BigNumber *bn) { UpdateData(bn->AsByteArray(), bn->GetNumBytes()); } - void HmacHash::UpdateData(const uint8 *data, int length) { HMAC_Update(&m_ctx, data, length); } - void HmacHash::Finalize() { uint32 length = 0; HMAC_Final(&m_ctx, (uint8*)m_digest, &length); ASSERT(length == SHA_DIGEST_LENGTH) } - uint8 *HmacHash::ComputeHash(BigNumber *bn) { HMAC_Update(&m_ctx, bn->AsByteArray(), bn->GetNumBytes()); |