diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-11-07 16:09:58 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-08 16:44:50 -0500 |
commit | 49dd5ef3a3d1775fdc3c0a7d069d3097b3baeeec (patch) | |
tree | 7189ed200ae8f47bf7d3399d0b99243dc93bced3 /src/or/rendservice.c | |
parent | 758428dd32128874cefacc92ef63c1b5bc9a656e (diff) | |
download | tor-49dd5ef3a3d1775fdc3c0a7d069d3097b3baeeec.tar.gz tor-49dd5ef3a3d1775fdc3c0a7d069d3097b3baeeec.zip |
Add and use and unlikely-to-be-eliminated memwipe()
Apparently some compilers like to eliminate memset() operations on
data that's about to go out-of-scope. I've gone with the safest
possible replacement, which might be a bit slow. I don't think this
is critical path in any way that will affect performance, but if it
is, we can work on that in 0.2.4.
Fixes bug 7352.
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r-- | src/or/rendservice.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 6af4778dfc..d235f089fc 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -1404,10 +1404,10 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request, memcpy(cpath->handshake_digest, keys, DIGEST_LEN); if (extend_info) extend_info_free(extend_info); - memset(keys, 0, sizeof(keys)); + memwipe(keys, 0, sizeof(keys)); return 0; err: - memset(keys, 0, sizeof(keys)); + memwipe(keys, 0, sizeof(keys)); if (dh) crypto_dh_free(dh); if (launched) circuit_mark_for_close(TO_CIRCUIT(launched), reason); |