View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000413 | LDMud 3.3 | Compilation, Installation | public | 2005-11-11 08:46 | 2018-01-29 21:57 |
Reporter | ranger | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 3.3 | ||||
Fixed in Version | 3.3 | ||||
Summary | 0000413: md5() misbehavior on AMD x86 64 Bit Systems | ||||
Description | md5("hello") reports on our system: 7891e72e0c42461f87025d544bb2d4cb should correctly report: 5d41402abc4b2a76b9719d911017c592 I am not sure, if I compiled something wrong, but I don't think so. amy ideas? | ||||
Additional Information | bash:/> uname -a Linux www 2.6.13-gentoo-r5 0000001 Tue Nov 8 16:42:08 CET 2005 x86_64 AMD Sempron(tm) Processor 3000+ AuthenticAMD GNU/Linux bash:/> cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 44 model name : AMD Sempron(tm) Processor 3000+ stepping : 2 cpu MHz : 1799.861 cache size : 128 KB fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm bogomips : 3608.40 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp tm stc | ||||
Tags | No tags attached. | ||||
|
Sorry, I selected the wrong cathegory. It should be "efuns" of course. |
|
As far as I can see it should suffice to replace #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) in md5.c with #define ROTATE_LEFT(x, n) (((x) << (n)) | (((x) & 0xffffffffUL)) >> (32-(n)))) so no garbage bits like carries or leftovers from previous rotates are or-ed into the relevant bits of the result in this operation. BTW, I think that all md5 related constants in that code should have a UL suffix; that would allow it to compile and work correctly on systems with 16 bit ints. Is this relevant for ldmud? |
|
As Gawain@Regenbogen pointed out, there's a ) too much in my fix, it should be: #define ROTATE_LEFT(x, n) (((x) << (n)) | (((x) & 0xffffffffUL) >> (32-(n)))) Gawain also said that the code works fine with that change. |
|
The replacement fixes our issue perfectly. Thanks a lot! |
|
I implemented the patch - thanks! It will be in 3.3.712 and 3.2.12 |
Date Modified | Username | Field | Change |
---|---|---|---|
2005-11-11 08:46 | ranger | New Issue | |
2005-11-11 08:48 | ranger | Note Added: 0000400 | |
2005-11-11 13:13 | fufu | Note Added: 0000401 | |
2005-11-11 13:41 | fufu | Note Added: 0000402 | |
2005-11-16 09:01 | ranger | Note Added: 0000404 | |
2005-11-24 11:28 |
|
Status | new => resolved |
2005-11-24 11:28 |
|
Fixed in Version | => 3.3 |
2005-11-24 11:28 |
|
Resolution | open => fixed |
2005-11-24 11:28 |
|
Assigned To | => lars |
2005-11-24 11:28 |
|
Note Added: 0000411 | |
2006-02-28 20:04 |
|
Status | resolved => closed |
2010-11-16 09:42 |
|
Source_changeset_attached | => ldmud.git master 8da8f48a |
2010-11-16 09:42 |
|
Source_changeset_attached | => ldmud.git master-3.2 76db098a |
2018-01-29 18:59 |
|
Source_changeset_attached | => ldmud.git master 8da8f48a |
2018-01-29 18:59 |
|
Source_changeset_attached | => ldmud.git master-3.2 76db098a |
2018-01-29 21:57 |
|
Source_changeset_attached | => ldmud.git master 8da8f48a |
2018-01-29 21:57 |
|
Source_changeset_attached | => ldmud.git master-3.2 76db098a |