mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +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) {
|
switch (digest->algorithm) {
|
||||||
case DIGEST_SHA1:
|
case DIGEST_SHA1:
|
||||||
tor_assert(out_len <= DIGEST_LEN);
|
tor_assert(out_len <= DIGEST_LEN);
|
||||||
SHA1_Final(r, &digest->d.sha1);
|
SHA1_Final(r, &tmpenv.d.sha1);
|
||||||
break;
|
break;
|
||||||
case DIGEST_SHA256:
|
case DIGEST_SHA256:
|
||||||
tor_assert(out_len <= DIGEST256_LEN);
|
tor_assert(out_len <= DIGEST256_LEN);
|
||||||
SHA256_Final(r, &digest->d.sha2);
|
SHA256_Final(r, &tmpenv.d.sha2);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
tor_fragile_assert();
|
tor_fragile_assert();
|
||||||
|
Loading…
Reference in New Issue
Block a user