check that all ciphers/hashes/prngs are unregistered
This commit is contained in:
parent
be9c598ee7
commit
904366eb0f
@ -98,6 +98,12 @@ sub check_descriptor {
|
|||||||
warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/;
|
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}:");
|
my $name = sprintf("%-17s", "check-${which}:");
|
||||||
warn( $fails > 0 ? "${name}FAIL $fails\n" : "${name}PASS\n" );
|
warn( $fails > 0 ? "${name}FAIL $fails\n" : "${name}PASS\n" );
|
||||||
return $fails;
|
return $fails;
|
||||||
|
15
tests/test.c
15
tests/test.c
@ -95,7 +95,17 @@ static void *run(void *arg)
|
|||||||
static void _unregister_all(void)
|
static void _unregister_all(void)
|
||||||
{
|
{
|
||||||
#ifdef LTC_RIJNDAEL
|
#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
|
#endif
|
||||||
#ifdef LTC_BLOWFISH
|
#ifdef LTC_BLOWFISH
|
||||||
unregister_cipher(&blowfish_desc);
|
unregister_cipher(&blowfish_desc);
|
||||||
@ -239,6 +249,9 @@ static void _unregister_all(void)
|
|||||||
#ifdef LTC_SOBER128
|
#ifdef LTC_SOBER128
|
||||||
unregister_prng(&sober128_desc);
|
unregister_prng(&sober128_desc);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef LTC_SPRNG
|
||||||
|
unregister_prng(&sprng_desc);
|
||||||
|
#endif
|
||||||
} /* _cleanup() */
|
} /* _cleanup() */
|
||||||
|
|
||||||
static void register_algs(void)
|
static void register_algs(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user