diff options
author | Taylor Yu <catalyst@torproject.org> | 2017-04-07 18:06:13 -0400 |
---|---|---|
committer | Taylor Yu <catalyst@torproject.org> | 2017-04-07 18:19:15 -0400 |
commit | 26dd4d92cfac7a201607caf280accec1b2d7d897 (patch) | |
tree | a328f4e72d3d05b9f0ef039ac8845afc24ddc020 | |
parent | 2b38bb28b470dbca322ae64b7c5eaef9cd7206fa (diff) | |
download | tor-26dd4d92cfac7a201607caf280accec1b2d7d897.tar.gz tor-26dd4d92cfac7a201607caf280accec1b2d7d897.zip |
Remove SR_COMMIT_LEN workaround
Now that base64_decode() checks the destination buffer length against
the actual number of bytes as they're produced, shared_random.c no
longer needs the "SR_COMMIT_LEN+2" workaround.
-rw-r--r-- | src/or/shared_random.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/or/shared_random.c b/src/or/shared_random.c index 73b4c1d0ea..25ca0611cd 100644 --- a/src/or/shared_random.c +++ b/src/or/shared_random.c @@ -230,9 +230,7 @@ commit_decode(const char *encoded, sr_commit_t *commit) { int decoded_len = 0; size_t offset = 0; - /* XXX: Needs two extra bytes for the base64 decode calculation matches - * the binary length once decoded. #17868. */ - char b64_decoded[SR_COMMIT_LEN + 2]; + char b64_decoded[SR_COMMIT_LEN]; tor_assert(encoded); tor_assert(commit); @@ -284,9 +282,7 @@ STATIC int reveal_decode(const char *encoded, sr_commit_t *commit) { int decoded_len = 0; - /* XXX: Needs two extra bytes for the base64 decode calculation matches - * the binary length once decoded. #17868. */ - char b64_decoded[SR_REVEAL_LEN + 2]; + char b64_decoded[SR_REVEAL_LEN]; tor_assert(encoded); tor_assert(commit); |