diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-02-22 19:09:45 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-02-22 19:09:45 +0000 |
commit | e7db789e82a7a2edc5c7e8230265f8ec83021f69 (patch) | |
tree | c8af0a1fe11383d565d916634a7c0d4c963ce4ec /src/common | |
parent | a20eda5669cc5ce8b8c02d16ea80f642b7de64f9 (diff) | |
download | tor-e7db789e82a7a2edc5c7e8230265f8ec83021f69.tar.gz tor-e7db789e82a7a2edc5c7e8230265f8ec83021f69.zip |
r14399@tombo: nickm | 2008-02-22 14:09:38 -0500
More 64-to-32 fixes. Partial backport candidate. still not done.
svn:r13680
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/crypto.c | 6 | ||||
-rw-r--r-- | src/common/crypto.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index 35f2beaf88..8a1c3e9bc5 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -715,7 +715,7 @@ crypto_pk_public_checksig(crypto_pk_env_t *env, char *to, */ int crypto_pk_public_checksig_digest(crypto_pk_env_t *env, const char *data, - int datalen, const char *sig, int siglen) + size_t datalen, const char *sig, size_t siglen) { char digest[DIGEST_LEN]; char *buf; @@ -935,12 +935,12 @@ crypto_pk_private_hybrid_decrypt(crypto_pk_env_t *env, * Return -1 on error, or the number of characters used on success. */ int -crypto_pk_asn1_encode(crypto_pk_env_t *pk, char *dest, int dest_len) +crypto_pk_asn1_encode(crypto_pk_env_t *pk, char *dest, size_t dest_len) { int len; unsigned char *buf, *cp; len = i2d_RSAPublicKey(pk->key, NULL); - if (len < 0 || len > dest_len) + if (len < 0 || (size_t)len > dest_len) return -1; cp = buf = tor_malloc(len+1); len = i2d_RSAPublicKey(pk->key, &cp); diff --git a/src/common/crypto.h b/src/common/crypto.h index f25bc89947..e51c0777a9 100644 --- a/src/common/crypto.h +++ b/src/common/crypto.h @@ -97,7 +97,7 @@ int crypto_pk_private_decrypt(crypto_pk_env_t *env, char *to, int crypto_pk_public_checksig(crypto_pk_env_t *env, char *to, const char *from, size_t fromlen); int crypto_pk_public_checksig_digest(crypto_pk_env_t *env, const char *data, - int datalen, const char *sig, int siglen); + size_t datalen, const char *sig, size_t siglen); int crypto_pk_private_sign(crypto_pk_env_t *env, char *to, const char *from, size_t fromlen); int crypto_pk_private_sign_digest(crypto_pk_env_t *env, char *to, @@ -109,7 +109,7 @@ int crypto_pk_private_hybrid_decrypt(crypto_pk_env_t *env, char *to, const char *from, size_t fromlen, int padding, int warnOnFailure); -int crypto_pk_asn1_encode(crypto_pk_env_t *pk, char *dest, int dest_len); +int crypto_pk_asn1_encode(crypto_pk_env_t *pk, char *dest, size_t dest_len); crypto_pk_env_t *crypto_pk_asn1_decode(const char *str, size_t len); int crypto_pk_get_digest(crypto_pk_env_t *pk, char *digest_out); int crypto_pk_get_fingerprint(crypto_pk_env_t *pk, char *fp_out,int add_space); |