From 5da3b45fdce8354e320df91b26a170b21291c32e Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 20 Aug 2009 12:03:32 -0400 Subject: [PATCH] Make crypto_digest_get_digest nondestructive again. Fixes bug in f57883a39. --- src/common/crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/crypto.c b/src/common/crypto.c index dc645b5eda..4a61d3faf3 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();