summaryrefslogtreecommitdiff
path: root/src/or/shared_random.c
diff options
context:
space:
mode:
authorChelsea H. Komlo <chelsea.komlo@gmail.com>2016-11-17 22:58:36 -0500
committerChelsea H. Komlo <chelsea.komlo@gmail.com>2016-11-24 12:13:07 -0500
commit9d9110f65db8af5ea4ddf93b01a099eb53e9b59f (patch)
tree04edf37906e4e621dfcd6eb69a2d7d786a9b3c15 /src/or/shared_random.c
parent276d07a88a3b595aff9e28c7f1862563d2751b55 (diff)
downloadtor-9d9110f65db8af5ea4ddf93b01a099eb53e9b59f.tar.gz
tor-9d9110f65db8af5ea4ddf93b01a099eb53e9b59f.zip
crypto_digest256 returns expected error value of -1
Diffstat (limited to 'src/or/shared_random.c')
-rw-r--r--src/or/shared_random.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/shared_random.c b/src/or/shared_random.c
index 5f6b03f1ba..0eb93382ca 100644
--- a/src/or/shared_random.c
+++ b/src/or/shared_random.c
@@ -192,7 +192,7 @@ verify_commit_and_reveal(const sr_commit_t *commit)
/* Use the invariant length since the encoded reveal variable has an
* extra byte for the NUL terminated byte. */
if (crypto_digest256(received_hashed_reveal, commit->encoded_reveal,
- SR_REVEAL_BASE64_LEN, commit->alg)) {
+ SR_REVEAL_BASE64_LEN, commit->alg) < 0) {
/* Unable to digest the reveal blob, this is unlikely. */
goto invalid;
}
@@ -932,7 +932,7 @@ sr_generate_our_commit(time_t timestamp, const authority_cert_t *my_rsa_cert)
/* The invariant length is used here since the encoded reveal variable
* has an extra byte added for the NULL terminated byte. */
if (crypto_digest256(commit->hashed_reveal, commit->encoded_reveal,
- SR_REVEAL_BASE64_LEN, commit->alg)) {
+ SR_REVEAL_BASE64_LEN, commit->alg) < 0) {
goto error;
}
@@ -1012,7 +1012,7 @@ sr_compute_srv(void)
SMARTLIST_FOREACH(chunks, char *, s, tor_free(s));
smartlist_free(chunks);
if (crypto_digest256(hashed_reveals, reveals, strlen(reveals),
- SR_DIGEST_ALG)) {
+ SR_DIGEST_ALG) < 0) {
goto end;
}
current_srv = generate_srv(hashed_reveals, reveal_num,