aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-multipart-signed.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-12-01 09:30:45 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-12-01 09:30:45 +0800
commitd98f355957a9d1186f4f6506fbf06d010434d648 (patch)
tree657595e71d87641aa7e5395a06fca1b319a8db96 /camel/camel-multipart-signed.c
parentbef182255624468737832990a344cd31a82dc9d9 (diff)
downloadgsoc2013-evolution-d98f355957a9d1186f4f6506fbf06d010434d648.tar.gz
gsoc2013-evolution-d98f355957a9d1186f4f6506fbf06d010434d648.tar.zst
gsoc2013-evolution-d98f355957a9d1186f4f6506fbf06d010434d648.zip
Added list-unsubscribe header match.
2003-11-28 Not Zed <NotZed@Ximian.com> * camel-mime-utils.c (mail_list_magic[]): Added list-unsubscribe header match. 2003-11-26 Not Zed <NotZed@Ximian.com> * camel-smime-context.c (sm_verify_cmsg): take a stream rather than a part for the content. (sm_verify): get the content directly as a stream. * camel-multipart-signed.c (camel_multipart_signed_get_content_stream): new api to get the content stream which will match the signed version. svn path=/trunk/; revision=23507
Diffstat (limited to 'camel/camel-multipart-signed.c')
-rw-r--r--camel/camel-multipart-signed.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/camel/camel-multipart-signed.c b/camel/camel-multipart-signed.c
index 47d749ab73..5dca448a7f 100644
--- a/camel/camel-multipart-signed.c
+++ b/camel/camel-multipart-signed.c
@@ -655,6 +655,39 @@ camel_multipart_signed_sign(CamelMultipartSigned *mps, CamelCipherContext *conte
return 0;
}
+CamelStream *
+camel_multipart_signed_get_content_stream(CamelMultipartSigned *mps, CamelException *ex)
+{
+ CamelStream *constream;
+
+ /* we need to be able to verify stuff we just signed as well as stuff we loaded from a stream/parser */
+
+ if (mps->contentraw) {
+ constream = mps->contentraw;
+ camel_object_ref((CamelObject *)constream);
+ } else {
+ CamelStream *sub;
+ CamelMimeFilter *canon_filter;
+
+ if (mps->start1 == -1 && parse_content(mps) == -1) {
+ camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("parse error"));
+ return NULL;
+ }
+
+ /* first, prepare our parts */
+ sub = camel_seekable_substream_new((CamelSeekableStream *)((CamelDataWrapper *)mps)->stream, mps->start1, mps->end1);
+ constream = (CamelStream *)camel_stream_filter_new_with_stream(sub);
+ camel_object_unref((CamelObject *)sub);
+
+ /* Note: see rfc2015 or rfc3156, section 5 */
+ canon_filter = camel_mime_filter_canon_new (CAMEL_MIME_FILTER_CANON_CRLF);
+ camel_stream_filter_add((CamelStreamFilter *)constream, (CamelMimeFilter *)canon_filter);
+ camel_object_unref((CamelObject *)canon_filter);
+ }
+
+ return constream;
+}
+
/**
* camel_multipart_signed_verify:
* @mps: