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

View File

@ -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=

View File

@ -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;

View File

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

View File

@ -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 */

View File

@ -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

View File

@ -274,6 +274,7 @@ sub get_tests
my %tests;
my %alltests;
my %fakes;
my $info = '';
while (my $line = <M>)
{
chomp $line;
@ -290,11 +291,18 @@ sub get_tests
$targets{$t} = '';
$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})
|| $line =~ /^(?<t>test_(ss|gen) .*):(?<d>.*)/)
{
$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;