Make it build and test.

This commit is contained in:
Ben Laurie 2013-10-03 19:02:58 +01:00
parent a2eef41993
commit 7c81de9a91
6 changed files with 24 additions and 6 deletions

@ -13,7 +13,7 @@ AR= ar r
CFLAGS= $(INCLUDES) $(CFLAG) CFLAGS= $(INCLUDES) $(CFLAG)
GENERAL=Makefile GENERAL=Makefile
TEST=evp_test.c TEST=evp_test.c aeadtest.c
TESTDATA=evptests.txt TESTDATA=evptests.txt
APPS= APPS=

@ -84,7 +84,7 @@ enum
CT, /* hex encoded ciphertext (not including the authenticator, CT, /* hex encoded ciphertext (not including the authenticator,
which is next. */ which is next. */
TAG, /* hex encoded authenticator. */ TAG, /* hex encoded authenticator. */
NUM_TYPES, NUM_TYPES
}; };
static const char NAMES[6][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 int i, type_len = 0;
unsigned char *buf = NULL; unsigned char *buf = NULL;
unsigned int *buf_len; unsigned int *buf_len = NULL;
if (!fgets(line, sizeof(line), f)) if (!fgets(line, sizeof(line), f))
break; break;

@ -17,7 +17,7 @@ ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS) AFLAGS= $(ASFLAGS)
GENERAL=Makefile GENERAL=Makefile
TEST= TEST=poly1305test
APPS= APPS=
LIB=$(TOP)/libcrypto.a LIB=$(TOP)/libcrypto.a

@ -47,6 +47,10 @@
* ==================================================================== * ====================================================================
*/ */
#ifdef PEDANTIC
# include "poly1305.c"
#else
/* This implementation of poly1305 is by Andrew Moon /* This implementation of poly1305 is by Andrew Moon
* (https://github.com/floodyberry/poly1305-donna) and released as public * (https://github.com/floodyberry/poly1305-donna) and released as public
* domain. It implements SIMD vectorization based on the algorithm described in * domain. It implements SIMD vectorization based on the algorithm described in
@ -731,3 +735,5 @@ poly1305_donna_finish:
} }
#endif /* !OPENSSL_NO_POLY1305 */ #endif /* !OPENSSL_NO_POLY1305 */
#endif /* !PEDANTIC */

@ -345,7 +345,8 @@ test_poly1305: $(POLY1305TEST)$(EXE_EXT)
@echo "Test Poly1305" @echo "Test Poly1305"
../util/shlib_wrap.sh ./$(POLY1305TEST) ../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" @echo "Test ChaCha20+Poly1305"
../util/shlib_wrap.sh ./$(AEADTEST) chacha20-poly1305 \ ../util/shlib_wrap.sh ./$(AEADTEST) chacha20-poly1305 \
chacha20_poly1305_tests.txt chacha20_poly1305_tests.txt

@ -274,6 +274,7 @@ sub get_tests
my %tests; my %tests;
my %alltests; my %alltests;
my %fakes; my %fakes;
my $info = '';
while (my $line = <M>) while (my $line = <M>)
{ {
chomp $line; chomp $line;
@ -290,11 +291,18 @@ sub get_tests
$targets{$t} = ''; $targets{$t} = '';
$alltests{$t} = undef; $alltests{$t} = undef;
} }
$info .= '# targets = ' . join(' ', sort keys %targets) . "\n";
}
if ($line =~ /^(?<t>\S+):(?<d>.*)$/ && !exists $targets{$1})
{
$info .= "# no match: $line\n";
} }
if (($line =~ /^(?<t>\S+):(?<d>.*)$/ && exists $targets{$1}) if (($line =~ /^(?<t>\S+):(?<d>.*)$/ && exists $targets{$1})
|| $line =~ /^(?<t>test_(ss|gen) .*):(?<d>.*)/) || $line =~ /^(?<t>test_(ss|gen) .*):(?<d>.*)/)
{ {
$info .= "# match: $line\n";
my $t = $+{t}; my $t = $+{t};
my $d = $+{d}; my $d = $+{d};
# If there are multiple targets stupid FreeBSD make runs the # If there are multiple targets stupid FreeBSD make runs the
@ -399,6 +407,9 @@ sub get_tests
'testssl', 'testssl',
'testsslproxy', 'testsslproxy',
'serverinfo.pem', 'serverinfo.pem',
'chacha20_poly1305_tests.txt',
'aes_128_gcm_tests.txt',
'aes_256_gcm_tests.txt',
); );
my $copies = copy_scripts(1, 'test', @copies); my $copies = copy_scripts(1, 'test', @copies);
$copies .= copy_scripts(0, 'test', ('smcont.txt')); $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; 1;