From 557afe41020d808811375ef02e4c1b822da5515e Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 14 Jun 2002 20:15:04 +0000 Subject: Updated to use ctx->sign_protocol rather than ctx->protocol. 2002-06-14 Jeffrey Stedfast * camel-multipart-signed.c: Updated to use ctx->sign_protocol rather than ctx->protocol. * camel-cipher-context.h: Add an ecnryption protocol member. * camel-pgp-context.c (camel_pgp_context_init): Set the encryption protocol. svn path=/trunk/; revision=17186 --- camel/ChangeLog | 10 ++++++++++ camel/camel-cipher-context.h | 5 +++-- camel/camel-multipart-signed.c | 8 ++++---- camel/camel-pgp-context.c | 7 ++++--- camel/providers/local/camel-mbox-folder.c | 2 +- 5 files changed, 22 insertions(+), 10 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 928f87acca..05f518984c 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,13 @@ +2002-06-14 Jeffrey Stedfast + + * camel-multipart-signed.c: Updated to use ctx->sign_protocol + rather than ctx->protocol. + + * camel-cipher-context.h: Add an ecnryption protocol member. + + * camel-pgp-context.c (camel_pgp_context_init): Set the encryption + protocol. + 2002-06-11 Not Zed * camel-vtrash-folder.c (camel_vtrash_folder_class_init): Our diff --git a/camel/camel-cipher-context.h b/camel/camel-cipher-context.h index c3a6641967..452c093eef 100644 --- a/camel/camel-cipher-context.h +++ b/camel/camel-cipher-context.h @@ -51,11 +51,12 @@ typedef struct _CamelCipherContext { CamelObject parent_object; struct _CamelCipherContextPrivate *priv; - - const char *protocol; /* this MUST be set by implementors */ CamelSession *session; + /* these MUST be set by implementors */ + const char *sign_protocol; + const char *encrypt_protocol; } CamelCipherContext; typedef struct _CamelCipherContextClass { diff --git a/camel/camel-multipart-signed.c b/camel/camel-multipart-signed.c index 841abd0d13..cda9e6d429 100644 --- a/camel/camel-multipart-signed.c +++ b/camel/camel-multipart-signed.c @@ -580,7 +580,7 @@ camel_multipart_signed_sign(CamelMultipartSigned *mps, CamelCipherContext *conte char *type; /* this needs to be set */ - g_return_val_if_fail(context->protocol != NULL, -1); + g_return_val_if_fail(context->sign_protocol != NULL, -1); prepare_sign(content); @@ -613,8 +613,8 @@ camel_multipart_signed_sign(CamelMultipartSigned *mps, CamelCipherContext *conte /* create the signature wrapper object */ signature = camel_mime_part_new(); dw = camel_data_wrapper_new(); - type = alloca(strlen(context->protocol) + 32); - sprintf(type, "%s; name=signature.asc", context->protocol); + type = alloca(strlen(context->sign_protocol) + 32); + sprintf(type, "%s; name=signature.asc", context->sign_protocol); camel_data_wrapper_set_mime_type(dw, type); camel_stream_reset(sigstream); camel_data_wrapper_construct_from_stream(dw, sigstream); @@ -626,7 +626,7 @@ camel_multipart_signed_sign(CamelMultipartSigned *mps, CamelCipherContext *conte /* setup our mime type and boundary */ mime_type = header_content_type_new("multipart", "signed"); header_content_type_set_param(mime_type, "micalg", camel_cipher_hash_to_id(context, hash)); - header_content_type_set_param(mime_type, "protocol", context->protocol); + header_content_type_set_param(mime_type, "protocol", context->sign_protocol); camel_data_wrapper_set_mime_type_field(CAMEL_DATA_WRAPPER (mps), mime_type); header_content_type_unref(mime_type); camel_multipart_set_boundary((CamelMultipart *)mps, NULL); diff --git a/camel/camel-pgp-context.c b/camel/camel-pgp-context.c index 246b35d691..0b5916bca2 100644 --- a/camel/camel-pgp-context.c +++ b/camel/camel-pgp-context.c @@ -89,10 +89,11 @@ static void camel_pgp_context_init (CamelPgpContext *context) { CamelCipherContext *ciph = (CamelCipherContext *)context; - + context->priv = g_new0 (struct _CamelPgpContextPrivate, 1); - - ciph->protocol = "application/pgp-signature"; + + ciph->sign_protocol = "application/pgp-signature"; + ciph->encrypt_protocol = "application/pgp-encrypted"; } static void diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c index 0d4a61739d..c8065b5f33 100644 --- a/camel/providers/local/camel-mbox-folder.c +++ b/camel/providers/local/camel-mbox-folder.c @@ -336,7 +336,7 @@ retry: return NULL; } - /* no frompos, its an error in the library (and we can't do anything with it */ + /* no frompos, its an error in the library (and we can't do anything with it) */ g_assert(info->frompos != -1); /* we use an fd instead of a normal stream here - the reason is subtle, camel_mime_part will cache -- cgit v1.2.3