From fde20940b5ca6986dc12215209e8858601bb0c2e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 14 Jun 2021 19:51:28 +0200 Subject: core: New data flags "io-buffer-size" and "sensitive". * src/data.c (_gpgme_data_release): Free buffers. (gpgme_data_seek): Adjust from renamed fields. (gpgme_data_set_flag): Implement new flags. (_gpgme_data_inbound_handler): Allow the use of a malloced buffer. (_gpgme_data_outbound_handler): Ditto. * src/data.h (BUFFER_SIZE): Move out of the struct definition. (struct gpgme_data): Remove pending filed and introduce inbound and outbound fields. * src/conversion.c (_gpgme_wipememory): New. Taken from GnuPG. * src/cJSON.c (wipememory): Use this here too. * tests/run-decrypt.c (main): Add options "--large-buffers" and "--sensitive". -- GnuPG-bug-id: 5478 Signed-off-by: Werner Koch --- doc/gpgme.texi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc') diff --git a/doc/gpgme.texi b/doc/gpgme.texi index ea6693ef..b9908170 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -2253,6 +2253,22 @@ the data. If this is set the OpenPGP engine may use this to decide on buffer allocation strategies and to provide a total value for its progress information. +@item io-buffer-size +The value is a decimal number with the length of internal buffers to +used for internal I/O operations. The value is capped at 1048576 (1 +MiB). In certain environments large buffers can yield a performance +boost for callback bases data object, but the details depend a lot on +the circumstances and the operating system. This flag may only be set +once and must be set before any actual I/O happens ion the data +objects. + +@item sensitive +If the numeric value is not 0 the data object is considered to contain +sensitive information like passwords or key material. If this is set +the internal buffers are securely overwritten with zeroes by +gpgme_data_release. + + @end table This function returns @code{0} on success. -- cgit v1.2.3