diff options
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index 73f015f0e..9ffc9934d 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -808,6 +808,12 @@ int crypto_cipher_decrypt(crypto_cipher_env_t *env, unsigned char *from, unsigne } int +crypto_cipher_rewind(crypto_cipher_env_t *env, long delta) +{ + return crypto_cipher_advance(env, -delta); +} + +int crypto_cipher_advance(crypto_cipher_env_t *env, long delta) { if (env->type == CRYPTO_CIPHER_AES_CTR) { @@ -841,8 +847,8 @@ crypto_new_digest_env(int type) void crypto_free_digest_env(crypto_digest_env_t *digest) { - assert(digest); - tor_free(digest); + if(digest) + free(digest); } void |