diff options
author | George Kadianakis <desnacked@riseup.net> | 2018-07-10 20:10:22 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-07-17 15:57:46 -0400 |
commit | 0140052a356cdcfe0e2da25aee6b8c376815528c (patch) | |
tree | 2983b9e2454b77ca89605f12bbd2fc0a30f4cb70 /src/lib/crypt_ops/crypto_ope.c | |
parent | d8b71609cb9c2ce15b6a26d11b2bcdedf15b915e (diff) | |
download | tor-0140052a356cdcfe0e2da25aee6b8c376815528c.tar.gz tor-0140052a356cdcfe0e2da25aee6b8c376815528c.zip |
Make the OPE scheme return CRYPTO_OPE_ERROR on error.
Instead of UINT64_MAX.
Diffstat (limited to 'src/lib/crypt_ops/crypto_ope.c')
-rw-r--r-- | src/lib/crypt_ops/crypto_ope.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/crypt_ops/crypto_ope.c b/src/lib/crypt_ops/crypto_ope.c index dd04ffbaaa..644f3bae4a 100644 --- a/src/lib/crypt_ops/crypto_ope.c +++ b/src/lib/crypt_ops/crypto_ope.c @@ -149,7 +149,8 @@ crypto_ope_free_(crypto_ope_t *ope) /** * Return the encrypted value corresponding to <b>input</b>. The input value - * must be in range 1..OPE_INPUT_MAX. Returns UINT64_MAX on an invalid input. + * must be in range 1..OPE_INPUT_MAX. Returns CRYPTO_OPE_ERROR on an invalid + * input. * * NOTE: this function is not constant-time. */ @@ -157,7 +158,7 @@ uint64_t crypto_ope_encrypt(const crypto_ope_t *ope, int plaintext) { if (plaintext <= 0 || plaintext > OPE_INPUT_MAX) - return UINT64_MAX; + return CRYPTO_OPE_ERROR; const int sample_idx = (plaintext / SAMPLE_INTERVAL); const int starting_iv = sample_idx * SAMPLE_INTERVAL; |