aboutsummaryrefslogtreecommitdiffstats
path: root/g10/sign.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-11-13 02:54:12 +0000
committerDavid Shaw <[email protected]>2003-11-13 02:54:12 +0000
commitbc1e4357a91b98b39db7f0a5310f9d3f8861aa66 (patch)
tree53c69e38b06721474b1781acd6f7370096b00655 /g10/sign.c
parent* configure.ac: Make sure that the resolver API actually compiles, and not (diff)
downloadgnupg-bc1e4357a91b98b39db7f0a5310f9d3f8861aa66.tar.gz
gnupg-bc1e4357a91b98b39db7f0a5310f9d3f8861aa66.zip
* g10.c (main): Add --symmetric --sign --encrypt.
* main.h, encode.c (setup_symkey): New. Prompt for a passphrase and create a DEK for symmetric encryption. (write_symkey_enc): New. Write out symmetrically encrypted session keys. (encode_crypt, encrypt_filter): Use them here here when creating a message that can be decrypted with a passphrase or a pk. * sign.c (sign_file): Call setup_symkey if we are doing a --symmetric --sign --encrypt.
Diffstat (limited to 'g10/sign.c')
-rw-r--r--g10/sign.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/g10/sign.c b/g10/sign.c
index b24e68f89..e595ce9b1 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -723,6 +723,10 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
if( fname && filenames->next && (!detached || encryptflag) )
log_bug("multiple files can only be detached signed");
+ if(encryptflag==2
+ && (rc=setup_symkey(&efx.symkey_s2k,&efx.symkey_dek)))
+ goto leave;
+
if(opt.ask_sig_expire && !opt.force_v3_sigs && !opt.batch && !RFC1991)
duration=ask_expire_interval(1);