mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
Renamed g10.c to gpg.c
Filelength fixes for W32.
This commit is contained in:
parent
98dc48464f
commit
bd1df0119c
36 changed files with 2748 additions and 2547 deletions
|
@ -1,3 +1,18 @@
|
|||
2005-10-05 Werner Koch <wk@g10code.com>
|
||||
|
||||
* g10.c: Renamed to ..
|
||||
* gpg.c: ..this.
|
||||
* Makefile.am: Adjusted accordingly.
|
||||
|
||||
2005-09-22 Werner Koch <wk@g10code.com>
|
||||
|
||||
* sign.c (write_plaintext_packet): Don't print an empty file
|
||||
warning if the file is actually too large.
|
||||
* encode.c (encode_simple,encode_crypt): Ditto.
|
||||
* progress.c (handle_progress): Adjusted for iobuf_get_filelength
|
||||
change.
|
||||
* photoid.c (generate_photo_id): Ditto.
|
||||
|
||||
2005-09-20 Werner Koch <wk@g10code.com>
|
||||
|
||||
* mainproc.c (proc_symkey_enc): Take care of a canceled passphrase
|
||||
|
|
10
g10/encode.c
10
g10/encode.c
|
@ -299,8 +299,10 @@ encode_simple( const char *filename, int mode, int use_seskey )
|
|||
if ( !iobuf_is_pipe_filename (filename) && *filename && !opt.textmode )
|
||||
{
|
||||
off_t tmpsize;
|
||||
int overflow;
|
||||
|
||||
if ( !(tmpsize = iobuf_get_filelength(inp)) )
|
||||
if ( !(tmpsize = iobuf_get_filelength(inp, &overflow))
|
||||
&& !overflow )
|
||||
log_info(_("WARNING: `%s' is an empty file\n"), filename );
|
||||
/* We can't encode the length of very large files because
|
||||
OpenPGP uses only 32 bit for file sizes. So if the the
|
||||
|
@ -589,14 +591,16 @@ encode_crypt( const char *filename, STRLIST remusr, int use_symkey )
|
|||
if (!iobuf_is_pipe_filename (filename) && *filename && !opt.textmode )
|
||||
{
|
||||
off_t tmpsize;
|
||||
int overflow;
|
||||
|
||||
if ( !(tmpsize = iobuf_get_filelength(inp)) )
|
||||
if ( !(tmpsize = iobuf_get_filelength(inp, &overflow))
|
||||
&& !overflow )
|
||||
log_info(_("WARNING: `%s' is an empty file\n"), filename );
|
||||
/* We can't encode the length of very large files because
|
||||
OpenPGP uses only 32 bit for file sizes. So if the the
|
||||
size of a file is larger than 2^32 minus some bytes for
|
||||
packet headers, we switch to partial length encoding. */
|
||||
if ( tmpsize < (IOBUF_FILELENGTH_LIMIT - 65536) )
|
||||
if (tmpsize < (IOBUF_FILELENGTH_LIMIT - 65536) )
|
||||
filesize = tmpsize;
|
||||
else
|
||||
filesize = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* g10.c - The GnuPG utility (main for gpg)
|
||||
/* gpg.c - The GnuPG utility (main for gpg)
|
||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
* 2005 Free Software Foundation, Inc.
|
||||
*
|
|
@ -53,6 +53,7 @@ generate_photo_id(PKT_public_key *pk,const char *photo_name)
|
|||
byte *photo=NULL;
|
||||
byte header[16];
|
||||
IOBUF file;
|
||||
int overflow;
|
||||
|
||||
header[0]=0x10; /* little side of photo header length */
|
||||
header[1]=0; /* big side of photo header length */
|
||||
|
@ -119,8 +120,9 @@ generate_photo_id(PKT_public_key *pk,const char *photo_name)
|
|||
continue;
|
||||
}
|
||||
|
||||
len=iobuf_get_filelength(file);
|
||||
if(len>6144)
|
||||
|
||||
len=iobuf_get_filelength(file, &overflow);
|
||||
if(len>6144 || overflow)
|
||||
{
|
||||
tty_printf( _("This JPEG is really large (%d bytes) !\n"),len);
|
||||
if(!cpr_get_answer_is_yes("photoid.jpeg.size",
|
||||
|
|
|
@ -107,7 +107,7 @@ handle_progress (progress_filter_context_t *pfx, IOBUF inp, const char *name)
|
|||
return;
|
||||
|
||||
if ( !iobuf_is_pipe_filename (name) && *name )
|
||||
filesize = iobuf_get_filelength (inp);
|
||||
filesize = iobuf_get_filelength (inp, NULL);
|
||||
else if (opt.set_filesize)
|
||||
filesize = opt.set_filesize;
|
||||
|
||||
|
|
|
@ -561,8 +561,10 @@ write_plaintext_packet (IOBUF out, IOBUF inp, const char *fname, int ptmode)
|
|||
if ( !iobuf_is_pipe_filename (fname) && *fname )
|
||||
{
|
||||
off_t tmpsize;
|
||||
|
||||
if( !(tmpsize = iobuf_get_filelength(inp)) )
|
||||
int overflow;
|
||||
|
||||
if( !(tmpsize = iobuf_get_filelength(inp, &overflow))
|
||||
&& !overflow )
|
||||
log_info (_("WARNING: `%s' is an empty file\n"), fname);
|
||||
|
||||
/* We can't encode the length of very large files because
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue