diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-10-27 14:28:02 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-10-27 14:28:02 -0400 |
commit | 26e0909e516a91281c2ad1fcac23405f3cc1ee11 (patch) | |
tree | d32ae53346980a28f705d63422027cf5cb330db0 /src/or/hs_descriptor.c | |
parent | d5eea977be405b984e651564736179df4b27b31c (diff) | |
download | tor-26e0909e516a91281c2ad1fcac23405f3cc1ee11.tar.gz tor-26e0909e516a91281c2ad1fcac23405f3cc1ee11.zip |
In the hsdescv3 fuzzer, replace the decryption function.
The new decryption function performs no decryption, skips the salt,
and doesn't check the mac. This allows us to fuzz the
hs_descriptor.c code using unencrypted descriptor test, and exercise
more of the code.
Related to 21509.
Diffstat (limited to 'src/or/hs_descriptor.c')
-rw-r--r-- | src/or/hs_descriptor.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c index 4bc54bdb2d..a8ff3471c7 100644 --- a/src/or/hs_descriptor.c +++ b/src/or/hs_descriptor.c @@ -1303,12 +1303,12 @@ encrypted_data_length_is_valid(size_t len) * generate the right decryption keys; set <b>decrypted_out</b> to the * plaintext. If <b>is_superencrypted_layer</b> is set, this is the outter * encrypted layer of the descriptor. */ -static size_t -decrypt_desc_layer(const hs_descriptor_t *desc, - const uint8_t *encrypted_blob, - size_t encrypted_blob_size, - int is_superencrypted_layer, - char **decrypted_out) +MOCK_IMPL(STATIC size_t, +decrypt_desc_layer,(const hs_descriptor_t *desc, + const uint8_t *encrypted_blob, + size_t encrypted_blob_size, + int is_superencrypted_layer, + char **decrypted_out)) { uint8_t *decrypted = NULL; uint8_t secret_key[HS_DESC_ENCRYPTED_KEY_LEN], secret_iv[CIPHER_IV_LEN]; |