Closed Bug 457539 Opened 11 years ago Closed 11 years ago
generated md5 message-ids are dodgy
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...
this would be the minimal fix
Assignee: nobody → tuukka.tolvanen
Status: NEW → ASSIGNED
...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).
...and let's not forget to keep the variable name in sync with that change
Comment on attachment 340802 [details] [diff] [review] patch3 s/md5_bin/md5_b64/ thx for the patch.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b2
You need to log in before you can comment on or make changes to this bug.