[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [tor/master] Make crypto_digest_get_digest nondestructive again.
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Thu, 20 Aug 2009 12:03:32 -0400
Subject: Make crypto_digest_get_digest nondestructive again.
Commit: 5da3b45fdce8354e320df91b26a170b21291c32e
Fixes bug in f57883a39.
---
src/common/crypto.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/crypto.c b/src/common/crypto.c
index dc645b5..4a61d3f 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1510,11 +1510,11 @@ crypto_digest_get_digest(crypto_digest_env_t *digest,
switch (digest->algorithm) {
case DIGEST_SHA1:
tor_assert(out_len <= DIGEST_LEN);
- SHA1_Final(r, &digest->d.sha1);
+ SHA1_Final(r, &tmpenv.d.sha1);
break;
case DIGEST_SHA256:
tor_assert(out_len <= DIGEST256_LEN);
- SHA256_Final(r, &digest->d.sha2);
+ SHA256_Final(r, &tmpenv.d.sha2);
break;
default:
tor_fragile_assert();
--
1.5.6.5