From 904366eb0f3dcbfe78b9f36dae0783e669e3478a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 12:46:41 +0200 Subject: [PATCH] check that all ciphers/hashes/prngs are unregistered --- helper.pl | 6 ++++++ tests/test.c | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/helper.pl b/helper.pl index 6a90cfe..0a6eb51 100755 --- a/helper.pl +++ b/helper.pl @@ -98,6 +98,12 @@ sub check_descriptor { warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/; } } + for my $d (@descriptors) { + for my $f ("./tests/test.c") { + my $txt = read_file($f); + warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/; + } + } my $name = sprintf("%-17s", "check-${which}:"); warn( $fails > 0 ? "${name}FAIL $fails\n" : "${name}PASS\n" ); return $fails; diff --git a/tests/test.c b/tests/test.c index 3fac1af..76aab18 100644 --- a/tests/test.c +++ b/tests/test.c @@ -95,7 +95,17 @@ static void *run(void *arg) static void _unregister_all(void) { #ifdef LTC_RIJNDAEL - unregister_cipher(&aes_desc); +#ifdef ENCRYPT_ONLY + /* alternative would be + * unregister_cipher(&rijndael_enc_desc); + */ + unregister_cipher(&aes_enc_desc); +#else + /* alternative would be + * unregister_cipher(&rijndael_desc); + */ + unregister_cipher(&aes_desc); +#endif #endif #ifdef LTC_BLOWFISH unregister_cipher(&blowfish_desc); @@ -239,6 +249,9 @@ static void _unregister_all(void) #ifdef LTC_SOBER128 unregister_prng(&sober128_desc); #endif +#ifdef LTC_SPRNG + unregister_prng(&sprng_desc); +#endif } /* _cleanup() */ static void register_algs(void)