diff options
Diffstat (limited to 'src/or/rendcommon.c')
-rw-r--r-- | src/or/rendcommon.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c index 1e0fb8af1d..40f84625b3 100644 --- a/src/or/rendcommon.c +++ b/src/or/rendcommon.c @@ -182,8 +182,8 @@ rend_parse_service_descriptor(const char *str, size_t len) cp += 8+DIGEST_LEN; if (end-cp < klen) goto truncated; if (!(info->onion_key = crypto_pk_asn1_decode(cp,klen))) { - warn(LD_PROTOCOL, - "Internal error decoding onion key for intro point."); + log_warn(LD_PROTOCOL, + "Internal error decoding onion key for intro point."); goto error; } cp += klen; @@ -193,21 +193,22 @@ rend_parse_service_descriptor(const char *str, size_t len) tor_assert(end-cp >= 0); if ((size_t)(end-cp) < keylen) goto truncated; if ((size_t)(end-cp) > keylen) { - warn(LD_PROTOCOL, "Signature is %d bytes too long on service descriptor.", - (int)((size_t)(end-cp) - keylen)); + log_warn(LD_PROTOCOL, + "Signature is %d bytes too long on service descriptor.", + (int)((size_t)(end-cp) - keylen)); goto error; } if (crypto_pk_public_checksig_digest(result->pk, (char*)str,cp-str, /* data */ (char*)cp,end-cp /* signature*/ )<0) { - warn(LD_PROTOCOL, "Bad signature on service descriptor."); + log_warn(LD_PROTOCOL, "Bad signature on service descriptor."); goto error; } return result; truncated: - warn(LD_PROTOCOL, "Truncated service descriptor."); + log_warn(LD_PROTOCOL, "Truncated service descriptor."); error: rend_service_descriptor_free(result); return NULL; @@ -367,37 +368,37 @@ rend_cache_store(const char *desc, size_t desc_len) tor_assert(rend_cache); parsed = rend_parse_service_descriptor(desc,desc_len); if (!parsed) { - warn(LD_PROTOCOL,"Couldn't parse service descriptor."); + log_warn(LD_PROTOCOL,"Couldn't parse service descriptor."); return -1; } if (rend_get_service_id(parsed->pk, query)<0) { - warn(LD_BUG,"Couldn't compute service ID."); + log_warn(LD_BUG,"Couldn't compute service ID."); rend_service_descriptor_free(parsed); return -1; } tor_snprintf(key, sizeof(key), "%c%s", parsed->version?'1':'0', query); now = time(NULL); if (parsed->timestamp < now-REND_CACHE_MAX_AGE-REND_CACHE_MAX_SKEW) { - warn(LD_REND,"Service descriptor %s is too old.", safe_str(query)); + log_warn(LD_REND,"Service descriptor %s is too old.", safe_str(query)); rend_service_descriptor_free(parsed); return -1; } if (parsed->timestamp > now+REND_CACHE_MAX_SKEW) { - warn(LD_REND,"Service descriptor %s is too far in the future.", - safe_str(query)); + log_warn(LD_REND,"Service descriptor %s is too far in the future.", + safe_str(query)); rend_service_descriptor_free(parsed); return -1; } e = (rend_cache_entry_t*) strmap_get_lc(rend_cache, key); if (e && e->parsed->timestamp > parsed->timestamp) { - info(LD_REND,"We already have a newer service descriptor %s with the " - "same ID and version.", safe_str(query)); + log_info(LD_REND,"We already have a newer service descriptor %s with the " + "same ID and version.", safe_str(query)); rend_service_descriptor_free(parsed); return 0; } if (e && e->len == desc_len && !memcmp(desc,e->desc,desc_len)) { - info(LD_REND,"We already have this service descriptor %s.", - safe_str(query)); + log_info(LD_REND,"We already have this service descriptor %s.", + safe_str(query)); e->received = time(NULL); rend_service_descriptor_free(parsed); return 0; @@ -415,8 +416,8 @@ rend_cache_store(const char *desc, size_t desc_len) e->desc = tor_malloc(desc_len); memcpy(e->desc, desc, desc_len); - debug(LD_REND,"Successfully stored rend desc '%s', len %d.", - safe_str(query), (int)desc_len); + log_debug(LD_REND,"Successfully stored rend desc '%s', len %d.", + safe_str(query), (int)desc_len); return 1; } |