summaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2005-10-17 16:21:42 +0000
committerPeter Palfrader <peter@palfrader.org>2005-10-17 16:21:42 +0000
commit0d9aedfcea6d9b9f2e36bcc6176da8ac0f31a9b0 (patch)
treeb4e573d9050e828ba4bc6659f3db42f31a4667e7 /src/common/crypto.c
parentbec2271029463b426a9c87330ff392b9807d62ec (diff)
downloadtor-0d9aedfcea6d9b9f2e36bcc6176da8ac0f31a9b0.tar.gz
tor-0d9aedfcea6d9b9f2e36bcc6176da8ac0f31a9b0.zip
Downgrade a few INFO level logs to DEBUG again. Also add two or three new
logs in cases where a calling function's log was downgraded and we wouldn't get any log message otherwise. svn:r5263
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index bb30fc6614..4ec48ee7da 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -738,7 +738,7 @@ crypto_pk_private_decrypt(crypto_pk_env_t *env, char *to,
env->key, crypto_get_rsa_padding(padding));
if (r<0) {
- crypto_log_errors(warnOnFailure?LOG_WARN:LOG_INFO,
+ crypto_log_errors(warnOnFailure?LOG_WARN:LOG_DEBUG,
"performing RSA decryption");
return -1;
}
@@ -942,7 +942,7 @@ crypto_pk_private_hybrid_decrypt(crypto_pk_env_t *env,
}
outlen = crypto_pk_private_decrypt(env,buf,from,pkeylen,padding,warnOnFailure);
if (outlen<0) {
- log_fn(warnOnFailure?LOG_WARN:LOG_INFO, "Error decrypting public-key data");
+ log_fn(warnOnFailure?LOG_WARN:LOG_DEBUG, "Error decrypting public-key data");
return -1;
}
if (outlen < CIPHER_KEY_LEN) {
@@ -1425,8 +1425,10 @@ crypto_dh_get_public(crypto_dh_env_t *dh, char *pubkey, size_t pubkey_len)
tor_assert(dh->dh->pub_key);
bytes = BN_num_bytes(dh->dh->pub_key);
tor_assert(bytes >= 0);
- if (pubkey_len < (size_t)bytes)
+ if (pubkey_len < (size_t)bytes) {
+ log_fn(LOG_WARN, "Weird! pubkey_len (%d) was smaller than DH_BYTES (%d)", (int) pubkey_len, bytes);
return -1;
+ }
memset(pubkey, 0, pubkey_len);
BN_bn2bin(dh->dh->pub_key, (unsigned char*)(pubkey+(pubkey_len-bytes)));