Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,24 @@ matrix:
packages:
- gcc-multilib
- libgmp-dev:i386
# clang with memory sanitizer
- compiler: clang
# --disable-openssl-tests because openssl uses uninitialized memory. ASM
# and BIGNUM are disabled because clang memory sanitizer does not work
# with inline assembly (https://clang.llvm.org/docs/MemorySanitizer.html).
# The memory sanitizer is instructed to exit with a different exit code
# using MSAN_OPTIONS. This is because the default exit code is 77 - the
# same exit code that autotools make check interprets as a test that is
# supposed to be skipped.
env: EXTRAFLAGS="--disable-openssl-tests CFLAGS=-fsanitize=memory" ASM=no BIGNUM=no EXPERIMENTAL=yes ENDOMORPHISM=yes RECOVERY=yes ECDH=yes MSAN_OPTIONS=exitcode=42

before_install: mkdir -p `dirname $GUAVA_JAR`
install: if [ ! -f $GUAVA_JAR ]; then wget $GUAVA_URL -O $GUAVA_JAR; fi
before_script: ./autogen.sh
script:
- if [ -n "$HOST" ]; then export USE_HOST="--host=$HOST"; fi
- if [ "x$HOST" = "xi686-linux-gnu" ]; then export CC="$CC -m32"; fi
- ./configure --enable-experimental=$EXPERIMENTAL --enable-endomorphism=$ENDOMORPHISM --with-field=$FIELD --with-bignum=$BIGNUM --with-scalar=$SCALAR --enable-ecmult-static-precomputation=$STATICPRECOMPUTATION --with-ecmult-gen-precision=$ECMULTGENPRECISION --enable-module-ecdh=$ECDH --enable-module-recovery=$RECOVERY --enable-jni=$JNI $EXTRAFLAGS $USE_HOST && make -j2 $BUILD
after_script:
- cat ./tests.log
- cat ./exhaustive_tests.log
10 changes: 10 additions & 0 deletions src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -5167,8 +5167,16 @@ void run_ecdsa_openssl(void) {
#endif

int main(int argc, char **argv) {
unsigned char dummy1[16];
unsigned char dummy2[16];
unsigned char seed16[16] = {0};
unsigned char run32[32] = {0};

/* Disable buffering for stdout to improve reliability of getting
* diagnostic information. Happens right at the start of main because
* setbuf must be used before any other operation on the stream. */
setbuf(stdout, NULL);

/* find iteration count */
if (argc > 1) {
count = strtol(argv[1], NULL, 0);
Expand Down Expand Up @@ -5211,6 +5219,8 @@ int main(int argc, char **argv) {
printf("test count = %i\n", count);
printf("random seed = %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n", seed16[0], seed16[1], seed16[2], seed16[3], seed16[4], seed16[5], seed16[6], seed16[7], seed16[8], seed16[9], seed16[10], seed16[11], seed16[12], seed16[13], seed16[14], seed16[15]);

CHECK(memcmp(dummy1, dummy2, sizeof(dummy2)) == 0);

/* initialize */
run_context_tests(0);
run_context_tests(1);
Expand Down