1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpg: Make progress work for large files on Windows.

* common/iobuf.c (iobuf_get_filelength): Change return type to
uint64_t and remove the overflow args.  For Windows always use
GetFileSizeEx which is available since the long EOL-ed Windows XP.

* g10/sign.c (write_plaintext_packet): Adjust for changed
iobuf_get_filelength.
* g10/encrypt.c (encrypt_simple, encrypt_crypt): Ditto.
* g10/photoid.c (generate_photo_id): Ditto.  Also add an upper limit.

* g10/filter.h (progress_filter_context_t): Change amount values to
use uint64_t.
* g10/progress.c (write_status_progress): Change accordingly.

--
GnuPG-bug-id: 6534

Backported-from: 808494b485
This commit is contained in:
Werner Koch 2023-06-13 10:07:07 +02:00
parent 8425cdcc8e
commit 1b60aab2c4
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
10 changed files with 58 additions and 91 deletions

View file

@ -2869,8 +2869,7 @@ literal (const char *option, int argc, char *argv[], void *cookie)
if (data->file)
{
iobuf_t in;
int overflow;
off_t off;
uint64_t off;
in = iobuf_open (data->filename);
if (! in)
@ -2881,10 +2880,10 @@ literal (const char *option, int argc, char *argv[], void *cookie)
break;
}
off = iobuf_get_filelength (in, &overflow);
off = iobuf_get_filelength (in);
iobuf_close (in);
if (overflow || off == 0)
if (off == 0)
/* Length is unknown or there was an error
(unfortunately, iobuf_get_filelength doesn't
distinguish between 0 length files and an error!).