mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* sign.c (hash_for, sign_file): When encrypting and signing at the same
time, consult the various hash prefs to pick a hash algorithm to use. Pass in a 160-bit hint if any of the signing keys are DSA. * keydb.h, pkclist.c (select_algo_from_prefs, algo_available): Pass a "hints" opaque pointer in to let the caller give hints as to what algorithms would be acceptable. The only current hint is for PREFTYPE_HASH to require a 160-bit hash for DSA. Change all callers in encode.c (encode_crypt, encrypt_filter) and sign.c (sign_file). If we settle on MD5 as the best algorithm based solely on recepient keys and SHA1 is also a possibility, use SHA1 unless the user intentionally chose MD5. This is as per 2440:13. * exec.c (make_tempdir): Fix duplicated filename problem.
This commit is contained in:
parent
ae02cf4630
commit
fd08b13528
6 changed files with 115 additions and 20 deletions
16
g10/exec.c
16
g10/exec.c
|
@ -93,10 +93,12 @@ static int win_system(const char *command)
|
|||
/* Makes a temp directory and filenames */
|
||||
static int make_tempdir(struct exec_info *info)
|
||||
{
|
||||
char *tmp=opt.temp_dir,*name=info->name;
|
||||
char *tmp=opt.temp_dir,*namein=info->name,*nameout;
|
||||
|
||||
if(!name)
|
||||
name=info->binary?"tempfile" EXTSEP_S "bin":"tempfile" EXTSEP_S "txt";
|
||||
if(!namein)
|
||||
namein=info->binary?"tempin" EXTSEP_S "bin":"tempin" EXTSEP_S "txt";
|
||||
|
||||
nameout=info->binary?"tempout" EXTSEP_S "bin":"tempout" EXTSEP_S "txt";
|
||||
|
||||
/* Make up the temp dir and files in case we need them */
|
||||
|
||||
|
@ -151,14 +153,14 @@ static int make_tempdir(struct exec_info *info)
|
|||
info->madedir=1;
|
||||
|
||||
info->tempfile_in=m_alloc(strlen(info->tempdir)+
|
||||
strlen(DIRSEP_S)+strlen(name)+1);
|
||||
sprintf(info->tempfile_in,"%s" DIRSEP_S "%s",info->tempdir,name);
|
||||
strlen(DIRSEP_S)+strlen(namein)+1);
|
||||
sprintf(info->tempfile_in,"%s" DIRSEP_S "%s",info->tempdir,namein);
|
||||
|
||||
if(!info->writeonly)
|
||||
{
|
||||
info->tempfile_out=m_alloc(strlen(info->tempdir)+
|
||||
strlen(DIRSEP_S)+strlen(name)+1);
|
||||
sprintf(info->tempfile_out,"%s" DIRSEP_S "%s",info->tempdir,name);
|
||||
strlen(DIRSEP_S)+strlen(nameout)+1);
|
||||
sprintf(info->tempfile_out,"%s" DIRSEP_S "%s",info->tempdir,nameout);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue