crypto-factory: Remove obsolete transform testing functions
authorMartin Willi <martin@revosec.ch>
Mon, 13 Apr 2015 16:25:27 +0000 (18:25 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 15 Apr 2015 12:38:43 +0000 (14:38 +0200)
src/libstrongswan/crypto/crypto_factory.c
src/libstrongswan/crypto/crypto_factory.h

index 54ec958..b0b8637 100644 (file)
@@ -915,12 +915,6 @@ METHOD(crypto_factory_t, add_test_vector, void,
        }
 }
 
-METHOD(crypto_factory_t, get_test_vector_failures, u_int,
-       private_crypto_factory_t *this)
-{
-       return this->test_failures;
-}
-
 /**
  * Private enumerator for create_verify_enumerator()
  */
@@ -1092,7 +1086,6 @@ crypto_factory_t *crypto_factory_create()
                        .create_rng_enumerator = _create_rng_enumerator,
                        .create_nonce_gen_enumerator = _create_nonce_gen_enumerator,
                        .add_test_vector = _add_test_vector,
-                       .get_test_vector_failures = _get_test_vector_failures,
                        .create_verify_enumerator = _create_verify_enumerator,
                        .destroy = _destroy,
                },
@@ -1116,40 +1109,3 @@ crypto_factory_t *crypto_factory_create()
 
        return &this->public;
 }
-
-/**
- * Manually verify all registered algorithms against test vectors
- */
-static u_int verify_registered_algorithms(crypto_factory_t *factory)
-{
-       private_crypto_factory_t *this = (private_crypto_factory_t*)factory;
-       enumerator_t *enumerator;
-       entry_t *entry;
-       u_int failures = 0;
-
-#define TEST_ALGORITHMS(test, ...) do { \
-       enumerator = this->test##s->create_enumerator(this->test##s); \
-       while (enumerator->enumerate(enumerator, &entry)) \
-       { \
-               if (!this->tester->test_##test(this->tester, entry->algo, ##__VA_ARGS__, \
-                                                       entry->create_##test, NULL, entry->plugin_name)) \
-               { \
-                       failures++; \
-               } \
-       } \
-       enumerator->destroy(enumerator); \
-} while (0)
-
-       this->lock->read_lock(this->lock);
-       TEST_ALGORITHMS(crypter, 0);
-       TEST_ALGORITHMS(aead, 0, 0);
-       TEST_ALGORITHMS(signer);
-       TEST_ALGORITHMS(hasher);
-       TEST_ALGORITHMS(prf);
-       TEST_ALGORITHMS(rng);
-       TEST_ALGORITHMS(dh);
-       this->lock->unlock(this->lock);
-       return failures;
-}
-
-EXPORT_FUNCTION_FOR_TESTS(crypto, verify_registered_algorithms);
index b2af461..e039156 100644 (file)
@@ -372,16 +372,6 @@ struct crypto_factory_t {
                                                        void *vector);
 
        /**
-        * Get the number of test vector failures encountered during add.
-        *
-        * This counter gets incremented only if transforms get tested during
-        * registration.
-        *
-        * @return                              number of failed test vectors
-        */
-       u_int (*get_test_vector_failures)(crypto_factory_t *this);
-
-       /**
         * Create an enumerator verifying transforms using known test vectors.
         *
         * The resulting enumerator enumerates over an u_int with the type