diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-01-21 16:37:57 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-01-21 16:37:57 +0800 |
commit | e7e8b3d6102abf8d5b78c8715d654e41991ca437 (patch) | |
tree | 175699b5db724925aca036317c6a3e1f37e7a1ab /mail/mail-crypto.c | |
parent | a15d2d0dc6f57dd4f12b90b8165d4dc8dd8bebcc (diff) | |
download | gsoc2013-evolution-e7e8b3d6102abf8d5b78c8715d654e41991ca437.tar.gz gsoc2013-evolution-e7e8b3d6102abf8d5b78c8715d654e41991ca437.tar.zst gsoc2013-evolution-e7e8b3d6102abf8d5b78c8715d654e41991ca437.zip |
Updated header comment and fixed some ref/unref count problems in the
2001-01-21 Jeffrey Stedfast <fejj@ximian.com>
* mail-crypto.c: Updated header comment and fixed some ref/unref
count problems in the various functions. Also fixed some other
little things.
(pgp_mime_part_encrypt): Do some canonical CRLF action before
encrypting.
(pgp_mime_part_sign): Make sure we are the owners of the byte array.
(pgp_mime_part_verify): Same.
(pgp_mime_part_encrypt): Same.
(pgp_mime_part_decrypt): Same.
svn path=/trunk/; revision=7682
Diffstat (limited to 'mail/mail-crypto.c')
-rw-r--r-- | mail/mail-crypto.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/mail/mail-crypto.c b/mail/mail-crypto.c index c529691af7..2ddd5ab6d1 100644 --- a/mail/mail-crypto.c +++ b/mail/mail-crypto.c @@ -177,7 +177,8 @@ pgp_mime_part_sign (CamelMimePart **mime_part, const gchar *userid, PgpHashType /* get the cleartext */ array = g_byte_array_new (); - stream = camel_stream_mem_new_with_byte_array (array); + stream = camel_stream_mem_new (); + camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (stream), array); crlf_filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY); from_filter = CAMEL_MIME_FILTER (camel_mime_filter_from_new ()); @@ -205,7 +206,6 @@ pgp_mime_part_sign (CamelMimePart **mime_part, const gchar *userid, PgpHashType camel_mime_part_set_content (signed_part, signature, strlen (signature), "application/pgp-signature"); g_free (signature); - camel_mime_part_set_encoding (signed_part, CAMEL_MIME_PART_ENCODING_DEFAULT); /* construct the container multipart/signed */ multipart = camel_multipart_new (); @@ -234,7 +234,6 @@ pgp_mime_part_sign (CamelMimePart **mime_part, const gchar *userid, PgpHashType camel_object_unref (CAMEL_OBJECT (signed_part)); /* replace the input part with the output part */ - camel_object_unref (CAMEL_OBJECT (*mime_part)); *mime_part = camel_mime_part_new (); camel_medium_set_content_object (CAMEL_MEDIUM (*mime_part), CAMEL_DATA_WRAPPER (multipart)); @@ -277,7 +276,8 @@ pgp_mime_part_verify (CamelMimePart *mime_part, CamelException *ex) /* get the plain part */ part = camel_multipart_get_part (multipart, 0); content = g_byte_array_new (); - stream = camel_stream_mem_new_with_byte_array (content); + stream = camel_stream_mem_new (); + camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (stream), content); crlf_filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY); filtered_stream = camel_stream_filter_new_with_stream (stream); @@ -334,7 +334,8 @@ pgp_mime_part_encrypt (CamelMimePart **mime_part, const GPtrArray *recipients, C /* get the contents */ contents = g_byte_array_new (); - stream = camel_stream_mem_new_with_byte_array (contents); + stream = camel_stream_mem_new (); + camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (stream), contents); crlf_filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY); filtered_stream = camel_stream_filter_new_with_stream (stream); @@ -424,7 +425,8 @@ pgp_mime_part_decrypt (CamelMimePart *mime_part, CamelException *ex) /* get the ciphertext */ content = g_byte_array_new (); - stream = camel_stream_mem_new_with_byte_array (content); + stream = camel_stream_mem_new (); + camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (stream), content); camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (encrypted_part), stream); camel_object_unref (CAMEL_OBJECT (stream)); ciphertext = content->data; |