diff options
author | Hassan Alsibyani <sibyani@mit.edu> | 2016-02-06 12:14:39 -0500 |
---|---|---|
committer | Hassan Alsibyani <sibyani@mit.edu> | 2016-02-06 12:14:39 -0500 |
commit | edd93f9de8aedec41afc7f6472ab381bc34d0246 (patch) | |
tree | e70f7eb5b23a3eb9881d459a851f8fce84b45c66 /src | |
parent | 1f5cdf2b6c72ae89eea630a2c4693273ff1aee6c (diff) | |
download | tor-edd93f9de8aedec41afc7f6472ab381bc34d0246.tar.gz tor-edd93f9de8aedec41afc7f6472ab381bc34d0246.zip |
changing output of crypto_cipher_crypt_inplace from int to void
Diffstat (limited to 'src')
-rw-r--r-- | src/common/crypto.c | 5 | ||||
-rw-r--r-- | src/common/crypto.h | 2 | ||||
-rw-r--r-- | src/or/relay.c | 9 |
3 files changed, 5 insertions, 11 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index bc659b1935..c59dd52b34 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -1531,14 +1531,13 @@ crypto_cipher_decrypt(crypto_cipher_t *env, char *to, } /** Encrypt <b>len</b> bytes on <b>from</b> using the cipher in <b>env</b>; - * on success, return 0. Does not check for failure. + * on success. Does not check for failure. */ -int +void crypto_cipher_crypt_inplace(crypto_cipher_t *env, char *buf, size_t len) { tor_assert(len < SIZE_T_CEILING); aes_crypt_inplace(env->cipher, buf, len); - return 0; } /** Encrypt <b>fromlen</b> bytes (at least 1) from <b>from</b> with the key in diff --git a/src/common/crypto.h b/src/common/crypto.h index fa2ed610c7..74b88bcd4a 100644 --- a/src/common/crypto.h +++ b/src/common/crypto.h @@ -205,7 +205,7 @@ int crypto_cipher_encrypt(crypto_cipher_t *env, char *to, const char *from, size_t fromlen); int crypto_cipher_decrypt(crypto_cipher_t *env, char *to, const char *from, size_t fromlen); -int crypto_cipher_crypt_inplace(crypto_cipher_t *env, char *d, size_t len); +void crypto_cipher_crypt_inplace(crypto_cipher_t *env, char *d, size_t len); int crypto_cipher_encrypt_with_iv(const char *key, char *to, size_t tolen, diff --git a/src/or/relay.c b/src/or/relay.c index aea51a165b..9d44428c09 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -148,20 +148,15 @@ relay_digest_matches(crypto_digest_t *digest, cell_t *cell) * * If <b>encrypt_mode</b> is 1 then encrypt, else decrypt. * - * Return -1 if the crypto fails, else return 0. + * Returns 0. */ static int relay_crypt_one_payload(crypto_cipher_t *cipher, uint8_t *in, int encrypt_mode) { - int r; (void)encrypt_mode; - r = crypto_cipher_crypt_inplace(cipher, (char*) in, CELL_PAYLOAD_SIZE); + crypto_cipher_crypt_inplace(cipher, (char*) in, CELL_PAYLOAD_SIZE); - if (r) { - log_warn(LD_BUG,"Error during relay encryption"); - return -1; - } return 0; } |