enabling support for hardware accelerators in OpenSSL
authorTobias Brunner <tobias@strongswan.org>
Wed, 25 Jun 2008 12:39:32 +0000 (12:39 -0000)
committerTobias Brunner <tobias@strongswan.org>
Wed, 25 Jun 2008 12:39:32 +0000 (12:39 -0000)
src/libstrongswan/plugins/openssl/openssl_plugin.c

index eaedcc4..a45e46a 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <openssl/evp.h>
+#include <openssl/engine.h>
 
 #include "openssl_plugin.h"
 
@@ -64,6 +65,7 @@ static void destroy(private_openssl_plugin_t *this)
        lib->creds->remove_builder(lib->creds,
                                        (builder_constructor_t)openssl_ec_public_key_builder);
        
+       ENGINE_cleanup();
        EVP_cleanup();
        
        free(this);
@@ -80,6 +82,10 @@ plugin_t *plugin_create()
        
        OpenSSL_add_all_algorithms();
        
+       /* activate support for hardware accelerators */
+       ENGINE_load_builtin_engines();
+       ENGINE_register_all_complete();
+       
        /* crypter */
        lib->crypto->add_crypter(lib->crypto, ENCR_DES,
                                        (crypter_constructor_t)openssl_crypter_create);