![]() |
|
Message-ID: <02af01cd5c8c$786145b0$6923d110$@net> Date: Sat, 7 Jul 2012 17:04:23 -0500 From: "jfoug" <jfoug@....net> To: <john-dev@...ts.openwall.com> Subject: RE: Build error for generic >From: Frank Dittrich [mailto:frank_dittrich@...mail.com] > >With just the common.h change applied, generic build works again. >gcc 4.6.3 just produces two new warnings: >sha2.c: In function 'sha256_final': >sha2.c:240:2: warning: suggest parentheses around comparison in operand >of '&' [-Wparentheses] >sha2.c: In function 'sha512_final': >sha2.c:564:2: warning: suggest parentheses around comparison in operand >of '&' [-Wparentheses] > >Line 240 is the same as line 564: > if (is_aligned(output,sizeof(ARCH_WORD_32))) { > >is_aligned is defined in line 26 of common.h: >#define is_aligned(PTR, CNT) (((ARCH_WORD)(const void *)(PTR))&(CNT->1)==0) The warning is right, and this is WRONG. >I am sure you must have meant >#define is_aligned(PTR, CNT) ((((ARCH_WORD)(const void *)(PTR))&(CNT-1))==0) This is the RIGHT define, my bad. >Needless to say, the resulting john binaries all passed --test=0 runs, >no matter which way I changed the #define. If it passed, it is ONLY because you are running on Intel, and alignment does not matter. If the broken version was run on a system requiring alignment, then I will 100% assure you, it would fail. >Here you had a typo: > >$ make generic > /dev/null >memory.c: In function 'alter_endianity_w': >memory.c:229:2: warning: implicit declaration of function 'isaligned' >[-Wimplicit-function-declaration] >memory.o: In function `alter_endianity_w': >memory.c:(.text+0x6aa): undefined reference to `isaligned' >collect2: ld returned 1 exit status >make[1]: *** [../run/john] Error 1 >make: *** [generic] Error 2 > >This should have been is_aligned instead of isaligned. > >After fixing this, john can be built and passes --test=0. Sorry for the poor patch. That is what I get for making the changes in the '!ALIGN-REQUIRED' code and not testing using a system that cannot handle out of alignment data. Jim.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.