2 * Copyright (C) 2008 Tobias Brunner
3 * Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 #include <openssl/evp.h>
20 #include "openssl_plugin.h"
23 #include "openssl_crypter.h"
25 typedef struct private_openssl_plugin_t private_openssl_plugin_t
;
28 * private data of openssl_plugin
30 struct private_openssl_plugin_t
{
35 openssl_plugin_t
public;
39 * Implementation of openssl_plugin_t.destroy
41 static void destroy(private_openssl_plugin_t
*this)
43 lib
->crypto
->remove_crypter(lib
->crypto
,
44 (crypter_constructor_t
)openssl_crypter_create
);
54 plugin_t
*plugin_create()
56 private_openssl_plugin_t
*this = malloc_thing(private_openssl_plugin_t
);
58 this->public.plugin
.destroy
= (void(*)(plugin_t
*))destroy
;
60 OpenSSL_add_all_algorithms();
62 lib
->crypto
->add_crypter(lib
->crypto
, ENCR_DES
,
63 (crypter_constructor_t
)openssl_crypter_create
);
64 lib
->crypto
->add_crypter(lib
->crypto
, ENCR_3DES
,
65 (crypter_constructor_t
)openssl_crypter_create
);
66 lib
->crypto
->add_crypter(lib
->crypto
, ENCR_RC5
,
67 (crypter_constructor_t
)openssl_crypter_create
);
68 lib
->crypto
->add_crypter(lib
->crypto
, ENCR_IDEA
,
69 (crypter_constructor_t
)openssl_crypter_create
);
70 lib
->crypto
->add_crypter(lib
->crypto
, ENCR_CAST
,
71 (crypter_constructor_t
)openssl_crypter_create
);
72 lib
->crypto
->add_crypter(lib
->crypto
, ENCR_BLOWFISH
,
73 (crypter_constructor_t
)openssl_crypter_create
);
74 lib
->crypto
->add_crypter(lib
->crypto
, ENCR_NULL
,
75 (crypter_constructor_t
)openssl_crypter_create
);
76 lib
->crypto
->add_crypter(lib
->crypto
, ENCR_AES_CBC
,
77 (crypter_constructor_t
)openssl_crypter_create
);
79 return &this->public.plugin
;