summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-12-12 02:10:19 -0500
committerNick Mathewson <nickm@torproject.org>2009-12-12 02:10:19 -0500
commit9e6225ae1662e10f3e6c32af52736b60eb489b55 (patch)
tree58bd66dc3650837882fcea828c3c5817a15e449c /src/common
parent0c1b3070cfec670190636d74f97c2aaf0e521bdb (diff)
parentf1b7295b27ba1f472304f2931bb23df6884b64e6 (diff)
downloadtor-9e6225ae1662e10f3e6c32af52736b60eb489b55.tar.gz
tor-9e6225ae1662e10f3e6c32af52736b60eb489b55.zip
Merge commit 'sebastian/coverity'
Diffstat (limited to 'src/common')
-rw-r--r--src/common/crypto.c9
-rw-r--r--src/common/crypto.h2
2 files changed, 3 insertions, 8 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 4d17a8f216..e996b48a1a 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -427,10 +427,7 @@ crypto_create_init_cipher(const char *key, int encrypt_mode)
return NULL;
}
- if (crypto_cipher_set_key(crypto, key)) {
- crypto_log_errors(LOG_WARN, "setting symmetric key");
- goto error;
- }
+ crypto_cipher_set_key(crypto, key);
if (encrypt_mode)
r = crypto_cipher_encrypt_init_cipher(crypto);
@@ -1254,16 +1251,14 @@ crypto_cipher_generate_key(crypto_cipher_env_t *env)
/** Set the symmetric key for the cipher in <b>env</b> to the first
* CIPHER_KEY_LEN bytes of <b>key</b>. Does not initialize the cipher.
- * Return 0 on success, -1 on failure.
*/
-int
+void
crypto_cipher_set_key(crypto_cipher_env_t *env, const char *key)
{
tor_assert(env);
tor_assert(key);
memcpy(env->key, key, CIPHER_KEY_LEN);
- return 0;
}
/** Generate an initialization vector for our AES-CTR cipher; store it
diff --git a/src/common/crypto.h b/src/common/crypto.h
index d9adb16f80..239acb5871 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -151,7 +151,7 @@ int crypto_pk_check_fingerprint_syntax(const char *s);
/* symmetric crypto */
int crypto_cipher_generate_key(crypto_cipher_env_t *env);
-int crypto_cipher_set_key(crypto_cipher_env_t *env, const char *key);
+void crypto_cipher_set_key(crypto_cipher_env_t *env, const char *key);
void crypto_cipher_generate_iv(char *iv_out);
int crypto_cipher_set_iv(crypto_cipher_env_t *env, const char *iv);
const char *crypto_cipher_get_key(crypto_cipher_env_t *env);