Re: [Evolution-hackers] Preliminary patches to add inline PGP support



camel patch comments:

-gpg_verify (CamelCipherContext *context, CamelMimePart *ipart,
CamelException *ex)
+gpg_doverify (CamelCipherContext *context, CamelStream *istream, CamelMimePart *sigpart, CamelException *ex)

maybe just "verify"? I'm not a big fan of doverify

+	// XXX: Hash only seems to be used for signing... 
+	//gpg_ctx_set_hash (gpg, camel_cipher_id_to_hash(context, camel_content_type_param(ct, "micalg")));

don't use c++ style commenting... bad. anyway, the above code doesn't
hurt (it doesn't do anything with the data, but maybe someday it could)
doesn't really matter, could probably just be removed.

+	if (sigfile) {
+		gpg_ctx_set_sigfile (gpg, sigfile);
+	}

if it's just 1 statement under the if (and no comment), don't bother
with the {}'s

+		}
+
+	} else if (camel_content_type_is(ct, "application", "x-inline-pgp")) {

I'd prefer the extra blank line not be there. same with a few other
places in the code (and after the return statement you did the same
thing)

the code looks fine tho... the only thing I'd question is the faking of
a MIME part to do the verification of non-MIME pgp stuff. I'm undecided
about that :\


plugin comments:

you do a lot of unnecessary casting. for example:

+	inptr = (char *)data->data;
+	inend = inptr+(int)data->len;

neither of those is needed.

nor is this:

+				g_byte_array_append(out,(guint8*)"-", 1);


Jeff

On Sun, 2005-04-03 at 03:20 +1200, Matt Brown wrote:
> Hi, 
> 
> I've been working on some patches for this bounty (Bug #127521) for the
> past couple of weeks. 
> 
> Given the high level of interest I've received in these patches and the
> number of people emailing me, I am pleased to report that I have some
> preliminary patches that I think are working well enough to make them
> available for testing. 
> 
> 1) Modify the gpg_verify routine in camel-gpg-context.c to support
> verifying application/inline-pgp mime parts. Clearsigned verifications
> are different to PGP/Mime verifications so we can't just make a fake
> multipart/signed unfortunately.
> http://www.mattb.net.nz/evolution/eds-camel-inline-pgp.patch
> 
> 2) This patch is the actual plugin that hooks the formatting handlers to
> detect and process inline pgp messages. 
> http://www.mattb.net.nz/evolution/evo-plugin-inline-pgp.patch
> 
> I have to stress that both these patches are BETA and have passed only
> the most preliminary testing so far, and there are a few known issues.
> 
> Known Issues
> 1) The first 10 characters of the decrypted text are truncated when
> processing an encrypted block. I'm really stumped on this one!
> 2) Encrypted binary data (JPGs etc) will probably be displayed as
> text/plain atm
> 
> Many thanks to Tommi Komulainen who contributed the code for
> constructing a multipart/encrypted mime part.
> 
> 
> Please test these patches and report back what works / what doesn't also
> if you have weird and wacky examples of inline pgp messages (whether
> valid or invalid) please email them to me at pgptest mattb net nz,
> please include in the subject a short description of what the message is
> (ie. "encrypted jpeg" or "invalid inline signature") 
> 
> Looking forward to your feedback :)
> 
> Regards
> 
-- 
Jeffrey Stedfast
Evolution Hacker - Novell, Inc.
fejj ximian com  - www.novell.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]