common: Add stream interface to call-pgp.
authorJustus Winter <justus@g10code.com>
Tue, 24 Nov 2015 17:31:14 +0000 (18:31 +0100)
committerJustus Winter <justus@g10code.com>
Wed, 25 Nov 2015 11:19:50 +0000 (12:19 +0100)
commit03bf88f32c8d203d5b3bfbbc48cc45e6c08cc187
tree30ad5c7a7377a62ed0b3522ba88fd6f8c67f71a9
parentcb18d802308bde4e28219417bb4d107a4c0001b4
common: Add stream interface to call-pgp.

* common/call-gpg.c (struct writer_thread_parms): Add field 'stream'.
(writer_thread_main): Support reading from a stream.
(start_writer): Add stream argument.
(struct reader_thread_parms): Add field 'stream'.
(reader_thread_main): Support writing to a stream.
(start_reader): Add stream argument.
(_gpg_encrypt): Add stream api.
(gpg_encrypt_blob): Adapt accordingly.
(gpg_encrypt_stream): New function.
(_gpg_decrypt): Add stream api.
(gpg_decrypt_blob): Adapt accordingly.
(gpg_decrypt_stream): New function.
* common/call-gpg.h (gpg_encrypt_stream): New prototype.
(gpg_decrypt_stream): Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
common/call-gpg.c
common/call-gpg.h