Running `make test` with Clang sanitizers results in some issues with
crypto/cast/c_enc.c. The sanitizers used were `-fsanitize=undefined
-fsanitize=address`.

I believe the shift issue flagged below are undefined behavior.

<---snip--->
../util/shlib_wrap.sh ./casttest
c_enc.c:79:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:114:2: runtime error: shift exponent 32 is too large for
32-bit type 'unsigned int'
ecb cast5 ok
This test will take some time....c_enc.c:75:2: runtime error: shift
exponent 32 is too large for 32-bit type 'unsigned int'
c_enc.c:71:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:86:6: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:73:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:80:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:87:6: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:81:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:72:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:76:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:78:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:85:6: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:74:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:88:6: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:77:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:82:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
123456789ABCDEF ok
<---snip--->

And:

<---snip--->
cast
c_enc.c:88:6: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:106:6: runtime error: shift exponent 32 is too large for
32-bit type 'unsigned int'
cast base64
c_enc.c:75:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:118:2: runtime error: shift exponent 32 is too large for
32-bit type 'unsigned int'
cast-cbc
cast-cbc base64
cast5-cbc
cast5-cbc base64
c_enc.c:82:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:111:2: runtime error: shift exponent 32 is too large for
32-bit type 'unsigned int'
cast5-cfb
cast5-cfb base64
c_enc.c:81:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:81:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
cast5-ecb
c_enc.c:80:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:113:2: runtime error: shift exponent 32 is too large for
32-bit type 'unsigned int'
cast5-ecb base64
cast5-ofb
c_enc.c:80:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
c_enc.c:80:2: runtime error: shift exponent 32 is too large for 32-bit
type 'unsigned int'
cast5-ofb base64
<---snip--->

*****
$ /usr/local/bin/clang -v
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-apple-darwin12.5.0
Thread model: posix

$ apps/openssl version -a
WARNING: can't open config file: /usr/local/ssl/openssl.cnf
OpenSSL 1.1.0-dev xx XXX xxxx
built on: Wed Jul  2 20:05:35 EDT 2014
platform: darwin64-x86_64-cc
options:  bn(64,64) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
compiler: /usr/local/bin/clang -DOPENSSL_THREADS -D_REENTRANT
-DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -arch x86_64 -O3
-DL_ENDIAN -Wall -fsanitize=undefined -fsanitize=address
-DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5
-DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM
-DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
OPENSSLDIR: "/usr/local/ssl"

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to