mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-20 10:12:15 +01:00
Make crypto_digest_get_digest nondestructive again.
Fixes bug in f57883a39
.
This commit is contained in:
parent
8771fdfda4
commit
5da3b45fdc
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user