mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
bugfix: our integrity-checking digest was checking only the most
recent cell, not the previous cells like we'd thought. this change is backward incompatible. svn:r1868
This commit is contained in:
parent
04bb8c8046
commit
6dc576bab7
@ -1029,9 +1029,12 @@ void crypto_digest_get_digest(crypto_digest_env_t *digest,
|
||||
char *out, size_t out_len)
|
||||
{
|
||||
static char r[DIGEST_LEN];
|
||||
SHA_CTX tmpctx;
|
||||
tor_assert(digest && out);
|
||||
tor_assert(out_len <= DIGEST_LEN);
|
||||
SHA1_Final(r, &digest->d);
|
||||
/* memcpy into a temporary ctx, since SHA1_Final clears the context */
|
||||
memcpy(&tmpctx, &digest->d, sizeof(SHA_CTX));
|
||||
SHA1_Final(r, &tmpctx);
|
||||
memcpy(out, r, out_len);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user