Re: [GMime] Stream Checksum



On 3/22/17, 5:09 PM, "Albrecht Dreß" <albrecht dress arcor de> wrote:

    Hi Jeff:
    
    Am 22.03.17 20:39 schrieb(en) Jeffrey Stedfast:
    > Hah, I actually just converted it to use GChecksum internally a few days ago…
    
    I recall that you had your own md5 implementation in 2.6, didn't you?


Yea, for 2 reasons:

1. It was kind of a remnant from earlier versions from before GChecksum existed
2. GChecksum didn’t have g_checksum_reset() originally

Now, though, GChecksum has all the features I need (maybe it had them for 2.6 as well but it didn’t occur to 
me to refactor GMimeFilterMd5 at the time).

    
    > I didn’t make it generic though, it’s still MD5-only because that was its only use-case (for 
calculating/verifying the Content-Md5 header value).
    > 
    > I could make it generic, though, if you are using it for other things?
    
    As with some of my other ideas (like parser error tracking), this is basically for message analysis (spam 
etc.), not for Balsa.
    
    Write a message part (suspicious attachment) to a stream so it can be fed into other tools, and during 
this process create a sha256 hash which can be checked against a (spam, malware, ...) data base.  
Unfortunately, md5 or sha1 is not sufficient any more there days, see the stunning demonstration at 
<https://alf.nu/SHA1> producing two completely different pdf's with *the same* sha1 hash (similar tools are 
around for md5 since some time).


Yep, I saw that a few weeks ago when it was published. I think Content-Md5 headers are basically obsolete at 
this point (I never seem them in use anymore).

It’s just a feature I’ve been supporting for ages…


Anyway… I’ll look into replacing GMimeFilterMd5 with a general purpose Checksum filter (it makes sense to do 
anyway).

Jeff




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