char *content = NULL;
struct stat st;
ssize_t r = -1;
+ size_t st_size;
*tag_out = NULL;
st.st_size = 0;
goto end;
if (st.st_size < 32 || st.st_size > 32 + data_out_len)
goto end;
+ st_size = (size_t)st.st_size;
memcpy(prefix, content, 32);
prefix[32] = 0;
*tag_out = tor_strndup(prefix+5+strlen(typestring),
strlen(prefix)-8-strlen(typestring));
- memcpy(data_out, content+32, st.st_size-32);
- r = st.st_size - 32;
+ memcpy(data_out, content+32, st_size-32);
+ r = st_size - 32;
end:
if (content)
- memwipe(content, 0, st.st_size);
+ memwipe(content, 0, st_size);
tor_free(content);
return r;
}
int ed25519_ref10_keygen(unsigned char *pk,unsigned char *sk);
int ed25519_ref10_open(
const unsigned char *signature,
- const unsigned char *m,uint64_t mlen,
+ const unsigned char *m, size_t mlen,
const unsigned char *pk);
int ed25519_ref10_sign(
unsigned char *sig,
- const unsigned char *m,uint64_t mlen,
+ const unsigned char *m, size_t mlen,
const unsigned char *sk, const unsigned char *pk);
/* Added in Tor */
/* 'signature' must be 64-bytes long. */
int crypto_sign_open(
const unsigned char *signature,
- const unsigned char *m,uint64_t mlen,
+ const unsigned char *m, size_t mlen,
const unsigned char *pk
)
{
int crypto_sign(
unsigned char *sig,
- const unsigned char *m,uint64_t mlen,
+ const unsigned char *m, size_t mlen,
const unsigned char *sk,const unsigned char *pk
)
{