Definitely for my case it is a sha256 calculation problem.
I started to compare debug output from x86 (which works ok) and this VLIW stuff 
and found the following:

libclamav/dsig.c cli_versig2() fails on "if(!(salt = memchr(data, 0x01, 
BLK_LEN)))" for VLIW
and difference in ctx contents (compared to x86) appeared after 
"sha256_final(&ctx, digest3);" above that check.
This difference actually appeared after sha256_update (sc, &lengthPad, 8L);"" 
in sha256_final() libclamav/sha256.c.
So the sha256_update() called several times before that one w/o any ctx 
difference. Strange.
RUNTIME_ENDIAN and WORDS_BIGENDIAN def/undef are the same for x86 and VLIW.

Also I tried to manually compile sha256.c with -DSHA256_TEST for LVIW and pass 
the same data which generate this error, but the calculation was correct. 
Strange again.

Unfortunately now I have no much time and dedicated VLIW host to continue 
debugging.
I changed libclamav to use openssl sha256/sha1/md5 calculation instead of 
built-in and it works ok for x86. Will try for VLIW.
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/support/ml

Reply via email to