diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/crypto.c | 3 | ||||
-rw-r--r-- | src/common/torgzip.c | 6 | ||||
-rw-r--r-- | src/common/torgzip.h | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index 932a0a0472..9aea7506ae 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -879,12 +879,11 @@ crypto_pk_private_hybrid_decrypt(crypto_pk_env_t *env, size_t fromlen, int padding, int warnOnFailure) { - int overhead, outlen, r; + int outlen, r; size_t pkeylen; crypto_cipher_env_t *cipher = NULL; char buf[PK_BYTES+1]; - overhead = crypto_get_rsa_padding_overhead(crypto_get_rsa_padding(padding)); pkeylen = crypto_pk_keysize(env); if (fromlen <= pkeylen) { diff --git a/src/common/torgzip.c b/src/common/torgzip.c index 4555ec16f9..83438462a2 100644 --- a/src/common/torgzip.c +++ b/src/common/torgzip.c @@ -274,9 +274,9 @@ tor_gzip_uncompress(char **out, size_t *out_len, /** Try to tell whether the <b>in_len</b>-byte string in <b>in</b> is likely * to be compressed or not. If it is, return the likeliest compression method. - * Otherwise, return 0. + * Otherwise, return UNKNOWN_METHOD. */ -int +compress_method_t detect_compression_method(const char *in, size_t in_len) { if (in_len > 2 && !memcmp(in, "\x1f\x8b", 2)) { @@ -285,7 +285,7 @@ detect_compression_method(const char *in, size_t in_len) (ntohs(get_uint16(in)) % 31) == 0) { return ZLIB_METHOD; } else { - return 0; + return UNKNOWN_METHOD; } } diff --git a/src/common/torgzip.h b/src/common/torgzip.h index 153ab4992d..ca3f493540 100644 --- a/src/common/torgzip.h +++ b/src/common/torgzip.h @@ -29,7 +29,7 @@ tor_gzip_uncompress(char **out, size_t *out_len, int is_gzip_supported(void); -int detect_compression_method(const char *in, size_t in_len); +compress_method_t detect_compression_method(const char *in, size_t in_len); typedef enum { TOR_ZLIB_OK, TOR_ZLIB_DONE, TOR_ZLIB_BUF_FULL, TOR_ZLIB_ERR |