Closed Bug 457539 Opened 11 years ago Closed 11 years ago

generated md5 message-ids are dodgy

Categories

(MailNews Core :: Backend, defect, minor)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.1b2

People

(Reporter: tuukka.tolvanen, Assigned: tuukka.tolvanen)

References

()

Details

Attachments

(2 files, 1 obsolete file)

http://mxr.mozilla.org/comm-central/source/mailnews/local/src/nsParseMailbox.cpp#1393 takes hashy-random signed chars as unsigned ints and prints those in hex to generate a message-id when missing, so instead of hh you get hh half of the time and FFFFFFhh the rest.

fgrep -r md5: ~/.thunderbird/*.default/ | sed -r 's/.*md5:([0-9A-F]*).*/\1/'
FFFFFF96FFFFFFB36555FFFFFFD9031123FFFFFFEA48
FFFFFFB5FFFFFF9525FFFFFFA33BFFFFFFE4FFFFFF84
FFFFFFA7FFFFFFB12CFFFFFFB54C303978FFFFFFF82C
5919206CFFFFFFBC0045FFFFFFE722FFFFFFCA78454B
...

you do get 5 random bytes at minimum regardless, and very few messages need a generated id, so this shouldn't be much of a practical issue; it just looked rather suspicious in gloda indexing spew...
Attached patch patch1 minimalSplinter Review
this would be the minimal fix
Assignee: nobody → tuukka.tolvanen
Status: NEW → ASSIGNED
Attached patch patch2 base64 (obsolete) — Splinter Review
...but I think I prefer just asking the hasher for the digest in base64; it's less code here. The output is then like <md5:WJxiZHD5646NgCdiR7DQPw==> (base64 is [A-Z][a-z][/+] with a bit of '=' sprinkled on top; I have all of those chars in my incoming mail message-ids).
Attachment #340801 - Flags: superreview?(bienvenu)
Attachment #340801 - Flags: review?(bienvenu)
...and let's not forget to keep the variable name in sync with that change
Attachment #340801 - Attachment is obsolete: true
Attachment #340802 - Flags: superreview?(bienvenu)
Attachment #340802 - Flags: review?(bienvenu)
Attachment #340801 - Flags: superreview?(bienvenu)
Attachment #340801 - Flags: review?(bienvenu)
Comment on attachment 340802 [details] [diff] [review]
patch3 s/md5_bin/md5_b64/

thx for the patch.
Attachment #340802 - Flags: superreview?(bienvenu)
Attachment #340802 - Flags: superreview+
Attachment #340802 - Flags: review?(bienvenu)
Attachment #340802 - Flags: review+
Keywords: checkin-needed
http://hg.mozilla.org/comm-central/rev/f9184e286915
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b2
You need to log in before you can comment on or make changes to this bug.