diff options
author | David Shaw <[email protected]> | 2002-11-25 04:24:41 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2002-11-25 04:24:41 +0000 |
commit | 0819797911d6d7c75a6a60e4fc331892ca4ced87 (patch) | |
tree | c47c601b680edc4905c6c35e35776e815246ecd7 /g10/sign.c | |
parent | * mainproc.c (proc_encrypted): Use --s2k-digest-algo for passphrase (diff) | |
download | gnupg-0819797911d6d7c75a6a60e4fc331892ca4ced87.tar.gz gnupg-0819797911d6d7c75a6a60e4fc331892ca4ced87.zip |
* main.h, misc.c (default_cipher_algo, default_compress_algo): New.
Return the default algorithm by trying --cipher-algo/--compress-algo, then
the first item in the pref list, then s2k-cipher-algo or ZIP.
* sign.c (sign_file, sign_symencrypt_file), encode.c (encode_simple,
encode_crypt): Call default_cipher_algo and default_compress_algo to get
algorithms.
* g10.c (main): Allow pref selection for compress algo with --openpgp.
Diffstat (limited to 'g10/sign.c')
-rw-r--r-- | g10/sign.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/g10/sign.c b/g10/sign.c index 8e444ddda..524205228 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -775,7 +775,7 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr, if((compr_algo= select_algo_from_prefs(pk_list,PREFTYPE_ZIP,-1,NULL))==-1) - compr_algo=DEFAULT_COMPRESS_ALGO; + compr_algo=default_compress_algo(); } else if(!opt.expert && select_algo_from_prefs(pk_list,PREFTYPE_ZIP, @@ -1048,7 +1048,7 @@ sign_symencrypt_file (const char *fname, STRLIST locusr) s2k->mode = opt.rfc1991? 0:opt.s2k_mode; s2k->hash_algo = opt.s2k_digest_algo; - algo = opt.def_cipher_algo ? opt.def_cipher_algo : opt.s2k_cipher_algo; + algo = default_cipher_algo(); if (!opt.quiet || !opt.batch) log_info (_("%s encryption will be used\n"), cipher_algo_to_string(algo) ); @@ -1099,19 +1099,10 @@ sign_symencrypt_file (const char *fname, STRLIST locusr) iobuf_push_filter( out, cipher_filter, &cfx ); /* Push the Zip filter */ - if (opt.compress) + if (opt.compress && default_compress_algo()) { - int compr_algo=opt.def_compress_algo; - - /* Default */ - if(compr_algo==-1) - compr_algo=DEFAULT_COMPRESS_ALGO; - - if (compr_algo) - { - zfx.algo = compr_algo; - iobuf_push_filter( out, compress_filter, &zfx ); - } + zfx.algo = default_compress_algo(); + iobuf_push_filter( out, compress_filter, &zfx ); } /* Write the one-pass signature packets */ |