[tor-bugs] #17796 [Core Tor/Tor]: Make crypto_digest_t allocated using minimal memory
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu Jan 25 15:17:58 UTC 2018
#17796: Make crypto_digest_t allocated using minimal memory
--------------------------+------------------------------------
Reporter: nickm | Owner: (none)
Type: defect | Status: closed
Priority: Low | Milestone: Tor: 0.2.8.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Resolution: implemented
Keywords: | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
--------------------------+------------------------------------
Comment (by Hello71):
I think that this is technically not defined by ISO C. it would be
"better" to use a char flexible array member here. that would actually
make the code simpler, since we use the digest as a "black box" anyways
and just pass it to openssl. unfortunately, that requires C11 alignas.
fortunately, MSVC supports that already.
but... in practice, I highly doubt any compiler will compile this in an
unexpected manner, especially since we only pass the buffer as a pointer
to openssl anyways.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17796#comment:9>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list