summaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-02-06 13:54:09 -0500
committerNick Mathewson <nickm@torproject.org>2016-02-06 13:54:09 -0500
commit03371e3d3cfe6c3a1859b316c24061a0d7e5d1bd (patch)
tree3369e7de1b8da2a923e3d247e5cd48550505f90c /src/common/crypto.c
parentf3a0de0c2c7ac80ca77ccec49e625ea44986751e (diff)
parentef5f35971f37387d04c9cc42048b7ea24a9bcaec (diff)
downloadtor-03371e3d3cfe6c3a1859b316c24061a0d7e5d1bd.tar.gz
tor-03371e3d3cfe6c3a1859b316c24061a0d7e5d1bd.zip
Merge branch 'cleaned_aes_crypt'
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index c59dd52b34..5714eeafdf 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1509,7 +1509,8 @@ crypto_cipher_encrypt(crypto_cipher_t *env, char *to,
tor_assert(to);
tor_assert(fromlen < SIZE_T_CEILING);
- aes_crypt(env->cipher, from, fromlen, to);
+ memcpy(to, from, fromlen);
+ aes_crypt_inplace(env->cipher, to, fromlen);
return 0;
}
@@ -1526,7 +1527,8 @@ crypto_cipher_decrypt(crypto_cipher_t *env, char *to,
tor_assert(to);
tor_assert(fromlen < SIZE_T_CEILING);
- aes_crypt(env->cipher, from, fromlen, to);
+ memcpy(to, from, fromlen);
+ aes_crypt_inplace(env->cipher, to, fromlen);
return 0;
}
@@ -3153,4 +3155,3 @@ crypto_global_cleanup(void)
}
/** @} */
-