aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream-mem.h
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-07-13 12:05:10 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-07-13 12:05:10 +0800
commit0a3341dda86ee8068183aec18289e8a70afea709 (patch)
treea11521a6cfe1b4960307123582b929c1a0516da7 /camel/camel-stream-mem.h
parentae2cc62f2c4e1a4476e77afa853d3c1563c8234f (diff)
downloadgsoc2013-evolution-0a3341dda86ee8068183aec18289e8a70afea709.tar.gz
gsoc2013-evolution-0a3341dda86ee8068183aec18289e8a70afea709.tar.zst
gsoc2013-evolution-0a3341dda86ee8068183aec18289e8a70afea709.zip
** This is no guarantee of security, but its just a helper to prevent old
2004-07-09 Not Zed <NotZed@Ximian.com> ** This is no guarantee of security, but its just a helper to prevent old memory accidentally being included/used elsewhere. * camel-smime-context.c (sm_decrypt): mark the output stream 'secure'. * camel-gpg-context.c (gpg_decrypt): set the output stream to secured, so we automagically blank it out on finalise. * camel-stream-mem.c (camel_stream_mem_set_secure): set the memory-stream 'secured', all we do at the moment is blank out the buffer on finalise. (camel_stream_mem_set_byte_array, camel_stream_mem_finalize): clear memory if owner and secured. kill dead comment. (clear_mem): utilitiy to set memory to 0xABADF00D 2004-07-08 Not Zed <NotZed@Ximian.com> ** See bug #61186. * camel-cipher-context.c (camel_cipher_sign): (camel_cipher_verify, camel_cipher_encrypt, camel_cipher_decrypt): Add preliminary progress reporting. svn path=/trunk/; revision=26629
Diffstat (limited to 'camel/camel-stream-mem.h')
-rw-r--r--camel/camel-stream-mem.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/camel/camel-stream-mem.h b/camel/camel-stream-mem.h
index af51c36ff7..ba01e950ad 100644
--- a/camel/camel-stream-mem.h
+++ b/camel/camel-stream-mem.h
@@ -45,7 +45,8 @@ typedef struct _CamelStreamMemClass CamelStreamMemClass;
struct _CamelStreamMem {
CamelSeekableStream parent_object;
- gboolean owner; /* do we own the buffer? */
+ unsigned int owner:1; /* do we own the buffer? */
+ unsigned int secure:1; /* do we clear the buffer on finalise (if we own it) */
GByteArray *buffer;
};
@@ -63,6 +64,9 @@ CamelStream *camel_stream_mem_new(void);
CamelStream *camel_stream_mem_new_with_byte_array(GByteArray *buffer);
CamelStream *camel_stream_mem_new_with_buffer(const char *buffer, size_t len);
+/* 'secure' data, currently just clears memory on finalise */
+void camel_stream_mem_set_secure(CamelStreamMem *);
+
/* these are really only here for implementing classes */
void camel_stream_mem_set_byte_array(CamelStreamMem *, GByteArray *buffer);
void camel_stream_mem_set_buffer(CamelStreamMem *, const char *buffer, size_t len);