summaryrefslogtreecommitdiffstats
path: root/g10/encrypt.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2018-01-10 17:33:50 +0100
committerWerner Koch <wk@gnupg.org>2018-01-10 17:33:50 +0100
commit81d71818d054a5faa9153fd52a4b79bbbb71e9d5 (patch)
treecd62338a213ae45861d4db23be7bee638aed85ed /g10/encrypt.c
parentgpg: New option --force-aead (diff)
downloadgnupg2-81d71818d054a5faa9153fd52a4b79bbbb71e9d5.tar.xz
gnupg2-81d71818d054a5faa9153fd52a4b79bbbb71e9d5.zip
gpg: Add stub function for encrypting AEAD.
* g10/cipher.c (cipher_filter): Rename to cipher_filter_cfb. * g10/cipher-aead.c: New. Right now only with a stub function. * g10/Makefile.am (gpg_sources): Add file. * g10/encrypt.c (encrypt_simple): Push either cipher_filter_cfb or cipher_filter_aead. (encrypt_crypt): Ditto. (encrypt_filter): Ditto. * g10/sign.c (sign_symencrypt_file): Ditto. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/encrypt.c')
-rw-r--r--g10/encrypt.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/g10/encrypt.c b/g10/encrypt.c
index 2951a45ff..01feb4a7d 100644
--- a/g10/encrypt.c
+++ b/g10/encrypt.c
@@ -409,7 +409,10 @@ encrypt_simple (const char *filename, int mode, int use_seskey)
/* Register the cipher filter. */
if (mode)
- iobuf_push_filter ( out, cipher_filter, &cfx );
+ iobuf_push_filter (out,
+ cfx.dek->use_aead? cipher_filter_aead
+ /**/ : cipher_filter_cfb,
+ &cfx );
/* Register the compress filter. */
if ( do_compress )
@@ -800,7 +803,10 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
cfx.datalen = filesize && !do_compress ? filesize : 0;
/* Register the cipher filter. */
- iobuf_push_filter (out, cipher_filter, &cfx);
+ iobuf_push_filter (out,
+ cfx.dek->use_aead? cipher_filter_aead
+ /**/ : cipher_filter_cfb,
+ &cfx);
/* Register the compress filter. */
if (do_compress)
@@ -959,7 +965,10 @@ encrypt_filter (void *opaque, int control,
return rc;
}
- iobuf_push_filter (a, cipher_filter, &efx->cfx);
+ iobuf_push_filter (a,
+ efx->cfx.dek->use_aead? cipher_filter_aead
+ /**/ : cipher_filter_cfb,
+ &efx->cfx);
efx->header_okay = 1;
}