summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-01-12 00:24:56 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2019-01-16 08:33:34 +0100
commit7aae4aad3fde187b51baab100014c19dc0195c67 (patch)
tree2424dbb6bf7a926ff0f3837183e92593936f9b70 /crypto
parent3d036263a42c2fd89272a68c457d31018a878de5 (diff)
downloadbarebox-7aae4aad3fde187b51baab100014c19dc0195c67.tar.gz
barebox-7aae4aad3fde187b51baab100014c19dc0195c67.tar.xz
crypto: digest: Change the signature of digest_file_window()
On 32-bit systems "ulong" will limit digest_file_window()'s maximum size to 4 GiB. Convert "start" and "size" to "loff_t" in order to be able to handle maximum file size supported by the rest of the system. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/digest.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/digest.c b/crypto/digest.c
index 7b34742c52..9b7b73019a 100644
--- a/crypto/digest.c
+++ b/crypto/digest.c
@@ -221,7 +221,7 @@ static int digest_update_interruptible(struct digest *d, const void *data,
}
static int digest_update_from_fd(struct digest *d, int fd,
- ulong start, ulong size)
+ loff_t start, loff_t size)
{
unsigned char *buf = xmalloc(PAGE_SIZE);
int ret = 0;
@@ -257,7 +257,7 @@ out_free:
static int digest_update_from_memory(struct digest *d,
const unsigned char *buf,
- ulong size)
+ loff_t size)
{
while (size) {
unsigned long now = min_t(typeof(size), PAGE_SIZE, size);
@@ -277,7 +277,7 @@ static int digest_update_from_memory(struct digest *d,
int digest_file_window(struct digest *d, const char *filename,
unsigned char *hash,
const unsigned char *sig,
- ulong start, ulong size)
+ loff_t start, loff_t size)
{
int fd, ret;
unsigned char *buf;