1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-12 18:13:50 -05:00
Simon Tatham dbc77dbd7a Change the rules for how we free a linked cipher and MAC.
In the situation where a MAC and cipher implementation are tied
together by being facets of the same underlying object (used by the
inseparable ChaCha20 + Poly1305 pair), previously we freed them by
having the cipher_free function actually do the freeing, having the
mac_free function do nothing, and taking great care to call those in
the right order. (Otherwise, the mac_free function dereferences a
no-longer-valid vtable pointer and doesn't get as far as _finding out_
that it doesn't have to do anything.)

That's a time bomb in general, and especially awkward in situations
like testcrypt where we don't get precise control over freeing order
in any case. So I've replaced that system with one in which there are
two flags in the ChaCha20-Poly1305 structure, saying whether each of
the cipher and MAC facets is currently considered to be allocated.
When the last of those flags is cleared, the object is actually freed.
So now they can be freed in either order.
2022-08-16 18:22:29 +01:00
..
2021-04-21 21:55:26 +01:00
2021-04-21 21:55:26 +01:00
2021-04-21 21:55:26 +01:00
2022-04-15 17:46:06 +01:00
2021-04-21 21:55:26 +01:00
2021-04-21 21:55:26 +01:00