Reduce memory allocations due to HMAC() and EVP_MD_*().
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 18 Feb 2018 15:51:06 +0000 (16:51 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 18 Feb 2018 15:51:06 +0000 (16:51 +0100)
HMAC() allocates a temporary buffer on the heap each time it is called.
Similarly, we called EVP_MD_CTX_create() every time we wanted to
calculate a hash. Use HMAC_CTX and EVP_MD_CTX variables to store the
state so no (re)allocations are necessary. HMAC() was called for every
legacy packet sent and received.

This issue was found thanks to heaptrack.


No differences found