diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2019-01-12 00:24:56 -0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-01-16 08:33:34 +0100 |
commit | 7aae4aad3fde187b51baab100014c19dc0195c67 (patch) | |
tree | 2424dbb6bf7a926ff0f3837183e92593936f9b70 /crypto | |
parent | 3d036263a42c2fd89272a68c457d31018a878de5 (diff) | |
download | barebox-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.c | 6 |
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; |