* options.h, g10.c (main), mainproc.c (proc_encrypted): Return a

decryption failed error if a MDC does not verify.  Warn if a MDC is not
present (can disable via --no-mdc-warning).

* exec.c (exec_write), g10.c (main), keyserver.c (keyserver_spawn): Use
new DISABLE_KEYSERVER_PATH rather than FIXED_EXEC_PATH.
This commit is contained in:
David Shaw 2002-07-30 16:48:21 +00:00
parent 1f703dadd1
commit 928dba9e70
6 changed files with 23 additions and 9 deletions

View File

@ -1,3 +1,13 @@
2002-07-30 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c (main), mainproc.c (proc_encrypted): Return a
decryption failed error if a MDC does not verify. Warn if a MDC
is not present (can disable via --no-mdc-warning).
* exec.c (exec_write), g10.c (main), keyserver.c
(keyserver_spawn): Use new DISABLE_KEYSERVER_PATH rather than
FIXED_EXEC_PATH.
2002-07-28 David Shaw <dshaw@jabberwocky.com>
* sig-check.c (do_check): Properly validate v4 sigs with no hashed

View File

@ -330,10 +330,6 @@ int exec_write(struct exec_info **info,const char *program,
if(program==NULL && args_in==NULL)
BUG();
#ifdef FIXED_EXEC_PATH
set_exec_path(FIXED_EXEC_PATH,0);
#endif
*info=m_alloc_clear(sizeof(struct exec_info));
if(name)

View File

@ -186,6 +186,7 @@ enum cmd_and_opt_values { aNull = 0,
oTrustDBName,
oNoSecmemWarn,
oNoPermissionWarn,
oNoMDCWarn,
oNoArmor,
oNoDefKeyring,
oNoGreeting,
@ -491,6 +492,7 @@ static ARGPARSE_OPTS opts[] = {
{ oTrustDBName, "trustdb-name", 2, "@" },
{ oNoSecmemWarn, "no-secmem-warning", 0, "@" }, /* used only by regression tests */
{ oNoPermissionWarn, "no-permission-warning", 0, "@" },
{ oNoMDCWarn, "no-mdc-warning", 0, "@" },
{ oNoArmor, "no-armor", 0, "@"},
{ oNoArmor, "no-armour", 0, "@"},
{ oNoDefKeyring, "no-default-keyring", 0, "@" },
@ -1315,6 +1317,7 @@ main( int argc, char **argv )
case oCertDigestAlgo: cert_digest_string = m_strdup(pargs.r.ret_str); break;
case oNoSecmemWarn: secmem_set_flags( secmem_get_flags() | 1 ); break;
case oNoPermissionWarn: opt.no_perm_warn=1; break;
case oNoMDCWarn: opt.no_mdc_warn=1; break;
case oCharset:
if( set_native_charset( pargs.r.ret_str ) )
log_error(_("%s is not a valid character set\n"),
@ -1362,12 +1365,10 @@ main( int argc, char **argv )
break;
case oTempDir: opt.temp_dir=pargs.r.ret_str; break;
case oExecPath:
#ifndef FIXED_EXEC_PATH
if(set_exec_path(pargs.r.ret_str,0))
log_error(_("unable to set exec-path to %s\n"),pargs.r.ret_str);
else
opt.exec_path_set=1;
#endif
break;
case oNotation:
add_notation_data( pargs.r.ret_str, 0 );

View File

@ -339,13 +339,16 @@ keyserver_spawn(int action,STRLIST list,
opt.keyserver_options.use_temp_files=1;
#endif
#ifndef FIXED_EXEC_PATH
/* Push the libdir into path */
/* Push the libexecdir into path. If DISABLE_KEYSERVER_PATH is set,
use the 0 arg to replace the path. */
#ifdef DISABLE_KEYSERVER_PATH
set_exec_path(GNUPG_LIBEXECDIR,0);
#else
set_exec_path(GNUPG_LIBEXECDIR,opt.exec_path_set);
#endif
/* Build the filename for the helper to execute */
/* Build the filename for the helper to execute */
command=m_alloc(strlen("gpgkeys_")+strlen(opt.keyserver_scheme)+1);
strcpy(command,"gpgkeys_");
strcat(command,opt.keyserver_scheme);

View File

@ -498,10 +498,13 @@ proc_encrypted( CTX c, PACKET *pkt )
log_info(_("decryption okay\n"));
if( pkt->pkt.encrypted->mdc_method )
write_status( STATUS_GOODMDC );
else if(!opt.no_mdc_warn)
log_info ("WARNING: message was not integrity protected\n");
}
else if( result == G10ERR_BAD_SIGN ) {
log_error(_("WARNING: encrypted message has been manipulated!\n"));
write_status( STATUS_BADMDC );
write_status( STATUS_DECRYPTION_FAILED );
}
else {
write_status( STATUS_DECRYPTION_FAILED );

View File

@ -141,6 +141,7 @@ struct {
*personal_digest_prefs,
*personal_compress_prefs;
int no_perm_warn;
int no_mdc_warn;
char *temp_dir;
int no_encrypt_to;
int interactive;