disable crypto algorithm if no key size is supported

This commit is contained in:
Andreas Steffen
2010-12-25 16:11:50 +01:00
parent c6a043fad0
commit d733a3babb
+19
View File
@@ -192,6 +192,7 @@ METHOD(crypto_tester_t, test_crypter, bool,
DBG1(DBG_LIB, "%N[%s]: %u bit key size not supported", DBG1(DBG_LIB, "%N[%s]: %u bit key size not supported",
encryption_algorithm_names, alg, plugin_name, encryption_algorithm_names, alg, plugin_name,
BITS_PER_BYTE * vector->key_size); BITS_PER_BYTE * vector->key_size);
failed = TRUE;
continue; continue;
} }
@@ -241,12 +242,21 @@ METHOD(crypto_tester_t, test_crypter, bool,
} }
enumerator->destroy(enumerator); enumerator->destroy(enumerator);
if (!tested) if (!tested)
{
if (failed)
{
DBG1(DBG_LIB,"disable %N[%s]: no key size supported",
encryption_algorithm_names, alg, plugin_name);
return FALSE;
}
else
{ {
DBG1(DBG_LIB, "%s %N[%s]: no test vectors found", DBG1(DBG_LIB, "%s %N[%s]: no test vectors found",
this->required ? "disabled" : "enabled ", this->required ? "disabled" : "enabled ",
encryption_algorithm_names, alg, plugin_name); encryption_algorithm_names, alg, plugin_name);
return !this->required; return !this->required;
} }
}
if (!failed) if (!failed)
{ {
if (speed) if (speed)
@@ -401,12 +411,21 @@ METHOD(crypto_tester_t, test_aead, bool,
} }
enumerator->destroy(enumerator); enumerator->destroy(enumerator);
if (!tested) if (!tested)
{
if (failed)
{
DBG1(DBG_LIB,"disable %N[%s]: no key size supported",
encryption_algorithm_names, alg, plugin_name);
return FALSE;
}
else
{ {
DBG1(DBG_LIB, "%s %N[%s]: no test vectors found", DBG1(DBG_LIB, "%s %N[%s]: no test vectors found",
this->required ? "disabled" : "enabled ", this->required ? "disabled" : "enabled ",
encryption_algorithm_names, alg, plugin_name); encryption_algorithm_names, alg, plugin_name);
return !this->required; return !this->required;
} }
}
if (!failed) if (!failed)
{ {
if (speed) if (speed)