From 824967d8435771efc1d792b05a95483d7082755e Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 22 Oct 2001 17:44:50 +0000 Subject: Add a hack: if the multipart/signed part has a "x-inline-pgp-hack" * camel-pgp-mime.c (camel_pgp_mime_part_verify): Add a hack: if the multipart/signed part has a "x-inline-pgp-hack" parameter in its Content-Type, don't pass the MIME headers as part of the data to be verified. svn path=/trunk/; revision=13881 --- camel/ChangeLog | 7 +++++++ camel/camel-pgp-mime.c | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index fdbdd06eba..4c0381e549 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2001-10-22 Dan Winship + + * camel-pgp-mime.c (camel_pgp_mime_part_verify): Add a hack: if + the multipart/signed part has a "x-inline-pgp-hack" parameter in + its Content-Type, don't pass the MIME headers as part of the data + to be verified. + 2001-10-22 Rodrigo Moya * Makefile.am: added $GNOME_INCLUDEDIR to INCLUDES, needed for latest diff --git a/camel/camel-pgp-mime.c b/camel/camel-pgp-mime.c index fb17256528..37b7cb1b58 100644 --- a/camel/camel-pgp-mime.c +++ b/camel/camel-pgp-mime.c @@ -351,6 +351,7 @@ camel_pgp_mime_part_verify (CamelPgpContext *context, CamelMimePart *mime_part, CamelMimeFilter *crlf_filter, *from_filter; CamelStream *stream, *sigstream; CamelCipherValidity *valid; + CamelContentType *type; g_return_val_if_fail (mime_part != NULL, NULL); g_return_val_if_fail (CAMEL_IS_MIME_PART (mime_part), NULL); @@ -372,7 +373,13 @@ camel_pgp_mime_part_verify (CamelPgpContext *context, CamelMimePart *mime_part, camel_object_unref (CAMEL_OBJECT (crlf_filter)); camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (from_filter)); camel_object_unref (CAMEL_OBJECT (from_filter)); - camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (part), CAMEL_STREAM (filtered_stream)); + + type = camel_mime_part_get_content_type (mime_part); + if (header_content_type_param (type, "x-inline-pgp-hack")) + wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); + else + wrapper = CAMEL_DATA_WRAPPER (part); + camel_data_wrapper_write_to_stream (wrapper, CAMEL_STREAM (filtered_stream)); camel_object_unref (CAMEL_OBJECT (filtered_stream)); camel_stream_reset (stream); -- cgit v1.2.3