diff options
author | Werner Koch <[email protected]> | 2014-11-13 16:39:31 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-11-13 16:39:31 +0000 |
commit | 69384568f66a48eff3968bb1714aa13925580e9f (patch) | |
tree | fbb539760619692e2bc4069a15869889335edc3d /g10/main.h | |
parent | gpg: Fix a missing LF in debug output. (diff) | |
download | gnupg-69384568f66a48eff3968bb1714aa13925580e9f.tar.gz gnupg-69384568f66a48eff3968bb1714aa13925580e9f.zip |
gpg: Make the use of "--verify FILE" for detached sigs harder.
* g10/openfile.c (open_sigfile): Factor some code out to ...
(get_matching_datafile): new function.
* g10/plaintext.c (hash_datafiles): Do not try to find matching file
in batch mode.
* g10/mainproc.c (check_sig_and_print): Print a warning if a possibly
matching data file is not used by a standard signatures.
--
Allowing to use the abbreviated form for detached signatures is a long
standing bug which has only been noticed by the public with the
release of 2.1.0. :-(
What we do is to remove the ability to check detached signature in
--batch using the one file abbreviated mode. This should exhibit
problems in scripts which use this insecure practice. We also print a
warning if a matching data file exists but was not considered because
the detached signature was actually a standard signature:
gpgv: Good signature from "Werner Koch (dist sig)"
gpgv: WARNING: not a detached signature; \
file 'gnupg-2.1.0.tar.bz2' was NOT verified!
We can only print a warning because it is possible that a standard
signature is indeed to be verified but by coincidence a file with a
matching name is stored alongside the standard signature.
Reported-by: Simon Nicolussi (to gnupg-users on Nov 7)
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/main.h')
-rw-r--r-- | g10/main.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/g10/main.h b/g10/main.h index 76541c771..d313afb1c 100644 --- a/g10/main.h +++ b/g10/main.h @@ -286,7 +286,8 @@ char *make_outfile_name( const char *iname ); char *ask_outfile_name( const char *name, size_t namelen ); int open_outfile (int inp_fd, const char *iname, int mode, int restrictedperm, iobuf_t *a); -iobuf_t open_sigfile( const char *iname, progress_filter_context_t *pfx ); +char *get_matching_datafile (const char *sigfilename); +iobuf_t open_sigfile (const char *sigfilename, progress_filter_context_t *pfx); void try_make_homedir( const char *fname ); char *get_openpgp_revocdir (const char *home); @@ -374,7 +375,7 @@ void decrypt_messages (ctrl_t ctrl, int nfiles, char *files[]); /*-- plaintext.c --*/ int hash_datafiles( gcry_md_hd_t md, gcry_md_hd_t md2, - strlist_t files, const char *sigfilename, int textmode ); + strlist_t files, const char *sigfilename, int textmode); int hash_datafile_by_fd ( gcry_md_hd_t md, gcry_md_hd_t md2, int data_fd, int textmode ); PKT_plaintext *setup_plaintext_name(const char *filename,IOBUF iobuf); |