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 --- src/util.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index bc78c9b8..89075848 100644 --- a/src/util.h +++ b/src/util.h @@ -96,6 +96,9 @@ int _gpgme_ttyname_r (int fd, char *buf, size_t buflen); /*-- conversion.c --*/ +/* Make sure to to erase the memory (PTR,LEN). */ +void _gpgme_wipememory (void *ptr, size_t len); + /* Concatenate the string S1 with all the following strings up to a NULL. Returns a malloced buffer with the new string or NULL on a malloc error or if too many arguments are given. */ -- cgit v1.2.3