[PATCH 6/6] crypto: digest: Change the signature of digest_file_window()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 crypto/digest.c  | 6 +++---
 include/digest.h | 2 +-
 2 files changed, 4 insertions(+), 4 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;
diff --git a/include/digest.h b/include/digest.h
index a1cdbb2d7a..a87e29bd28 100644
--- a/include/digest.h
+++ b/include/digest.h
@@ -100,7 +100,7 @@ void digest_free(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 digest_file(struct digest *d, const char *filename,
 		unsigned char *hash,
 		const unsigned char *sig);
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux