From 7c81de9a91e9270b9c9b8631127f9f73aa649c3c Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Thu, 3 Oct 2013 19:02:58 +0100 Subject: [PATCH] Make it build and test. --- crypto/evp/Makefile | 2 +- crypto/evp/aeadtest.c | 4 ++-- crypto/poly1305/Makefile | 2 +- crypto/poly1305/poly1305_vec.c | 6 ++++++ test/Makefile | 3 ++- util/pl/unix.pl | 13 ++++++++++++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/crypto/evp/Makefile b/crypto/evp/Makefile index 0aaaf9a38e..00c7b2f17d 100644 --- a/crypto/evp/Makefile +++ b/crypto/evp/Makefile @@ -13,7 +13,7 @@ AR= ar r CFLAGS= $(INCLUDES) $(CFLAG) GENERAL=Makefile -TEST=evp_test.c +TEST=evp_test.c aeadtest.c TESTDATA=evptests.txt APPS= diff --git a/crypto/evp/aeadtest.c b/crypto/evp/aeadtest.c index b099ca55e9..e1d83bedb4 100644 --- a/crypto/evp/aeadtest.c +++ b/crypto/evp/aeadtest.c @@ -84,7 +84,7 @@ enum CT, /* hex encoded ciphertext (not including the authenticator, which is next. */ TAG, /* hex encoded authenticator. */ - NUM_TYPES, + NUM_TYPES }; static const char NAMES[6][NUM_TYPES] = @@ -257,7 +257,7 @@ int main(int argc, char **argv) unsigned int i, type_len = 0; unsigned char *buf = NULL; - unsigned int *buf_len; + unsigned int *buf_len = NULL; if (!fgets(line, sizeof(line), f)) break; diff --git a/crypto/poly1305/Makefile b/crypto/poly1305/Makefile index 397d7cd35d..6fdb1c3a17 100644 --- a/crypto/poly1305/Makefile +++ b/crypto/poly1305/Makefile @@ -17,7 +17,7 @@ ASFLAGS= $(INCLUDES) $(ASFLAG) AFLAGS= $(ASFLAGS) GENERAL=Makefile -TEST= +TEST=poly1305test APPS= LIB=$(TOP)/libcrypto.a diff --git a/crypto/poly1305/poly1305_vec.c b/crypto/poly1305/poly1305_vec.c index c546200b94..19b69ea6ee 100644 --- a/crypto/poly1305/poly1305_vec.c +++ b/crypto/poly1305/poly1305_vec.c @@ -47,6 +47,10 @@ * ==================================================================== */ +#ifdef PEDANTIC +# include "poly1305.c" +#else + /* This implementation of poly1305 is by Andrew Moon * (https://github.com/floodyberry/poly1305-donna) and released as public * domain. It implements SIMD vectorization based on the algorithm described in @@ -731,3 +735,5 @@ poly1305_donna_finish: } #endif /* !OPENSSL_NO_POLY1305 */ + +#endif /* !PEDANTIC */ diff --git a/test/Makefile b/test/Makefile index 40aada3023..8c902dcd29 100644 --- a/test/Makefile +++ b/test/Makefile @@ -345,7 +345,8 @@ test_poly1305: $(POLY1305TEST)$(EXE_EXT) @echo "Test Poly1305" ../util/shlib_wrap.sh ./$(POLY1305TEST) -test_aead: $(AEADTEST)$(EXE_EXT) +test_aead: $(AEADTEST)$(EXE_EXT) chacha20_poly1305_tests.txt \ + aes_128_gcm_tests.txt aes_256_gcm_tests.txt @echo "Test ChaCha20+Poly1305" ../util/shlib_wrap.sh ./$(AEADTEST) chacha20-poly1305 \ chacha20_poly1305_tests.txt diff --git a/util/pl/unix.pl b/util/pl/unix.pl index 39bdc6c75e..98da2c89a5 100644 --- a/util/pl/unix.pl +++ b/util/pl/unix.pl @@ -274,6 +274,7 @@ sub get_tests my %tests; my %alltests; my %fakes; + my $info = ''; while (my $line = ) { chomp $line; @@ -290,11 +291,18 @@ sub get_tests $targets{$t} = ''; $alltests{$t} = undef; } + $info .= '# targets = ' . join(' ', sort keys %targets) . "\n"; + } + + if ($line =~ /^(?\S+):(?.*)$/ && !exists $targets{$1}) + { + $info .= "# no match: $line\n"; } if (($line =~ /^(?\S+):(?.*)$/ && exists $targets{$1}) || $line =~ /^(?test_(ss|gen) .*):(?.*)/) { + $info .= "# match: $line\n"; my $t = $+{t}; my $d = $+{d}; # If there are multiple targets stupid FreeBSD make runs the @@ -399,6 +407,9 @@ sub get_tests 'testssl', 'testsslproxy', 'serverinfo.pem', + 'chacha20_poly1305_tests.txt', + 'aes_128_gcm_tests.txt', + 'aes_256_gcm_tests.txt', ); my $copies = copy_scripts(1, 'test', @copies); $copies .= copy_scripts(0, 'test', ('smcont.txt')); @@ -433,7 +444,7 @@ sub get_tests } } - return "$scripts\n$copies\n$tests\n$all\n\n$each"; + return "$info\n$scripts\n$copies\n$tests\n$all\n\n$each"; } 1; -- 2.40.0