diff options
Diffstat (limited to 'g10')
-rw-r--r-- | g10/ChangeLog | 15 | ||||
-rw-r--r-- | g10/encode.c | 10 | ||||
-rw-r--r-- | g10/gpg.c (renamed from g10/g10.c) | 2 | ||||
-rw-r--r-- | g10/photoid.c | 6 | ||||
-rw-r--r-- | g10/progress.c | 2 | ||||
-rw-r--r-- | g10/sign.c | 6 |
6 files changed, 32 insertions, 9 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index 875538b8d..c5992a0a0 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,18 @@ +2005-10-05 Werner Koch <[email protected]> + + * g10.c: Renamed to .. + * gpg.c: ..this. + * Makefile.am: Adjusted accordingly. + +2005-09-22 Werner Koch <[email protected]> + + * 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 <[email protected]> * mainproc.c (proc_symkey_enc): Take care of a canceled passphrase diff --git a/g10/encode.c b/g10/encode.c index a4906d62d..5bbe7cf53 100644 --- a/g10/encode.c +++ b/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. * diff --git a/g10/photoid.c b/g10/photoid.c index 885bbca01..d2a249167 100644 --- a/g10/photoid.c +++ b/g10/photoid.c @@ -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", diff --git a/g10/progress.c b/g10/progress.c index a2141e4cb..8c8265f36 100644 --- a/g10/progress.c +++ b/g10/progress.c @@ -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; diff --git a/g10/sign.c b/g10/sign.c index 0e8be714f..fd3c0ab45 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -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 |