diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-04-30 14:45:58 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-04-30 14:45:58 -0400 |
commit | 0034f1095680e2b05c19ec13368ddc936a53058a (patch) | |
tree | e6859977e9ac95876925307f68d342f47d081b66 /src/feature/rend | |
parent | 309467c64e007ea6841c07fdee35eaff0146d541 (diff) | |
download | tor-0034f1095680e2b05c19ec13368ddc936a53058a.tar.gz tor-0034f1095680e2b05c19ec13368ddc936a53058a.zip |
Use safe_mem_is_zero in a few more places.
I don't believe any of these represent a real timing vulnerability
(remote timing against memcmp() on a modern CPU is not easy), but
these are the ones where I believe we should be more careful.
Diffstat (limited to 'src/feature/rend')
-rw-r--r-- | src/feature/rend/rendcache.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/feature/rend/rendcache.c b/src/feature/rend/rendcache.c index abeb150685..c3f86d8c82 100644 --- a/src/feature/rend/rendcache.c +++ b/src/feature/rend/rendcache.c @@ -19,6 +19,8 @@ #include "feature/rend/rend_intro_point_st.h" #include "feature/rend/rend_service_descriptor_st.h" +#include "lib/ctime/di_ops.h" + /** Map from service id (as generated by rend_get_service_id) to * rend_cache_entry_t. */ STATIC strmap_t *rend_cache = NULL; @@ -889,8 +891,8 @@ rend_cache_store_v2_desc_as_client(const char *desc, if (intro_content && intro_size > 0) { int n_intro_points; if (rend_data->auth_type != REND_NO_AUTH && - !tor_mem_is_zero(rend_data->descriptor_cookie, - sizeof(rend_data->descriptor_cookie))) { + !safe_mem_is_zero(rend_data->descriptor_cookie, + sizeof(rend_data->descriptor_cookie))) { char *ipos_decrypted = NULL; size_t ipos_decrypted_size; if (rend_decrypt_introduction_points(&ipos_decrypted, |