24 #include <openssl/opensslv.h>
28 #include <tdeconfig.h>
29 #include <kstaticdeleter.h>
36 #define STRINGIFY(x) #x
38 #define GET_CRYPTOLIB_SYMBOL(a) ((_cryptoLib->hasSymbol(a)) ? _cryptoLib->symbol(a) : NULL)
39 #define GET_SSLLIB_SYMBOL(a) ((_sslLib->hasSymbol(a)) ? _sslLib->symbol(a) : NULL)
42 #if !defined(OPENSSL_INIT_ADD_ALL_CIPHERS)
43 # define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
44 # define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
45 # define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
50 static int (*K_SSL_connect) (SSL *) = 0L;
51 static int (*K_SSL_accept) (SSL *) = 0L;
52 static int (*K_SSL_read) (SSL *,
void *, int) = 0L;
53 static int (*K_SSL_write) (SSL *,
const void *, int) = 0L;
54 static SSL *(*K_SSL_new) (SSL_CTX *) = 0L;
55 static void (*K_SSL_free) (SSL *) = 0L;
56 static int (*K_SSL_shutdown) (SSL *) = 0L;
57 static SSL_CTX *(*K_SSL_CTX_new)(SSL_METHOD *) = 0L;
58 static void (*K_SSL_CTX_free) (SSL_CTX *) = 0L;
59 static int (*K_SSL_set_fd) (SSL *, int) = 0L;
60 static int (*K_SSL_pending) (SSL *) = 0L;
61 static int (*K_SSL_peek) (SSL *,
void *, int) = 0L;
62 static int (*K_SSL_CTX_set_cipher_list)(SSL_CTX *,
const char *) = 0L;
63 static void (*K_SSL_CTX_set_verify)(SSL_CTX *, int,
64 int (*)(int, X509_STORE_CTX *)) = 0L;
65 static int (*K_SSL_use_certificate)(SSL *, X509 *) = 0L;
66 static SSL_CIPHER *(*K_SSL_get_current_cipher)(SSL *) = 0L;
67 static long (*K_SSL_set_options)(SSL *ssl,
long options) = 0L;
68 static int (*K_SSL_session_reused)(SSL *ssl) = 0L;
69 static long (*K_SSL_ctrl) (SSL *,int, long,
void *) = 0L;
70 static int (*K_RAND_egd) (
const char *) = 0L;
71 static const char* (*K_RAND_file_name) (
char *, size_t) = 0L;
72 static int (*K_RAND_load_file) (
const char *, long) = 0L;
73 static int (*K_RAND_write_file) (
const char *) = 0L;
74 static SSL_METHOD * (*K_TLSv1_client_method) () = 0L;
75 static SSL_METHOD * (*K_SSLv2_client_method) () = 0L;
76 static SSL_METHOD * (*K_SSLv3_client_method) () = 0L;
77 static SSL_METHOD * (*K_TLS_client_method) () = 0L;
78 static X509 * (*K_SSL_get_peer_certificate) (SSL *) = 0L;
79 static int (*K_SSL_CIPHER_get_bits) (SSL_CIPHER *,
int *) = 0L;
80 static char * (*K_SSL_CIPHER_get_version) (SSL_CIPHER *) = 0L;
81 static const char * (*K_SSL_CIPHER_get_name) (SSL_CIPHER *) = 0L;
82 static char * (*K_SSL_CIPHER_description) (SSL_CIPHER *,
char *, int) = 0L;
83 static X509 * (*K_d2i_X509) (X509 **,
unsigned char **,long) = 0L;
84 static X509_CRL * (*K_d2i_X509_CRL) (X509_CRL **,
unsigned char **,long) = 0L;
85 static int (*K_i2d_X509) (X509 *,
unsigned char **) = 0L;
86 static int (*K_X509_cmp) (X509 *, X509 *) = 0L;
87 static int (*K_X509_subject_name_cmp) (
const X509 *,
const X509 *) = 0L;
88 static void (*K_X509_STORE_CTX_free) (X509_STORE_CTX *) = 0L;
89 static int (*K_X509_verify_cert) (X509_STORE_CTX *) = 0L;
90 static X509_STORE_CTX *(*K_X509_STORE_CTX_new) (void) = 0L;
91 static void (*K_X509_STORE_free) (X509_STORE *) = 0L;
92 static X509_STORE *(*K_X509_STORE_new) (void) = 0L;
93 static void (*K_X509_free) (X509 *) = 0L;
94 static void (*K_X509_CRL_free) (X509_CRL *) = 0L;
95 static char *(*K_X509_NAME_oneline) (X509_NAME *,
char *,int) = 0L;
96 static X509_NAME *(*K_X509_get_subject_name) (X509 *) = 0L;
97 static X509_NAME *(*K_X509_get_issuer_name) (X509 *) = 0L;
98 static X509_LOOKUP *(*K_X509_STORE_add_lookup) (X509_STORE *, X509_LOOKUP_METHOD *) = 0L;
99 static X509_LOOKUP_METHOD *(*K_X509_LOOKUP_file)(void) = 0L;
100 static void (*K_X509_LOOKUP_free)(X509_LOOKUP *) = 0L;
101 static int (*K_X509_LOOKUP_ctrl)(X509_LOOKUP *, int,
const char *, long,
char **) = 0L;
102 static void (*K_X509_STORE_CTX_init)(X509_STORE_CTX *, X509_STORE *, X509 *, STACK_OF(X509) *) = 0L;
103 static void (*K_CRYPTO_free) (
void *) = 0L;
104 static X509* (*K_X509_dup) (X509 *) = 0L;
105 static void (*K_X509_get0_signature)(
const ASN1_BIT_STRING **psig,
106 const X509_ALGOR **palg,
const X509 *x) = 0L;
107 static BIO_METHOD *(*K_BIO_s_mem) (void) = 0L;
108 static BIO* (*K_BIO_new) (BIO_METHOD *) = 0L;
109 static BIO* (*K_BIO_new_fp) (FILE *, int) = 0L;
110 static BIO* (*K_BIO_new_mem_buf) (
void *, int) = 0L;
111 static int (*K_BIO_free) (BIO *) = 0L;
112 static long (*K_BIO_ctrl) (BIO *,int,long,
void *) = 0L;
113 static int (*K_BIO_write) (BIO *b,
const void *data,
int len) = 0L;
114 static void* (*K_BIO_get_data) (BIO *a) = 0L;
115 static int (*K_PEM_ASN1_write_bio) (int (*)(),
const char *,BIO *,
char *,
116 const EVP_CIPHER *,
unsigned char *,
int ,
117 pem_password_cb *,
void *) = 0L;
118 static int (*K_ASN1_item_i2d_fp)(ASN1_ITEM *,FILE *,
unsigned char *) = 0L;
119 static ASN1_ITEM *K_NETSCAPE_X509_it = 0L;
120 static int (*K_X509_print_fp) (FILE *, X509*) = 0L;
121 static int (*K_i2d_PKCS12) (PKCS12*,
unsigned char**) = 0L;
122 static int (*K_i2d_PKCS12_fp) (FILE *, PKCS12*) = 0L;
123 static int (*K_PKCS12_newpass) (PKCS12*,
char*,
char*) = 0L;
124 static PKCS12* (*K_d2i_PKCS12_fp) (FILE*, PKCS12**) = 0L;
125 static PKCS12* (*K_PKCS12_new) (void) = 0L;
126 static void (*K_PKCS12_free) (PKCS12 *) = 0L;
127 static int (*K_PKCS12_parse) (PKCS12*,
const char *, EVP_PKEY**,
128 X509**, STACK_OF(X509)**) = 0L;
129 static void (*K_EVP_PKEY_free) (EVP_PKEY *) = 0L;
130 static EVP_PKEY* (*K_EVP_PKEY_new) () = 0L;
131 static int (*K_EVP_PKEY_base_id)(
const EVP_PKEY *pkey) = 0L;
132 static RSA* (*K_EVP_PKEY_get0_RSA)(EVP_PKEY *pkey) = 0L;
133 static DSA* (*K_EVP_PKEY_get0_DSA)(EVP_PKEY *pkey) = 0L;
134 static void (*K_X509_REQ_free) (X509_REQ *) = 0L;
135 static X509_REQ* (*K_X509_REQ_new) () = 0L;
136 static int (*K_SSL_CTX_use_PrivateKey) (SSL_CTX*, EVP_PKEY*) = 0L;
137 static int (*K_SSL_CTX_use_certificate) (SSL_CTX*, X509*) = 0L;
138 static int (*K_SSL_get_error) (SSL*, int) = 0L;
139 static STACK_OF(X509)* (*K_SSL_get_peer_cert_chain) (SSL*) = 0L;
140 static void (*K_X509_STORE_CTX_set0_untrusted) (X509_STORE_CTX *, STACK_OF(X509)*) = 0L;
141 static void (*K_X509_STORE_CTX_set_purpose) (X509_STORE_CTX *, int) = 0L;
142 static void (*K_sk_free) (STACK*) = 0L;
143 static int (*K_sk_num) (STACK*) = 0L;
144 static char* (*K_sk_pop) (STACK*) = 0L;
145 static char* (*K_sk_value) (STACK*, int) = 0L;
146 static STACK* (*K_sk_new) (int (*)()) = 0L;
147 static int (*K_sk_push) (STACK*,
char*) = 0L;
148 static STACK* (*K_sk_dup) (
const STACK *) = 0L;
149 static char * (*K_i2s_ASN1_INTEGER) (X509V3_EXT_METHOD *, ASN1_INTEGER *) =0L;
150 static ASN1_INTEGER * (*K_X509_get_serialNumber) (X509 *) = 0L;
151 static EVP_PKEY *(*K_X509_get_pubkey)(X509 *) = 0L;
152 static int (*K_i2d_PublicKey)(EVP_PKEY *,
unsigned char **) = 0L;
153 static int (*K_X509_check_private_key)(X509 *, EVP_PKEY *) = 0L;
154 static char * (*K_BN_bn2hex)(
const BIGNUM *) = 0L;
155 static int (*K_X509_digest)(
const X509 *,
const EVP_MD *,
unsigned char *,
unsigned int *) = 0L;
156 static EVP_MD* (*K_EVP_md5)() = 0L;
157 static void (*K_ASN1_INTEGER_free)(ASN1_INTEGER *) = 0L;
158 static int (*K_OBJ_obj2nid)(ASN1_OBJECT *) = 0L;
159 static const char * (*K_OBJ_nid2ln)(int) = 0L;
160 static int (*K_X509_get_ext_count)(X509*) = 0L;
161 static int (*K_X509_get_ext_by_NID)(X509*, int, int) = 0L;
162 static int (*K_X509_get_ext_by_OBJ)(X509*,ASN1_OBJECT*,int) = 0L;
163 static X509_EXTENSION *(*K_X509_get_ext)(X509*,
int loc) = 0L;
164 static X509_EXTENSION *(*K_X509_delete_ext)(X509*, int) = 0L;
165 static int (*K_X509_add_ext)(X509*, X509_EXTENSION*, int) = 0L;
166 static void *(*K_X509_get_ext_d2i)(X509*, int,
int*,
int*) = 0L;
167 static char *(*K_i2s_ASN1_OCTET_STRING)(X509V3_EXT_METHOD*, ASN1_OCTET_STRING*) = 0L;
168 static int (*K_ASN1_BIT_STRING_get_bit)(ASN1_BIT_STRING*, int) = 0L;
169 static PKCS7 *(*K_PKCS7_new)() = 0L;
170 static void (*K_PKCS7_free)(PKCS7*) = 0L;
171 static void (*K_PKCS7_content_free)(PKCS7*) = 0L;
172 static int (*K_i2d_PKCS7)(PKCS7*,
unsigned char**) = 0L;
173 static PKCS7 *(*K_d2i_PKCS7)(PKCS7**,
unsigned char**,long) = 0L;
174 static int (*K_i2d_PKCS7_fp)(FILE*,PKCS7*) = 0L;
175 static PKCS7* (*K_d2i_PKCS7_fp)(FILE*,PKCS7**) = 0L;
176 static int (*K_i2d_PKCS7_bio)(BIO *bp,PKCS7 *p7) = 0L;
177 static PKCS7 *(*K_d2i_PKCS7_bio)(BIO *bp,PKCS7 **p7) = 0L;
178 static PKCS7* (*K_PKCS7_dup)(PKCS7*) = 0L;
179 static STACK_OF(X509_NAME) *(*K_SSL_load_client_CA_file)(
const char*) = 0L;
180 static STACK_OF(X509_INFO) *(*K_PEM_X509_INFO_read)(FILE*, STACK_OF(X509_INFO)*, pem_password_cb*,
void*) = 0L;
181 static char *(*K_ASN1_d2i_fp)(
char *(*)(),
char *(*)(),FILE*,
unsigned char**) = 0L;
182 static X509 *(*K_X509_new)() = 0L;
183 static int (*K_X509_PURPOSE_get_count)() = 0L;
184 static int (*K_X509_PURPOSE_get_id)(X509_PURPOSE *) = 0L;
185 static int (*K_X509_check_purpose)(X509*,int,int) = 0L;
186 static X509_PURPOSE* (*K_X509_PURPOSE_get0)(int) = 0L;
187 static int (*K_EVP_PKEY_assign)(EVP_PKEY*, int,
char*) = 0L;
188 static int (*K_X509_REQ_set_pubkey)(X509_REQ*, EVP_PKEY*) = 0L;
189 static void (*K_RSA_get0_key)(
const RSA *r,
const BIGNUM **n,
const BIGNUM **e,
const BIGNUM **d) = 0L;
190 static RSA *(*K_RSA_generate_key)(int,
unsigned long, void (*)(int,int,
void *),
void *) = 0L;
191 static void (*K_DSA_get0_pqg)(
const DSA *d,
const BIGNUM **p,
const BIGNUM **q,
const BIGNUM **g) = 0L;
192 static void (*K_DSA_get0_key)(
const DSA *d,
const BIGNUM **pub_key,
const BIGNUM **priv_key) = 0L;
193 static int (*K_i2d_X509_REQ_fp)(FILE*, X509_REQ*) = 0L;
194 static void (*K_ERR_clear_error)() = 0L;
195 static unsigned long (*K_ERR_get_error)() = 0L;
196 static void (*K_ERR_print_errors_fp)(FILE*) = 0L;
197 static PKCS7 *(*K_PKCS7_sign)(X509*, EVP_PKEY*, STACK_OF(X509)*, BIO*, int) = 0L;
198 static int (*K_PKCS7_verify)(PKCS7*,STACK_OF(X509)*,X509_STORE*,BIO*,BIO*,int) = 0L;
199 static STACK_OF(X509) *(*K_PKCS7_get0_signers)(PKCS7 *, STACK_OF(X509) *, int) = 0L;
200 static PKCS7 *(*K_PKCS7_encrypt)(STACK_OF(X509) *, BIO *, EVP_CIPHER *, int) = 0L;
201 static int (*K_PKCS7_decrypt)(PKCS7 *, EVP_PKEY *, X509 *, BIO *, int) = 0L;
202 static SSL_SESSION* (*K_SSL_get1_session)(SSL*) = 0L;
203 static void (*K_SSL_SESSION_free)(SSL_SESSION*) = 0L;
204 static int (*K_SSL_set_session)(SSL*,SSL_SESSION*) = 0L;
205 static SSL_SESSION* (*K_d2i_SSL_SESSION)(SSL_SESSION**,
unsigned char**, long) = 0L;
206 static int (*K_i2d_SSL_SESSION)(SSL_SESSION*,
unsigned char**) = 0L;
207 static STACK *(*K_X509_get1_email)(X509 *x) = 0L;
208 static void (*K_X509_email_free)(STACK *sk) = 0L;
209 static EVP_CIPHER *(*K_EVP_des_ede3_cbc)() = 0L;
210 static EVP_CIPHER *(*K_EVP_des_cbc)() = 0L;
211 static EVP_CIPHER *(*K_EVP_rc2_cbc)() = 0L;
212 static EVP_CIPHER *(*K_EVP_rc2_64_cbc)() = 0L;
213 static EVP_CIPHER *(*K_EVP_rc2_40_cbc)() = 0L;
214 static int (*K_i2d_PrivateKey_fp)(FILE*,EVP_PKEY*) = 0L;
215 static int (*K_i2d_PKCS8PrivateKey_fp)(FILE*, EVP_PKEY*,
const EVP_CIPHER*,
char*, int, pem_password_cb*,
void*) = 0L;
216 static void (*K_RSA_free)(RSA*) = 0L;
217 static EVP_CIPHER *(*K_EVP_bf_cbc)() = 0L;
218 static int (*K_X509_REQ_sign)(X509_REQ*, EVP_PKEY*,
const EVP_MD*) = 0L;
219 static int (*K_X509_NAME_add_entry_by_txt)(X509_NAME*,
char*, int,
unsigned char*, int, int, int) = 0L;
220 static X509_NAME *(*K_X509_NAME_new)() = 0L;
221 static int (*K_X509_REQ_set_subject_name)(X509_REQ*,X509_NAME*) = 0L;
222 static unsigned char *(*K_ASN1_STRING_data)(ASN1_STRING*) = 0L;
223 static const unsigned char *(*K_ASN1_STRING_get0_data)(
const ASN1_STRING*) = 0L;
224 static int (*K_ASN1_STRING_length)(
const ASN1_STRING*) = 0L;
225 static ASN1_OCTET_STRING *(*K_ASN1_OCTET_STRING_new)() = 0L;
226 static void (*K_ASN1_OCTET_STRING_free)(ASN1_OCTET_STRING *) = 0L;
227 static int (*K_ASN1_OCTET_STRING_set)(ASN1_OCTET_STRING *,
const unsigned char *, int) = 0L;
228 static STACK_OF(SSL_CIPHER) *(*K_SSL_get_ciphers)(
const SSL *ssl) = 0L;
229 static const ASN1_TIME* (*K_X509_CRL_get0_lastUpdate)(
const X509_CRL *crl) = 0L;
230 static const ASN1_TIME* (*K_X509_CRL_get0_nextUpdate)(
const X509_CRL *crl) = 0L;
231 static X509* (*K_X509_STORE_CTX_get_current_cert)(X509_STORE_CTX *ctx) = 0L;
232 static int (*K_X509_STORE_CTX_get_error)(X509_STORE_CTX *ctx) = 0L;
233 static int (*K_X509_STORE_CTX_get_error_depth)(X509_STORE_CTX *ctx) = 0L;
234 static void (*K_X509_STORE_CTX_set_error)(X509_STORE_CTX *ctx,
int s) = 0L;
235 static void (*K_X509_STORE_set_verify_cb)(X509_STORE *ctx,
236 X509_STORE_CTX_verify_cb verify_cb) = 0L;
237 static STACK_OF(X509_OBJECT)* (*K_X509_STORE_get0_objects)(X509_STORE *v) = 0L;
238 static X509_LOOKUP_TYPE (*K_X509_OBJECT_get_type)(
const X509_OBJECT *a) = 0L;
239 static X509* (*K_X509_OBJECT_get0_X509)(
const X509_OBJECT *a) = 0L;
240 static ASN1_TIME* (*K_X509_getm_notAfter)(
const X509 *x) = 0L;
241 static ASN1_TIME* (*K_X509_getm_notBefore)(
const X509 *x) = 0L;
247 return _sslLib != 0L;
252 return _cryptoLib != 0L;
263 #include <tqstring.h>
264 #include <tqstringlist.h>
266 static TQString findMostRecentLib(TQString dir, TQString name)
269 TQString filter =
"lib"+name+
".so.*";
270 TQDir d(dir, filter);
273 TQStringList l = d.entryList();
280 uint s = filter.length()-1;
281 for (TQStringList::Iterator it = l.begin(); it != l.end(); ++it) {
282 TQString numberpart = (*it).mid(s);
283 uint endmaj = numberpart.find(
'.');
287 int maj = numberpart.left(endmaj).toInt(&ok);
290 int min = numberpart.mid(endmaj+1).toInt(&ok);
293 if (maj > bestmaj || (maj == bestmaj && min > bestmin)) {
307 KOpenSSLProxy::KOpenSSLProxy() {
308 KLibLoader *ll = KLibLoader::self();
310 TQStringList libpaths, libnamesc, libnamess;
316 cfg =
new TDEConfig(
"cryptodefaults",
false,
false);
317 cfg->setGroup(
"OpenSSL");
318 TQString upath = cfg->readPathEntry(
"Path");
319 if (!upath.isEmpty())
326 TQString libname = findMostRecentLib(
"/usr/" SYSTEM_LIBDIR,
"crypto");
327 if (!libname.isNull())
328 _cryptoLib = ll->globalLibrary(libname.latin1());
330 #elif defined(__CYGWIN__)
331 libpaths <<
"/usr/bin/"
333 <<
"/usr/local/openssl/bin"
334 <<
"/opt/openssl/bin"
335 <<
"/opt/trinity/bin"
338 libnamess <<
"cygssl-0.9.7.dll"
343 libnamesc <<
"cygcrypto.dll"
350 libpaths <<
"/" SYSTEM_LIBDIR KDELIBSUFF
"/"
351 <<
"/usr/" SYSTEM_LIBDIR KDELIBSUFF
"/"
357 <<
"/opt/freeware/lib/"
359 <<
"/usr/" SYSTEM_LIBDIR
"/"
360 <<
"/usr/ssl/" SYSTEM_LIBDIR
"/"
361 <<
"/usr/local/" SYSTEM_LIBDIR
"/"
362 <<
"/usr/local/openssl/" SYSTEM_LIBDIR
"/"
363 <<
"/usr/local/ssl/" SYSTEM_LIBDIR
"/"
364 <<
"/opt/openssl/" SYSTEM_LIBDIR
"/"
365 <<
"/" SYSTEM_LIBDIR
"/"
372 <<
"libssl.a(libssl.so.0)"
373 #elif defined(__APPLE__)
375 <<
"libssl.0.9.dylib"
377 #ifdef OPENSSL_SHLIB_VERSION
378 <<
"libssl.so." STRINGIFY(OPENSSL_SHLIB_VERSION)
380 #ifdef SHLIB_VERSION_NUMBER
381 <<
"libssl.so." SHLIB_VERSION_NUMBER
392 <<
"libcrypto.a(libcrypto.so.0)"
393 #elif defined(__APPLE__)
395 <<
"libcrypto.0.9.dylib"
397 #ifdef OPENSSL_SHLIB_VERSION
398 <<
"libcrypto.so." STRINGIFY(OPENSSL_SHLIB_VERSION)
400 #ifdef SHLIB_VERSION_NUMBER
401 <<
"libcrypto.so." SHLIB_VERSION_NUMBER
411 for (TQStringList::Iterator it = libpaths.begin();
412 it != libpaths.end();
414 for (TQStringList::Iterator shit = libnamesc.begin();
415 shit != libnamesc.end();
418 if (!alib.isEmpty() && !alib.endsWith(
"/"))
421 TQString tmpStr(alib.latin1());
422 tmpStr.replace(TQRegExp(
"\\(.*\\)"),
"");
423 if (!access(tmpStr.latin1(), R_OK))
424 _cryptoLib = ll->globalLibrary(alib.latin1());
425 if (_cryptoLib)
break;
427 if (_cryptoLib)
break;
432 K_X509_free = (void (*) (X509 *)) GET_CRYPTOLIB_SYMBOL(
"X509_free");
433 K_X509_CRL_free = (void (*) (X509_CRL *)) GET_CRYPTOLIB_SYMBOL(
"X509_CRL_free");
434 K_RAND_egd = (int (*)(
const char *)) GET_CRYPTOLIB_SYMBOL(
"RAND_egd");
435 K_RAND_load_file = (int (*)(
const char *, long)) GET_CRYPTOLIB_SYMBOL(
"RAND_load_file");
436 K_RAND_file_name = (
const char* (*)(
char *,
size_t)) GET_CRYPTOLIB_SYMBOL(
"RAND_file_name");
437 K_RAND_write_file = (int (*)(
const char *)) GET_CRYPTOLIB_SYMBOL(
"RAND_write_file");
438 K_CRYPTO_free = (void (*) (
void *)) GET_CRYPTOLIB_SYMBOL(
"CRYPTO_free");
439 K_d2i_X509 = (X509 * (*)(X509 **,
unsigned char **,
long)) GET_CRYPTOLIB_SYMBOL(
"d2i_X509");
440 K_d2i_X509_CRL = (X509_CRL * (*)(X509_CRL **,
unsigned char **,
long)) GET_CRYPTOLIB_SYMBOL(
"d2i_X509_CRL");
441 K_i2d_X509 = (int (*)(X509 *,
unsigned char **)) GET_CRYPTOLIB_SYMBOL(
"i2d_X509");
442 K_X509_cmp = (int (*)(X509 *, X509 *)) GET_CRYPTOLIB_SYMBOL(
"X509_cmp");
443 K_X509_subject_name_cmp = (int (*)(
const X509 *,
const X509 *)) GET_CRYPTOLIB_SYMBOL(
"X509_subject_name_cmp");
444 K_X509_STORE_CTX_new = (X509_STORE_CTX * (*) (
void)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_CTX_new");
445 K_X509_STORE_CTX_free = (void (*) (X509_STORE_CTX *)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_CTX_free");
446 K_X509_verify_cert = (int (*) (X509_STORE_CTX *)) GET_CRYPTOLIB_SYMBOL(
"X509_verify_cert");
447 K_X509_STORE_new = (X509_STORE * (*) (
void)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_new");
448 K_X509_STORE_free = (void (*) (X509_STORE *)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_free");
449 K_X509_NAME_oneline = (
char * (*) (X509_NAME *,
char *,
int)) GET_CRYPTOLIB_SYMBOL(
"X509_NAME_oneline");
450 K_X509_get_subject_name = (X509_NAME * (*) (X509 *)) GET_CRYPTOLIB_SYMBOL(
"X509_get_subject_name");
451 K_X509_get_issuer_name = (X509_NAME * (*) (X509 *)) GET_CRYPTOLIB_SYMBOL(
"X509_get_issuer_name");
452 K_X509_STORE_add_lookup = (X509_LOOKUP *(*) (X509_STORE *, X509_LOOKUP_METHOD *)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_add_lookup");
453 K_X509_LOOKUP_file = (X509_LOOKUP_METHOD *(*)(
void)) GET_CRYPTOLIB_SYMBOL(
"X509_LOOKUP_file");
454 K_X509_LOOKUP_free = (void (*)(X509_LOOKUP *)) GET_CRYPTOLIB_SYMBOL(
"X509_LOOKUP_free");
455 K_X509_LOOKUP_ctrl = (int (*)(X509_LOOKUP *, int,
const char *, long,
char **)) GET_CRYPTOLIB_SYMBOL(
"X509_LOOKUP_ctrl");
456 K_X509_STORE_CTX_init = (void (*)(X509_STORE_CTX *, X509_STORE *, X509 *, STACK_OF(X509) *)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_CTX_init");
457 K_X509_dup = (X509* (*)(X509*)) GET_CRYPTOLIB_SYMBOL(
"X509_dup");
458 K_X509_get0_signature = (void (*)(
const ASN1_BIT_STRING **psig,
459 const X509_ALGOR **palg,
const X509 *x)) GET_CRYPTOLIB_SYMBOL(
"X509_get0_signature");
460 K_BIO_s_mem = (BIO_METHOD *(*) (
void)) GET_CRYPTOLIB_SYMBOL(
"BIO_s_mem");
461 K_BIO_new = (BIO* (*)(BIO_METHOD *)) GET_CRYPTOLIB_SYMBOL(
"BIO_new");
462 K_BIO_new_fp = (BIO* (*)(FILE*,
int)) GET_CRYPTOLIB_SYMBOL(
"BIO_new_fp");
463 K_BIO_new_mem_buf = (BIO* (*)(
void *,
int)) GET_CRYPTOLIB_SYMBOL(
"BIO_new_mem_buf");
464 K_BIO_free = (int (*)(BIO*)) GET_CRYPTOLIB_SYMBOL(
"BIO_free");
465 K_BIO_ctrl = (long (*) (BIO *,int,long,
void *)) GET_CRYPTOLIB_SYMBOL(
"BIO_ctrl");
466 K_BIO_write = (int (*) (BIO *b,
const void *data,
int len)) GET_CRYPTOLIB_SYMBOL(
"BIO_write");
467 K_BIO_get_data = (
void* (*)(BIO *a)) GET_CRYPTOLIB_SYMBOL(
"BIO_get_data");
468 K_PEM_ASN1_write_bio = (int (*)(int (*)(),
const char *,BIO*,
char*,
const EVP_CIPHER *,
unsigned char *,
int, pem_password_cb *,
void *)) GET_CRYPTOLIB_SYMBOL(
"PEM_ASN1_write_bio");
469 K_ASN1_item_i2d_fp = (int (*)(ASN1_ITEM *, FILE*,
unsigned char *)) GET_CRYPTOLIB_SYMBOL(
"ASN1_item_i2d_fp");
470 K_NETSCAPE_X509_it = (ASN1_ITEM *) GET_CRYPTOLIB_SYMBOL(
"NETSCAPE_X509_it");
471 K_X509_print_fp = (int (*)(FILE*, X509*)) GET_CRYPTOLIB_SYMBOL(
"X509_print_fp");
472 K_i2d_PKCS12 = (int (*)(PKCS12*,
unsigned char**)) GET_CRYPTOLIB_SYMBOL(
"i2d_PKCS12");
473 K_i2d_PKCS12_fp = (int (*)(FILE *, PKCS12*)) GET_CRYPTOLIB_SYMBOL(
"i2d_PKCS12_fp");
474 K_PKCS12_newpass = (int (*)(PKCS12*,
char*,
char*)) GET_CRYPTOLIB_SYMBOL(
"PKCS12_newpass");
475 K_d2i_PKCS12_fp = (PKCS12* (*)(FILE*, PKCS12**)) GET_CRYPTOLIB_SYMBOL(
"d2i_PKCS12_fp");
476 K_PKCS12_new = (PKCS12* (*)()) GET_CRYPTOLIB_SYMBOL(
"PKCS12_new");
477 K_PKCS12_free = (void (*)(PKCS12 *)) GET_CRYPTOLIB_SYMBOL(
"PKCS12_free");
478 K_PKCS12_parse = (int (*)(PKCS12*,
const char *, EVP_PKEY**,
479 X509**, STACK_OF(X509)**)) GET_CRYPTOLIB_SYMBOL(
"PKCS12_parse");
480 K_EVP_PKEY_free = (void (*) (EVP_PKEY *)) GET_CRYPTOLIB_SYMBOL(
"EVP_PKEY_free");
481 K_EVP_PKEY_new = (EVP_PKEY* (*)()) GET_CRYPTOLIB_SYMBOL(
"EVP_PKEY_new");
482 K_EVP_PKEY_base_id = (int (*)(
const EVP_PKEY *pkey)) GET_CRYPTOLIB_SYMBOL(
"EVP_PKEY_base_id");
483 K_EVP_PKEY_get0_RSA = (RSA* (*)(EVP_PKEY *pkey)) GET_CRYPTOLIB_SYMBOL(
"EVP_PKEY_get0_RSA");
484 K_EVP_PKEY_get0_DSA = (DSA* (*)(EVP_PKEY *pkey)) GET_CRYPTOLIB_SYMBOL(
"EVP_PKEY_get0_DSA");
485 K_X509_REQ_free = (void (*)(X509_REQ*)) GET_CRYPTOLIB_SYMBOL(
"X509_REQ_free");
486 K_X509_REQ_new = (X509_REQ* (*)()) GET_CRYPTOLIB_SYMBOL(
"X509_REQ_new");
487 K_X509_STORE_CTX_set0_untrusted = (void (*)(X509_STORE_CTX *, STACK_OF(X509)*)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_CTX_set0_untrusted");
488 if (!K_X509_STORE_CTX_set0_untrusted) K_X509_STORE_CTX_set0_untrusted = (void (*)(X509_STORE_CTX *, STACK_OF(X509)*)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_CTX_set_chain");
489 K_X509_STORE_CTX_set_purpose = (void (*)(X509_STORE_CTX *, int)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_CTX_set_purpose");
490 K_sk_free = (void (*) (STACK *)) GET_CRYPTOLIB_SYMBOL(
"OPENSSL_sk_free");
491 if (!K_sk_free) K_sk_free = (void (*) (STACK *)) GET_CRYPTOLIB_SYMBOL(
"sk_free");
492 K_sk_num = (int (*) (STACK *)) GET_CRYPTOLIB_SYMBOL(
"OPENSSL_sk_num");
493 if (!K_sk_num) K_sk_num = (int (*) (STACK *)) GET_CRYPTOLIB_SYMBOL(
"sk_num");
494 K_sk_pop = (
char* (*) (STACK *)) GET_CRYPTOLIB_SYMBOL(
"OPENSSL_sk_pop");
495 if (!K_sk_pop) K_sk_pop = (
char* (*) (STACK *)) GET_CRYPTOLIB_SYMBOL(
"sk_pop");
496 K_sk_value = (
char* (*) (STACK *,
int)) GET_CRYPTOLIB_SYMBOL(
"OPENSSL_sk_value");
497 if (!K_sk_value) K_sk_value = (
char* (*) (STACK *,
int)) GET_CRYPTOLIB_SYMBOL(
"sk_value");
498 K_sk_new = (STACK* (*) (
int (*)())) GET_CRYPTOLIB_SYMBOL(
"OPENSSL_sk_new");
499 if (!K_sk_new) K_sk_new = (STACK* (*) (
int (*)())) GET_CRYPTOLIB_SYMBOL(
"sk_new");
500 K_sk_push = (int (*) (STACK*,
char*)) GET_CRYPTOLIB_SYMBOL(
"OPENSSL_sk_push");
501 if (!K_sk_push) K_sk_push = (int (*) (STACK*,
char*)) GET_CRYPTOLIB_SYMBOL(
"sk_push");
502 K_sk_dup = (STACK* (*) (
const STACK *)) GET_CRYPTOLIB_SYMBOL(
"OPENSSL_sk_dup");
503 if (!K_sk_dup) K_sk_dup = (STACK* (*) (
const STACK *)) GET_CRYPTOLIB_SYMBOL(
"sk_dup");
504 K_i2s_ASN1_INTEGER = (
char *(*) (X509V3_EXT_METHOD *, ASN1_INTEGER *)) GET_CRYPTOLIB_SYMBOL(
"i2s_ASN1_INTEGER");
505 K_X509_get_serialNumber = (ASN1_INTEGER * (*) (X509 *)) GET_CRYPTOLIB_SYMBOL(
"X509_get_serialNumber");
506 K_X509_get_pubkey = (EVP_PKEY *(*)(X509 *)) GET_CRYPTOLIB_SYMBOL(
"X509_get_pubkey");
507 K_i2d_PublicKey = (int (*)(EVP_PKEY *,
unsigned char **)) GET_CRYPTOLIB_SYMBOL(
"i2d_PublicKey");
508 K_X509_check_private_key = (int (*)(X509 *, EVP_PKEY *)) GET_CRYPTOLIB_SYMBOL(
"X509_check_private_key");
509 K_BN_bn2hex = (
char *(*)(
const BIGNUM *)) GET_CRYPTOLIB_SYMBOL(
"BN_bn2hex");
510 K_X509_digest = (int (*)(
const X509 *,
const EVP_MD *,
unsigned char *,
unsigned int *)) GET_CRYPTOLIB_SYMBOL(
"X509_digest");
511 K_EVP_md5 = (EVP_MD *(*)()) GET_CRYPTOLIB_SYMBOL(
"EVP_md5");
512 K_ASN1_INTEGER_free = (void (*)(ASN1_INTEGER *)) GET_CRYPTOLIB_SYMBOL(
"ASN1_INTEGER_free");
513 K_OBJ_obj2nid = (int (*)(ASN1_OBJECT *)) GET_CRYPTOLIB_SYMBOL(
"OBJ_obj2nid");
514 K_OBJ_nid2ln = (
const char *(*)(
int)) GET_CRYPTOLIB_SYMBOL(
"OBJ_nid2ln");
515 K_X509_get_ext_count = (int (*)(X509*)) GET_CRYPTOLIB_SYMBOL(
"X509_get_ext_count");
516 K_X509_get_ext_by_NID = (int (*)(X509*,int,int)) GET_CRYPTOLIB_SYMBOL(
"X509_get_ext_by_NID");
517 K_X509_get_ext_by_OBJ = (int (*)(X509*,ASN1_OBJECT*,int)) GET_CRYPTOLIB_SYMBOL(
"X509_get_ext_by_OBJ");
518 K_X509_get_ext = (X509_EXTENSION* (*)(X509*,
int)) GET_CRYPTOLIB_SYMBOL(
"X509_get_ext");
519 K_X509_delete_ext = (X509_EXTENSION* (*)(X509*,
int)) GET_CRYPTOLIB_SYMBOL(
"X509_delete_ext");
520 K_X509_add_ext = (int (*)(X509*,X509_EXTENSION*,int)) GET_CRYPTOLIB_SYMBOL(
"X509_add_ext");
521 K_X509_get_ext_d2i = (
void* (*)(X509*,
int,
int*,
int*)) GET_CRYPTOLIB_SYMBOL(
"X509_get_ext_d2i");
522 K_i2s_ASN1_OCTET_STRING = (
char *(*)(X509V3_EXT_METHOD*,ASN1_OCTET_STRING*)) GET_CRYPTOLIB_SYMBOL(
"i2s_ASN1_OCTET_STRING");
523 K_ASN1_BIT_STRING_get_bit = (int (*)(ASN1_BIT_STRING*,int)) GET_CRYPTOLIB_SYMBOL(
"ASN1_BIT_STRING_get_bit");
524 K_PKCS7_new = (PKCS7 *(*)()) GET_CRYPTOLIB_SYMBOL(
"PKCS7_new");
525 K_PKCS7_free = (void (*)(PKCS7*)) GET_CRYPTOLIB_SYMBOL(
"PKCS7_free");
526 K_PKCS7_content_free = (void (*)(PKCS7*)) GET_CRYPTOLIB_SYMBOL(
"PKCS7_content_free");
527 K_i2d_PKCS7 = (int (*)(PKCS7*,
unsigned char**)) GET_CRYPTOLIB_SYMBOL(
"i2d_PKCS7");
528 K_i2d_PKCS7_fp = (int (*)(FILE*,PKCS7*)) GET_CRYPTOLIB_SYMBOL(
"i2d_PKCS7_fp");
529 K_i2d_PKCS7_bio = (int (*)(BIO *bp,PKCS7 *p7)) GET_CRYPTOLIB_SYMBOL(
"i2d_PKCS7_bio");
530 K_d2i_PKCS7 = (PKCS7* (*)(PKCS7**,
unsigned char**,
long)) GET_CRYPTOLIB_SYMBOL(
"d2i_PKCS7");
531 K_d2i_PKCS7_fp = (PKCS7 *(*)(FILE *,PKCS7**)) GET_CRYPTOLIB_SYMBOL(
"d2i_PKCS7_fp");
532 K_d2i_PKCS7_bio = (PKCS7 *(*)(BIO *bp,PKCS7 **p7)) GET_CRYPTOLIB_SYMBOL(
"d2i_PKCS7_bio");
533 K_PKCS7_dup = (PKCS7* (*)(PKCS7*)) GET_CRYPTOLIB_SYMBOL(
"PKCS7_dup");
534 K_PKCS7_sign = (PKCS7 *(*)(X509*, EVP_PKEY*, STACK_OF(X509)*, BIO*, int)) GET_CRYPTOLIB_SYMBOL(
"PKCS7_sign");
535 K_PKCS7_verify = (int (*)(PKCS7*,STACK_OF(X509)*,X509_STORE*,BIO*,BIO*,int)) GET_CRYPTOLIB_SYMBOL(
"PKCS7_verify");
536 K_PKCS7_get0_signers = (STACK_OF(X509) *(*)(PKCS7 *, STACK_OF(X509) *, int)) GET_CRYPTOLIB_SYMBOL(
"PKCS7_get0_signers");
537 K_PKCS7_encrypt = (PKCS7* (*)(STACK_OF(X509) *, BIO *, EVP_CIPHER *, int)) GET_CRYPTOLIB_SYMBOL(
"PKCS7_encrypt");
538 K_PKCS7_decrypt = (int (*)(PKCS7 *, EVP_PKEY *, X509 *, BIO *, int)) GET_CRYPTOLIB_SYMBOL(
"PKCS7_decrypt");
539 K_PEM_X509_INFO_read = (STACK_OF(X509_INFO) *(*)(FILE*, STACK_OF(X509_INFO)*, pem_password_cb*,
void *)) GET_CRYPTOLIB_SYMBOL(
"PEM_X509_INFO_read");
540 K_ASN1_d2i_fp = (
char *(*)(
char *(*)(),
char *(*)(),FILE*,
unsigned char**)) GET_CRYPTOLIB_SYMBOL(
"ASN1_d2i_fp");
541 K_X509_new = (X509 *(*)()) GET_CRYPTOLIB_SYMBOL(
"X509_new");
542 K_X509_PURPOSE_get_count = (int (*)()) GET_CRYPTOLIB_SYMBOL(
"X509_PURPOSE_get_count");
543 K_X509_PURPOSE_get_id = (int (*)(X509_PURPOSE *)) GET_CRYPTOLIB_SYMBOL(
"X509_PURPOSE_get_id");
544 K_X509_check_purpose = (int (*)(X509*,int,int)) GET_CRYPTOLIB_SYMBOL(
"X509_check_purpose");
545 K_X509_PURPOSE_get0 = (X509_PURPOSE *(*)(
int)) GET_CRYPTOLIB_SYMBOL(
"X509_PURPOSE_get0");
546 K_EVP_PKEY_assign = (int (*)(EVP_PKEY*, int,
char*)) GET_CRYPTOLIB_SYMBOL(
"EVP_PKEY_assign");
547 K_X509_REQ_set_pubkey = (int (*)(X509_REQ*, EVP_PKEY*)) GET_CRYPTOLIB_SYMBOL(
"X509_REQ_set_pubkey");
548 K_RSA_get0_key = (void (*)(
const RSA *r,
const BIGNUM **n,
const BIGNUM **e,
const BIGNUM **d)) GET_CRYPTOLIB_SYMBOL(
"RSA_get0_key");
549 K_RSA_generate_key = (RSA* (*)(
int,
unsigned long,
void (*)(int,int,
void *),
void *)) GET_CRYPTOLIB_SYMBOL(
"RSA_generate_key");
550 K_DSA_get0_pqg = (void (*)(
const DSA *d,
const BIGNUM **p,
const BIGNUM **q,
const BIGNUM **g)) GET_CRYPTOLIB_SYMBOL(
"DSA_get0_pqg");
551 K_DSA_get0_key = (void (*)(
const DSA *d,
const BIGNUM **pub_key,
const BIGNUM **priv_key)) GET_CRYPTOLIB_SYMBOL(
"DSA_get0_key");
552 K_i2d_X509_REQ_fp = (int (*)(FILE *, X509_REQ *)) GET_CRYPTOLIB_SYMBOL(
"i2d_X509_REQ_fp");
553 K_ERR_clear_error = (void (*)()) GET_CRYPTOLIB_SYMBOL(
"ERR_clear_error");
554 K_ERR_get_error = (
unsigned long (*)()) GET_CRYPTOLIB_SYMBOL(
"ERR_get_error");
555 K_ERR_print_errors_fp = (void (*)(FILE*)) GET_CRYPTOLIB_SYMBOL(
"ERR_print_errors_fp");
556 K_X509_get1_email = (STACK *(*)(X509 *x)) GET_CRYPTOLIB_SYMBOL(
"X509_get1_email");
557 K_X509_email_free = (void (*)(STACK *sk)) GET_CRYPTOLIB_SYMBOL(
"X509_email_free");
558 K_EVP_des_ede3_cbc = (EVP_CIPHER *(*)()) GET_CRYPTOLIB_SYMBOL(
"EVP_des_ede3_cbc");
559 K_EVP_des_cbc = (EVP_CIPHER *(*)()) GET_CRYPTOLIB_SYMBOL(
"EVP_des_cbc");
560 K_EVP_rc2_cbc = (EVP_CIPHER *(*)()) GET_CRYPTOLIB_SYMBOL(
"EVP_rc2_cbc");
561 K_EVP_rc2_64_cbc = (EVP_CIPHER *(*)()) GET_CRYPTOLIB_SYMBOL(
"EVP_rc2_64_cbc");
562 K_EVP_rc2_40_cbc = (EVP_CIPHER *(*)()) GET_CRYPTOLIB_SYMBOL(
"EVP_rc2_40_cbc");
563 K_i2d_PrivateKey_fp = (int (*)(FILE*,EVP_PKEY*)) GET_CRYPTOLIB_SYMBOL(
"i2d_PrivateKey_fp");
564 K_i2d_PKCS8PrivateKey_fp = (int (*)(FILE*, EVP_PKEY*,
const EVP_CIPHER*,
char*, int, pem_password_cb*,
void*)) GET_CRYPTOLIB_SYMBOL(
"i2d_PKCS8PrivateKey_fp");
565 K_RSA_free = (void (*)(RSA*)) GET_CRYPTOLIB_SYMBOL(
"RSA_free");
566 K_EVP_bf_cbc = (EVP_CIPHER *(*)()) GET_CRYPTOLIB_SYMBOL(
"EVP_bf_cbc");
567 K_X509_REQ_sign = (int (*)(X509_REQ*, EVP_PKEY*,
const EVP_MD*)) GET_CRYPTOLIB_SYMBOL(
"X509_REQ_sign");
568 K_X509_NAME_add_entry_by_txt = (int (*)(X509_NAME*,
char*, int,
unsigned char*, int, int, int)) GET_CRYPTOLIB_SYMBOL(
"X509_NAME_add_entry_by_txt");
569 K_X509_NAME_new = (X509_NAME *(*)()) GET_CRYPTOLIB_SYMBOL(
"X509_NAME_new");
570 K_X509_REQ_set_subject_name = (int (*)(X509_REQ*,X509_NAME*)) GET_CRYPTOLIB_SYMBOL(
"X509_REQ_set_subject_name");
571 K_ASN1_STRING_data = (
unsigned char *(*)(ASN1_STRING*)) GET_CRYPTOLIB_SYMBOL(
"ASN1_STRING_data");
572 K_ASN1_STRING_get0_data = (
const unsigned char *(*)(
const ASN1_STRING*)) GET_CRYPTOLIB_SYMBOL(
"ASN1_STRING_get0_data");
573 K_ASN1_STRING_length = (int (*)(
const ASN1_STRING*)) GET_CRYPTOLIB_SYMBOL(
"ASN1_STRING_length");
574 K_ASN1_OCTET_STRING_new = (ASN1_OCTET_STRING *(*)()) GET_CRYPTOLIB_SYMBOL(
"ASN1_OCTET_STRING_new");
575 K_ASN1_OCTET_STRING_free = (void (*)(ASN1_OCTET_STRING *)) GET_CRYPTOLIB_SYMBOL(
"ASN1_OCTET_STRING_free");
576 K_ASN1_OCTET_STRING_set = (int (*)(ASN1_OCTET_STRING *,
const unsigned char *, int)) GET_CRYPTOLIB_SYMBOL(
"ASN1_OCTET_STRING_set");
577 K_X509_CRL_get0_lastUpdate = (
const ASN1_TIME* (*)(
const X509_CRL *crl)) GET_CRYPTOLIB_SYMBOL(
"X509_CRL_get0_lastUpdate");
578 K_X509_CRL_get0_nextUpdate = (
const ASN1_TIME* (*)(
const X509_CRL *crl)) GET_CRYPTOLIB_SYMBOL(
"X509_CRL_get0_nextUpdate");
579 K_X509_STORE_CTX_get_current_cert = (X509* (*)(X509_STORE_CTX *ctx)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_CTX_get_current_cert");
580 K_X509_STORE_CTX_get_error = (int (*)(X509_STORE_CTX *ctx)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_CTX_get_error");
581 K_X509_STORE_CTX_get_error_depth = (int (*)(X509_STORE_CTX *ctx)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_CTX_get_error_depth");
582 K_X509_STORE_CTX_set_error = (void (*)(X509_STORE_CTX *ctx,
int s)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_CTX_set_error");
583 K_X509_STORE_set_verify_cb = (void (*)(X509_STORE *ctx,
584 X509_STORE_CTX_verify_cb verify_cb)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_set_verify_cb");
585 K_X509_STORE_get0_objects = (STACK_OF(X509_OBJECT)* (*)(X509_STORE *v)) GET_CRYPTOLIB_SYMBOL(
"X509_STORE_get0_objects");
586 K_X509_OBJECT_get_type = (X509_LOOKUP_TYPE (*)(
const X509_OBJECT *a)) GET_CRYPTOLIB_SYMBOL(
"X509_OBJECT_get_type");
587 K_X509_OBJECT_get0_X509 = (X509* (*)(
const X509_OBJECT *a)) GET_CRYPTOLIB_SYMBOL(
"X509_OBJECT_get0_X509");
588 K_X509_getm_notAfter = (ASN1_TIME* (*)(
const X509 *x)) GET_CRYPTOLIB_SYMBOL(
"X509_getm_notAfter");
589 K_X509_getm_notBefore = (ASN1_TIME* (*)(
const X509 *x)) GET_CRYPTOLIB_SYMBOL(
"X509_getm_notBefore");
595 TQString libname = findMostRecentLib(
"/usr/lib",
"ssl");
596 if (!libname.isNull())
597 _sslLib = ll->globalLibrary(libname.latin1());
600 for (TQStringList::Iterator it = libpaths.begin();
601 it != libpaths.end();
603 for (TQStringList::Iterator shit = libnamess.begin();
604 shit != libnamess.end();
607 if (!alib.isEmpty() && !alib.endsWith(
"/"))
610 TQString tmpStr(alib.latin1());
611 tmpStr.replace(TQRegExp(
"\\(.*\\)"),
"");
612 if (!access(tmpStr.latin1(), R_OK))
613 _sslLib = ll->globalLibrary(alib.latin1());
623 K_SSL_connect = (int (*)(SSL *)) GET_SSLLIB_SYMBOL(
"SSL_connect");
624 K_SSL_accept = (int (*)(SSL *)) GET_SSLLIB_SYMBOL(
"SSL_accept");
625 K_SSL_read = (int (*)(SSL *,
void *, int)) GET_SSLLIB_SYMBOL(
"SSL_read");
626 K_SSL_write = (int (*)(SSL *,
const void *, int))
627 GET_SSLLIB_SYMBOL(
"SSL_write");
628 K_SSL_new = (SSL* (*)(SSL_CTX *)) GET_SSLLIB_SYMBOL(
"SSL_new");
629 K_SSL_free = (void (*)(SSL *)) GET_SSLLIB_SYMBOL(
"SSL_free");
630 K_SSL_shutdown = (int (*)(SSL *)) GET_SSLLIB_SYMBOL(
"SSL_shutdown");
631 K_SSL_CTX_new = (SSL_CTX* (*)(SSL_METHOD*)) GET_SSLLIB_SYMBOL(
"SSL_CTX_new");
632 K_SSL_CTX_free = (void (*)(SSL_CTX*)) GET_SSLLIB_SYMBOL(
"SSL_CTX_free");
633 K_SSL_set_fd = (int (*)(SSL *, int)) GET_SSLLIB_SYMBOL(
"SSL_set_fd");
634 K_SSL_pending = (int (*)(SSL *)) GET_SSLLIB_SYMBOL(
"SSL_pending");
635 K_SSL_CTX_set_cipher_list = (int (*)(SSL_CTX *,
const char *))
636 GET_SSLLIB_SYMBOL(
"SSL_CTX_set_cipher_list");
637 K_SSL_CTX_set_verify = (void (*)(SSL_CTX*, int, int (*)(int, X509_STORE_CTX*))) GET_SSLLIB_SYMBOL(
"SSL_CTX_set_verify");
638 K_SSL_use_certificate = (int (*)(SSL*, X509*))
639 GET_SSLLIB_SYMBOL(
"SSL_CTX_use_certificate");
640 K_SSL_get_current_cipher = (SSL_CIPHER *(*)(SSL *))
641 GET_SSLLIB_SYMBOL(
"SSL_get_current_cipher");
642 K_SSL_set_options = (long (*)(SSL *ssl,
long options)) GET_SSLLIB_SYMBOL(
"SSL_set_options");
643 K_SSL_session_reused = (int (*)(SSL *ssl)) GET_SSLLIB_SYMBOL(
"SSL_session_reused");
644 K_SSL_ctrl = (long (*)(SSL * ,int, long,
void *))
645 GET_SSLLIB_SYMBOL(
"SSL_ctrl");
646 K_TLSv1_client_method = (SSL_METHOD *(*)()) GET_SSLLIB_SYMBOL(
"TLSv1_client_method");
647 K_SSLv2_client_method = (SSL_METHOD *(*)()) GET_SSLLIB_SYMBOL(
"SSLv2_client_method");
648 K_SSLv3_client_method = (SSL_METHOD *(*)()) GET_SSLLIB_SYMBOL(
"SSLv3_client_method");
649 K_TLS_client_method = (SSL_METHOD *(*)()) GET_SSLLIB_SYMBOL(
"TLS_client_method");
650 if (!K_TLS_client_method) K_TLS_client_method = (SSL_METHOD *(*)()) GET_SSLLIB_SYMBOL(
"SSLv23_client_method");
651 K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) GET_SSLLIB_SYMBOL(
"SSL_get1_peer_certificate");
652 if (!K_SSL_get_peer_certificate) K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) GET_SSLLIB_SYMBOL(
"SSL_get_peer_certificate");
653 K_SSL_CIPHER_get_bits = (int (*)(SSL_CIPHER *,
int *)) GET_SSLLIB_SYMBOL(
"SSL_CIPHER_get_bits");
654 K_SSL_CIPHER_get_version = (
char * (*)(SSL_CIPHER *)) GET_SSLLIB_SYMBOL(
"SSL_CIPHER_get_version");
655 K_SSL_CIPHER_get_name = (
const char * (*)(SSL_CIPHER *)) GET_SSLLIB_SYMBOL(
"SSL_CIPHER_get_name");
656 K_SSL_CIPHER_description = (
char * (*)(SSL_CIPHER *,
char *,
int)) GET_SSLLIB_SYMBOL(
"SSL_CIPHER_description");
657 K_SSL_CTX_use_PrivateKey = (int (*)(SSL_CTX*, EVP_PKEY*)) GET_SSLLIB_SYMBOL(
"SSL_CTX_use_PrivateKey");
658 K_SSL_CTX_use_certificate = (int (*)(SSL_CTX*, X509*)) GET_SSLLIB_SYMBOL(
"SSL_CTX_use_certificate");
659 K_SSL_get_error = (int (*)(SSL*, int)) GET_SSLLIB_SYMBOL(
"SSL_get_error");
660 K_SSL_get_peer_cert_chain = (STACK_OF(X509)* (*)(SSL*)) GET_SSLLIB_SYMBOL(
"SSL_get_peer_cert_chain");
661 K_SSL_load_client_CA_file = (STACK_OF(X509_NAME)* (*)(
const char *)) GET_SSLLIB_SYMBOL(
"SSL_load_client_CA_file");
662 K_SSL_peek = (int (*)(SSL*,
void*,int)) GET_SSLLIB_SYMBOL(
"SSL_peek");
663 K_SSL_get1_session = (SSL_SESSION* (*)(SSL*)) GET_SSLLIB_SYMBOL(
"SSL_get1_session");
664 K_SSL_SESSION_free = (void (*)(SSL_SESSION*)) GET_SSLLIB_SYMBOL(
"SSL_SESSION_free");
665 K_SSL_set_session = (int (*)(SSL*,SSL_SESSION*)) GET_SSLLIB_SYMBOL(
"SSL_set_session");
666 K_d2i_SSL_SESSION = (SSL_SESSION* (*)(SSL_SESSION**,
unsigned char**,
long)) GET_SSLLIB_SYMBOL(
"d2i_SSL_SESSION");
667 K_i2d_SSL_SESSION = (int (*)(SSL_SESSION*,
unsigned char**)) GET_SSLLIB_SYMBOL(
"i2d_SSL_SESSION");
668 K_SSL_get_ciphers = (STACK_OF(SSL_CIPHER) *(*)(
const SSL*)) GET_SSLLIB_SYMBOL(
"SSL_get_ciphers");
674 x = GET_SSLLIB_SYMBOL(
"OPENSSL_init_ssl");
678 ((int (*)(
unsigned long long,
void*))x)(0, NULL);
679 x = GET_CRYPTOLIB_SYMBOL(
"OPENSSL_init_crypto");
680 if (x) ((int (*)(
unsigned long long,
void*))x)(OPENSSL_INIT_ADD_ALL_CIPHERS
681 | OPENSSL_INIT_ADD_ALL_DIGESTS
682 | OPENSSL_INIT_LOAD_CONFIG,
688 x = GET_SSLLIB_SYMBOL(
"SSL_library_init");
690 if (x) ((int (*)())x)();
691 x = GET_CRYPTOLIB_SYMBOL(
"OpenSSL_add_all_algorithms");
693 x = GET_CRYPTOLIB_SYMBOL(
"OPENSSL_add_all_algorithms");
697 x = GET_CRYPTOLIB_SYMBOL(
"OpenSSL_add_all_algorithms_conf");
699 x = GET_CRYPTOLIB_SYMBOL(
"OPENSSL_add_all_algorithms_conf");
703 x = GET_CRYPTOLIB_SYMBOL(
"OpenSSL_add_all_algorithms_noconf");
705 x = GET_CRYPTOLIB_SYMBOL(
"OPENSSL_add_all_algorithms_noconf");
710 x = GET_CRYPTOLIB_SYMBOL(
"OpenSSL_add_all_ciphers");
712 x = GET_CRYPTOLIB_SYMBOL(
"OPENSSL_add_all_ciphers");
713 if (x) ((void (*)())x)();
714 x = GET_CRYPTOLIB_SYMBOL(
"OpenSSL_add_all_digests");
716 x = GET_CRYPTOLIB_SYMBOL(
"OPENSSL_add_all_digests");
717 if (x) ((void (*)())x)();
726 static KStaticDeleter<KOpenSSLProxy> medProxy;
730 KOpenSSLProxy::~KOpenSSLProxy() {
735 _cryptoLib->unload();
737 medProxy.setObject(0);
762 int KOpenSSLProxy::SSL_connect(SSL *ssl) {
763 if (K_SSL_connect)
return (K_SSL_connect)(ssl);
764 kdWarning() <<
"SSL_connect not defined!" << endl;
769 int KOpenSSLProxy::SSL_accept(SSL *ssl) {
770 if (K_SSL_accept)
return (K_SSL_accept)(ssl);
771 kdWarning() <<
"SSL_accept not defined!" << endl;
776 int KOpenSSLProxy::SSL_read(SSL *ssl,
void *buf,
int num) {
777 if (K_SSL_read)
return (K_SSL_read)(ssl, buf, num);
778 kdWarning() <<
"SSL_read not defined!" << endl;
783 int KOpenSSLProxy::SSL_write(SSL *ssl,
const void *buf,
int num) {
784 if (K_SSL_write)
return (K_SSL_write)(ssl, buf, num);
785 kdWarning() <<
"SSL_write not defined!" << endl;
790 SSL *KOpenSSLProxy::SSL_new(SSL_CTX *ctx) {
791 if (K_SSL_new)
return (K_SSL_new)(ctx);
792 kdWarning() <<
"SSL_new not defined!" << endl;
797 void KOpenSSLProxy::SSL_free(SSL *ssl) {
798 if (K_SSL_free) (K_SSL_free)(ssl);
799 else kdWarning() <<
"SSL_free not defined!" << endl;
803 int KOpenSSLProxy::SSL_shutdown(SSL *ssl) {
804 if (K_SSL_shutdown)
return (K_SSL_shutdown)(ssl);
805 kdWarning() <<
"SSL_shutdown not defined!" << endl;
810 SSL_CTX *KOpenSSLProxy::SSL_CTX_new(SSL_METHOD *method) {
811 if (K_SSL_CTX_new)
return (K_SSL_CTX_new)(method);
812 kdWarning() <<
"SSL_CTX_new not defined!" << endl;
817 void KOpenSSLProxy::SSL_CTX_free(SSL_CTX *ctx) {
818 if (K_SSL_CTX_free) (K_SSL_CTX_free)(ctx);
819 else kdWarning() <<
"SSL_CTX_free not defined!" << endl;
823 int KOpenSSLProxy::SSL_set_fd(SSL *ssl,
int fd) {
824 if (K_SSL_set_fd)
return (K_SSL_set_fd)(ssl, fd);
825 kdWarning() <<
"SSL_sed_fd not defined!" << endl;
830 int KOpenSSLProxy::SSL_pending(SSL *ssl) {
831 if (K_SSL_pending)
return (K_SSL_pending)(ssl);
832 kdWarning() <<
"SSL_pending not defined!" << endl;
837 int KOpenSSLProxy::SSL_CTX_set_cipher_list(SSL_CTX *ctx,
const char *str) {
838 if (K_SSL_CTX_set_cipher_list)
return (K_SSL_CTX_set_cipher_list)(ctx, str);
839 kdWarning() <<
"SSL_CTX_set_cipher_list not defined!" << endl;
844 void KOpenSSLProxy::SSL_CTX_set_verify(SSL_CTX *ctx,
int mode,
845 int (*verify_callback)(
int, X509_STORE_CTX *)) {
846 if (K_SSL_CTX_set_verify) (K_SSL_CTX_set_verify)(ctx, mode, verify_callback);
847 else kdWarning() <<
"SSL_CTX_set_verify not defined!" << endl;
851 int KOpenSSLProxy::SSL_use_certificate(SSL *ssl, X509 *x) {
852 if (K_SSL_use_certificate)
return (K_SSL_use_certificate)(ssl, x);
853 kdWarning() <<
"SSL_use_certificate not defined!" << endl;
858 SSL_CIPHER *KOpenSSLProxy::SSL_get_current_cipher(SSL *ssl) {
859 if (K_SSL_get_current_cipher)
return (K_SSL_get_current_cipher)(ssl);
860 kdWarning() <<
"SSL_get_current_cipher not defined!" << endl;
865 long KOpenSSLProxy::_SSL_set_options(SSL *ssl,
long options) {
866 if (K_SSL_set_options)
return (K_SSL_set_options)(ssl, options);
867 kdWarning() <<
"SSL_set_options not defined!" << endl;
872 int KOpenSSLProxy::_SSL_session_reused(SSL *ssl) {
873 if (K_SSL_session_reused)
return (K_SSL_session_reused)(ssl);
874 kdWarning() <<
"SSL_session_reused not defined!" << endl;
879 long KOpenSSLProxy::SSL_ctrl(SSL *ssl,
int cmd,
long larg,
void *parg) {
880 if (K_SSL_ctrl)
return (K_SSL_ctrl)(ssl, cmd, larg, parg);
881 kdWarning() <<
"SSL_ctrl not defined!" << endl;
886 int KOpenSSLProxy::RAND_egd(
const char *path) {
887 if (K_RAND_egd)
return (K_RAND_egd)(path);
888 kdWarning() <<
"RAND_egd not defined!" << endl;
893 SSL_METHOD *KOpenSSLProxy::TLSv1_client_method() {
894 if (K_TLSv1_client_method)
return (K_TLSv1_client_method)();
895 kdWarning() <<
"TLSv1_client_method not defined!" << endl;
900 SSL_METHOD *KOpenSSLProxy::SSLv2_client_method() {
901 if (K_SSLv2_client_method)
return (K_SSLv2_client_method)();
902 kdWarning() <<
"SSLv2_client_method not defined!" << endl;
907 SSL_METHOD *KOpenSSLProxy::SSLv3_client_method() {
908 if (K_SSLv3_client_method)
return (K_SSLv3_client_method)();
909 kdWarning() <<
"SSLv3_client_method not defined!" << endl;
914 SSL_METHOD *KOpenSSLProxy::TLS_client_method() {
915 if (K_TLS_client_method)
return (K_TLS_client_method)();
916 kdWarning() <<
"TLS_client_method not defined!" << endl;
921 X509 *KOpenSSLProxy::SSL_get_peer_certificate(SSL *s) {
922 if (K_SSL_get_peer_certificate)
return (K_SSL_get_peer_certificate)(s);
923 kdWarning() <<
"SSL_get_peer_certificate not defined!" << endl;
928 int KOpenSSLProxy::SSL_CIPHER_get_bits(SSL_CIPHER *c,
int *alg_bits) {
929 if (K_SSL_CIPHER_get_bits)
return (K_SSL_CIPHER_get_bits)(c, alg_bits);
930 kdWarning() <<
"SSL_CIPHER_get_bits not defined!" << endl;
935 char * KOpenSSLProxy::SSL_CIPHER_get_version(SSL_CIPHER *c) {
936 if (K_SSL_CIPHER_get_version)
return (K_SSL_CIPHER_get_version)(c);
937 kdWarning() <<
"SSL_CIPHER_get_version not defined!" << endl;
942 const char * KOpenSSLProxy::SSL_CIPHER_get_name(SSL_CIPHER *c) {
943 if (K_SSL_CIPHER_get_name)
return (K_SSL_CIPHER_get_name)(c);
944 kdWarning() <<
"SSL_CIPHER_get_name not defined!" << endl;
949 char * KOpenSSLProxy::SSL_CIPHER_description(SSL_CIPHER *c,
char *buf,
int size) {
950 if (K_SSL_CIPHER_description)
return (K_SSL_CIPHER_description)(c,buf,size);
951 kdWarning() <<
"SSL_CIPHER_description not defined!" << endl;
956 X509 * KOpenSSLProxy::d2i_X509(X509 **a,
unsigned char **pp,
long length) {
957 if (K_d2i_X509)
return (K_d2i_X509)(a,pp,length);
958 kdWarning() <<
"d2i_X509 not defined!" << endl;
963 X509_CRL * KOpenSSLProxy::d2i_X509_CRL(X509_CRL **a,
unsigned char **pp,
long length) {
964 if (K_d2i_X509_CRL)
return (K_d2i_X509_CRL)(a,pp,length);
965 kdWarning() <<
"d2i_X509_CRL not defined!" << endl;
970 int KOpenSSLProxy::i2d_X509(X509 *a,
unsigned char **pp) {
971 if (K_i2d_X509)
return (K_i2d_X509)(a,pp);
972 kdWarning() <<
"i2d_X509 not defined!" << endl;
977 int KOpenSSLProxy::X509_cmp(X509 *a, X509 *b) {
978 if (K_X509_cmp)
return (K_X509_cmp)(a,b);
979 kdWarning() <<
"X509_cmp not defined!" << endl;
984 int KOpenSSLProxy::X509_subject_name_cmp(
const X509 *a,
const X509 *b) {
985 if (K_X509_subject_name_cmp)
return (K_X509_subject_name_cmp)(a, b);
986 kdWarning() <<
"X509_subject_name_cmp not defined!" << endl;
991 X509_STORE *KOpenSSLProxy::X509_STORE_new(
void) {
992 if (K_X509_STORE_new)
return (K_X509_STORE_new)();
993 kdWarning() <<
"X509_STORE_new not defined!" << endl;
998 void KOpenSSLProxy::X509_STORE_free(X509_STORE *v) {
999 if (K_X509_STORE_free) (K_X509_STORE_free)(v);
1000 else kdWarning() <<
"X509_STORE_free not defined!" << endl;
1004 X509_STORE_CTX *KOpenSSLProxy::X509_STORE_CTX_new(
void) {
1005 if (K_X509_STORE_CTX_new)
return (K_X509_STORE_CTX_new)();
1006 kdWarning() <<
"X509_STORE_CTX_new not defined!" << endl;
1011 void KOpenSSLProxy::X509_STORE_CTX_free(X509_STORE_CTX *ctx) {
1012 if (K_X509_STORE_CTX_free) (K_X509_STORE_CTX_free)(ctx);
1013 else kdWarning() <<
"X509_STORE_CTX_free not defined!" << endl;
1017 int KOpenSSLProxy::X509_verify_cert(X509_STORE_CTX *ctx) {
1018 if (K_X509_verify_cert)
return (K_X509_verify_cert)(ctx);
1019 kdWarning() <<
"X509_verify_cert not defined!" << endl;
1024 void KOpenSSLProxy::X509_free(X509 *a) {
1025 if (K_X509_free) (K_X509_free)(a);
1026 else kdWarning() <<
"X509_free not defined!" << endl;
1030 void KOpenSSLProxy::X509_CRL_free(X509_CRL *a) {
1031 if (K_X509_CRL_free) (K_X509_CRL_free)(a);
1032 else kdWarning() <<
"X509_CRL_free not defined!" << endl;
1036 char *KOpenSSLProxy::X509_NAME_oneline(X509_NAME *a,
char *buf,
int size) {
1037 if (K_X509_NAME_oneline)
return (K_X509_NAME_oneline)(a,buf,size);
1038 kdWarning() <<
"X509_NAME_online not defined!" << endl;
1043 X509_NAME *KOpenSSLProxy::X509_get_subject_name(X509 *a) {
1044 if (K_X509_get_subject_name)
return (K_X509_get_subject_name)(a);
1045 kdWarning() <<
"X509_get_subject not defined!" << endl;
1050 X509_NAME *KOpenSSLProxy::X509_get_issuer_name(X509 *a) {
1051 if (K_X509_get_issuer_name)
return (K_X509_get_issuer_name)(a);
1052 kdWarning() <<
"X509_get_issuer not defined!" << endl;
1057 X509_LOOKUP *KOpenSSLProxy::X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) {
1058 if (K_X509_STORE_add_lookup)
return (K_X509_STORE_add_lookup)(v,m);
1059 kdWarning() <<
"X509_STORE_add_lookup not defined!" << endl;
1064 X509_LOOKUP_METHOD *KOpenSSLProxy::X509_LOOKUP_file(
void) {
1065 if (K_X509_LOOKUP_file)
return (K_X509_LOOKUP_file)();
1066 kdWarning() <<
"X509_LOOKUP_file not defined!" << endl;
1071 void KOpenSSLProxy::X509_LOOKUP_free(X509_LOOKUP *x) {
1072 if (K_X509_LOOKUP_free) (K_X509_LOOKUP_free)(x);
1073 else kdWarning() <<
"X509_LOOKUP_free not defined!" << endl;
1077 int KOpenSSLProxy::X509_LOOKUP_ctrl(X509_LOOKUP *ctx,
int cmd,
const char *argc,
long argl,
char **ret) {
1078 if (K_X509_LOOKUP_ctrl)
return (K_X509_LOOKUP_ctrl)(ctx,cmd,argc,argl,ret);
1079 kdWarning() <<
"X509_LOOKUP_ctrl not defined!" << endl;
1084 void KOpenSSLProxy::X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, STACK_OF(X509) *chain) {
1085 if (K_X509_STORE_CTX_init) (K_X509_STORE_CTX_init)(ctx,store,x509,chain);
1086 else kdWarning() <<
"X509_STORE_CTX_init not defined!" << endl;
1090 void KOpenSSLProxy::CRYPTO_free(
void *x) {
1091 if (K_CRYPTO_free) (K_CRYPTO_free)(x);
1092 else kdWarning() <<
"CRYPTO_free not defined!" << endl;
1096 X509 *KOpenSSLProxy::X509_dup(X509 *x509) {
1097 if (K_X509_dup)
return (K_X509_dup)(x509);
1098 kdWarning() <<
"X509_dup not defined!" << endl;
1103 void KOpenSSLProxy::X509_get0_signature(
const ASN1_BIT_STRING **psig,
1104 const X509_ALGOR **palg,
const X509 *x) {
1105 if (K_X509_get0_signature) {
1106 (X509_get0_signature)(psig, palg, x);
1109 kdWarning() <<
"X509_get0_signature not defined!" << endl;
1113 BIO *KOpenSSLProxy::BIO_new(BIO_METHOD *type) {
1114 if (K_BIO_new)
return (K_BIO_new)(type);
1115 kdWarning() <<
"BIO_new not defined!" << endl;
1120 BIO_METHOD *KOpenSSLProxy::BIO_s_mem(
void) {
1121 if (K_BIO_s_mem)
return (K_BIO_s_mem)();
1122 kdWarning() <<
"BIO_s_mem not defined!" << endl;
1127 BIO *KOpenSSLProxy::BIO_new_fp(FILE *stream,
int close_flag) {
1128 if (K_BIO_new_fp)
return (K_BIO_new_fp)(stream, close_flag);
1129 kdWarning() <<
"BIO_new_fp not defined!" << endl;
1134 BIO *KOpenSSLProxy::BIO_new_mem_buf(
void *buf,
int len) {
1135 if (K_BIO_new_mem_buf)
return (K_BIO_new_mem_buf)(buf,len);
1136 kdWarning() <<
"BIO_new_mem_buf not defined!" << endl;
1141 int KOpenSSLProxy::BIO_free(BIO *a) {
1142 if (K_BIO_free)
return (K_BIO_free)(a);
1143 kdWarning() <<
"BIO_free not defined!" << endl;
1148 long KOpenSSLProxy::BIO_ctrl(BIO *bp,
int cmd,
long larg,
void *parg) {
1149 if (K_BIO_ctrl)
return (K_BIO_ctrl)(bp,cmd,larg,parg);
1150 kdWarning() <<
"BIO_ctrl not defined!" << endl;
1155 int KOpenSSLProxy::BIO_write(BIO *b,
const void *data,
int len) {
1156 if (K_BIO_write)
return (K_BIO_write)(b, data, len);
1157 kdWarning() <<
"BIO_write not defined!" << endl;
1162 void *KOpenSSLProxy::BIO_get_data(BIO *a) {
1163 if (K_BIO_get_data)
return (K_BIO_get_data)(a);
1164 kdWarning() <<
"BIO_get_data not defined!" << endl;
1169 int KOpenSSLProxy::PEM_write_bio_X509(BIO *bp, X509 *x) {
1170 if (K_PEM_ASN1_write_bio)
return (K_PEM_ASN1_write_bio) ((int (*)())K_i2d_X509, PEM_STRING_X509, bp, (
char *)x, 0L, 0L, 0, 0L, 0L);
1171 kdWarning() <<
"PEM_write_bio_X509 not defined!" << endl;
1175 int KOpenSSLProxy::ASN1_i2d_fp(FILE *out,
unsigned char *x) {
1176 if (K_ASN1_item_i2d_fp && K_NETSCAPE_X509_it)
1177 return (K_ASN1_item_i2d_fp)(K_NETSCAPE_X509_it, out, x);
1178 kdWarning() <<
"ANS1_i2d_fp not defined!" << endl;
1182 int KOpenSSLProxy::X509_print(FILE *fp, X509 *x) {
1183 if (K_X509_print_fp)
return (K_X509_print_fp)(fp, x);
1184 kdWarning() <<
"X509_print not defined!" << endl;
1189 PKCS12 *KOpenSSLProxy::d2i_PKCS12_fp(FILE *fp, PKCS12 **p12) {
1190 if (K_d2i_PKCS12_fp)
return (K_d2i_PKCS12_fp)(fp, p12);
1191 kdWarning() <<
"d2i_PKCS12_fp not defined!" << endl;
1196 int KOpenSSLProxy::PKCS12_newpass(PKCS12 *p12,
char *oldpass,
char *newpass) {
1197 if (K_PKCS12_newpass)
return (K_PKCS12_newpass)(p12, oldpass, newpass);
1198 kdWarning() <<
"PKCS12_newpass not defined!" << endl;
1203 int KOpenSSLProxy::i2d_PKCS12(PKCS12 *p12,
unsigned char **p) {
1204 if (K_i2d_PKCS12)
return (K_i2d_PKCS12)(p12, p);
1205 kdWarning() <<
"i2d_PKCS12 not defined!" << endl;
1210 int KOpenSSLProxy::i2d_PKCS12_fp(FILE *fp, PKCS12 *p12) {
1211 if (K_i2d_PKCS12_fp)
return (K_i2d_PKCS12_fp)(fp, p12);
1212 kdWarning() <<
"i2d_PKCS12_fp not defined!" << endl;
1217 PKCS12 *KOpenSSLProxy::PKCS12_new(
void) {
1218 if (K_PKCS12_new)
return (K_PKCS12_new)();
1219 kdWarning() <<
"PKCS12_new not defined!" << endl;
1224 void KOpenSSLProxy::PKCS12_free(PKCS12 *a) {
1225 if (K_PKCS12_free) (K_PKCS12_free)(a);
1226 else kdWarning() <<
"PKCS12_free not defined!" << endl;
1230 int KOpenSSLProxy::PKCS12_parse(PKCS12 *p12,
const char *pass, EVP_PKEY **pkey,
1231 X509 **cert, STACK_OF(X509) **ca) {
1232 if (K_PKCS12_parse)
return (K_PKCS12_parse) (p12, pass, pkey, cert, ca);
1233 kdWarning() <<
"PKCS12_parse not defined!" << endl;
1238 void KOpenSSLProxy::EVP_PKEY_free(EVP_PKEY *x) {
1239 if (K_EVP_PKEY_free) (K_EVP_PKEY_free)(x);
1240 else kdWarning() <<
"EVP_PKEY_free not defined!" << endl;
1244 EVP_PKEY* KOpenSSLProxy::EVP_PKEY_new() {
1245 if (K_EVP_PKEY_new)
return (K_EVP_PKEY_new)();
1246 kdWarning() <<
"EVP_PKEY_new not defined!" << endl;
1251 int KOpenSSLProxy::EVP_PKEY_base_id(
const EVP_PKEY *pkey) {
1252 if (K_EVP_PKEY_base_id)
return (K_EVP_PKEY_base_id)(pkey);
1253 kdWarning() <<
"EVP_PKEY_base_id not defined!" << endl;
1258 RSA* KOpenSSLProxy::EVP_PKEY_get0_RSA(EVP_PKEY *pkey) {
1259 if (K_EVP_PKEY_get0_RSA)
return (K_EVP_PKEY_get0_RSA)(pkey);
1260 kdWarning() <<
"EVP_PKEY_get0_RSA not defined!" << endl;
1265 DSA* KOpenSSLProxy::EVP_PKEY_get0_DSA(EVP_PKEY *pkey) {
1266 if (K_EVP_PKEY_get0_DSA)
return (K_EVP_PKEY_get0_DSA)(pkey);
1267 kdWarning() <<
"EVP_PKEY_get0_DSA not defined!" << endl;
1272 void KOpenSSLProxy::X509_REQ_free(X509_REQ *x) {
1273 if (K_X509_REQ_free) (K_X509_REQ_free)(x);
1274 else kdWarning() <<
"X509_REQ_free not defined!" << endl;
1278 X509_REQ* KOpenSSLProxy::X509_REQ_new() {
1279 if (K_X509_REQ_new)
return (K_X509_REQ_new)();
1280 kdWarning() <<
"X509_REQ_new not defined!" << endl;
1285 int KOpenSSLProxy::SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) {
1286 if (K_SSL_CTX_use_PrivateKey)
return (K_SSL_CTX_use_PrivateKey)(ctx,pkey);
1287 kdWarning() <<
"SSL_CTX_use_PrivateKey not defined!" << endl;
1292 int KOpenSSLProxy::SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x) {
1293 if (K_SSL_CTX_use_certificate)
return (K_SSL_CTX_use_certificate)(ctx,x);
1294 kdWarning() <<
"SSL_CTX_use_certificate not defined!" << endl;
1299 int KOpenSSLProxy::SSL_get_error(SSL *ssl,
int rc) {
1300 if (K_SSL_get_error)
return (K_SSL_get_error)(ssl,rc);
1301 kdWarning() <<
"SSL_get_error not defined!" << endl;
1306 STACK_OF(X509) *KOpenSSLProxy::SSL_get_peer_cert_chain(SSL *s) {
1307 if (K_SSL_get_peer_cert_chain)
return (K_SSL_get_peer_cert_chain)(s);
1308 kdWarning() <<
"SSL_get_peer_cert_chain not defined!" << endl;
1313 void KOpenSSLProxy::OPENSSL_sk_free(STACK *s) {
1314 if (K_sk_free) (K_sk_free)(s);
1315 else kdWarning() <<
"OPENSSL_sk_free not defined!" << endl;
1319 int KOpenSSLProxy::OPENSSL_sk_num(STACK *s) {
1320 if (K_sk_num)
return (K_sk_num)(s);
1321 kdWarning() <<
"OPENSSL_sk_num not defined!" << endl;
1326 char *KOpenSSLProxy::OPENSSL_sk_pop(STACK *s) {
1327 if (K_sk_pop)
return (K_sk_pop)(s);
1328 kdWarning() <<
"OPENSSL_sk_pop not defined!" << endl;
1333 char *KOpenSSLProxy::OPENSSL_sk_value(STACK *s,
int n) {
1334 if (K_sk_value)
return (K_sk_value)(s, n);
1335 kdWarning() <<
"OPENSSL_sk_value not defined!" << endl;
1340 void KOpenSSLProxy::X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *v, STACK_OF(X509)* x) {
1341 if (K_X509_STORE_CTX_set0_untrusted) (K_X509_STORE_CTX_set0_untrusted)(v,x);
1342 else kdWarning() <<
"X509_STORE_CTX_set0_untrusted not defined!" << endl;
1345 void KOpenSSLProxy::X509_STORE_CTX_set_purpose(X509_STORE_CTX *v,
int purpose) {
1346 if (K_X509_STORE_CTX_set_purpose) (K_X509_STORE_CTX_set_purpose)(v,purpose);
1347 else kdWarning() <<
"X509_STORE_CTX_set_purpose not defined!" << endl;
1351 STACK* KOpenSSLProxy::OPENSSL_sk_dup(
const STACK *s) {
1352 if (K_sk_dup)
return (K_sk_dup)(s);
1353 kdWarning() <<
"OPENSSL_sk_dup not defined!" << endl;
1358 STACK* KOpenSSLProxy::OPENSSL_sk_new(
int (*cmp)()) {
1359 if (K_sk_new)
return (K_sk_new)(cmp);
1360 kdWarning() <<
"OPENSSL_sk_new not defined!" << endl;
1365 int KOpenSSLProxy::OPENSSL_sk_push(STACK* s,
char* d) {
1366 if (K_sk_push)
return (K_sk_push)(s,d);
1367 kdWarning() <<
"OPENSSL_sk_push not defined!" << endl;
1372 char *KOpenSSLProxy::i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint) {
1373 if (K_i2s_ASN1_INTEGER)
return (K_i2s_ASN1_INTEGER)(meth, aint);
1374 kdWarning() <<
"i2s_ANS1_INTEGER not defined!" << endl;
1379 ASN1_INTEGER *KOpenSSLProxy::X509_get_serialNumber(X509 *x) {
1380 if (K_X509_get_serialNumber)
return (K_X509_get_serialNumber)(x);
1381 kdWarning() <<
"X509_get_serialNumber not defined!" << endl;
1386 EVP_PKEY *KOpenSSLProxy::X509_get_pubkey(X509 *x) {
1387 if (K_X509_get_pubkey)
return (K_X509_get_pubkey)(x);
1388 kdWarning() <<
"X59_get_pubkey not defined!" << endl;
1393 int KOpenSSLProxy::i2d_PublicKey(EVP_PKEY *a,
unsigned char **pp) {
1394 if (K_i2d_PublicKey)
return (K_i2d_PublicKey)(a,pp);
1395 kdWarning() <<
"i2d_PublicKey not defined!" << endl;
1400 int KOpenSSLProxy::X509_check_private_key(X509 *x, EVP_PKEY *p) {
1401 if (K_X509_check_private_key)
return (K_X509_check_private_key)(x,p);
1402 kdWarning() <<
"X509_check_private_key not defined!" << endl;
1407 char *KOpenSSLProxy::BN_bn2hex(
const BIGNUM *a) {
1408 if (K_BN_bn2hex)
return (K_BN_bn2hex)(a);
1409 kdWarning() <<
"BN_bn2hex not defined!" << endl;
1414 int KOpenSSLProxy::X509_digest(
const X509 *x,
const EVP_MD *t,
unsigned char *md,
unsigned int *len) {
1415 if (K_X509_digest)
return (K_X509_digest)(x, t, md, len);
1416 kdWarning() <<
"X509_digest not defined!" << endl;
1421 EVP_MD *KOpenSSLProxy::EVP_md5() {
1422 if (K_EVP_md5)
return (K_EVP_md5)();
1423 kdWarning() <<
"EVP_md5 not defined!" << endl;
1428 void KOpenSSLProxy::ASN1_INTEGER_free(ASN1_INTEGER *a) {
1429 if (K_ASN1_INTEGER_free) (K_ASN1_INTEGER_free)(a);
1430 else kdWarning() <<
"ANS1_INTEGER_free not defined!" << endl;
1434 int KOpenSSLProxy::OBJ_obj2nid(ASN1_OBJECT *o) {
1435 if (K_OBJ_obj2nid)
return (K_OBJ_obj2nid)(o);
1436 kdWarning() <<
"OBJ_obj2nid not defined!" << endl;
1441 const char * KOpenSSLProxy::OBJ_nid2ln(
int n) {
1442 if (K_OBJ_nid2ln)
return (K_OBJ_nid2ln)(n);
1443 kdWarning() <<
"OBJ_nid2ln not defined!" << endl;
1448 int KOpenSSLProxy::X509_get_ext_count(X509 *x) {
1449 if (K_X509_get_ext_count)
return (K_X509_get_ext_count)(x);
1450 kdWarning() <<
"X509_get_ext_count not defined!" << endl;
1455 int KOpenSSLProxy::X509_get_ext_by_NID(X509 *x,
int nid,
int lastpos) {
1456 if (K_X509_get_ext_by_NID)
return (K_X509_get_ext_by_NID)(x,nid,lastpos);
1457 kdWarning() <<
"X509_get_ext_by_NID not defined!" << endl;
1462 int KOpenSSLProxy::X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,
int lastpos) {
1463 if (K_X509_get_ext_by_OBJ)
return (K_X509_get_ext_by_OBJ)(x,obj,lastpos);
1464 kdWarning() <<
"X509_get_ext_by_OBJ not defined!" << endl;
1469 X509_EXTENSION *KOpenSSLProxy::X509_get_ext(X509 *x,
int loc) {
1470 if (K_X509_get_ext)
return (K_X509_get_ext)(x,loc);
1471 kdWarning() <<
"X509_get_ext not defined!" << endl;
1476 X509_EXTENSION *KOpenSSLProxy::X509_delete_ext(X509 *x,
int loc) {
1477 if (K_X509_delete_ext)
return (K_X509_delete_ext)(x,loc);
1478 kdWarning() <<
"X509_delete_ext not defined!" << endl;
1483 int KOpenSSLProxy::X509_add_ext(X509 *x, X509_EXTENSION *ex,
int loc) {
1484 if (K_X509_add_ext)
return (K_X509_add_ext)(x,ex,loc);
1485 kdWarning() <<
"X509_add_ext not defined!" << endl;
1490 void *KOpenSSLProxy::X509_get_ext_d2i(X509 *x,
int nid,
int *crit,
int *idx) {
1491 if (K_X509_get_ext_d2i)
return (K_X509_get_ext_d2i)(x,nid,crit,idx);
1492 kdWarning() <<
"X509_get_ext_d2i not defined!" << endl;
1497 char *KOpenSSLProxy::i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5) {
1498 if (K_i2s_ASN1_OCTET_STRING)
return (K_i2s_ASN1_OCTET_STRING)(method,ia5);
1499 kdWarning() <<
"i2s_ANS1_OCTET_STRING not defined!" << endl;
1504 int KOpenSSLProxy::ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a,
int n) {
1505 if (K_ASN1_BIT_STRING_get_bit)
return (K_ASN1_BIT_STRING_get_bit)(a,n);
1506 kdWarning() <<
"ANS1_BIT_STRING_get_bit not defined!" << endl;
1511 PKCS7 *KOpenSSLProxy::PKCS7_new(
void) {
1512 if (K_PKCS7_new)
return (K_PKCS7_new)();
1513 kdWarning() <<
"PKCS7_new not defined!" << endl;
1518 void KOpenSSLProxy::PKCS7_free(PKCS7 *a) {
1519 if (K_PKCS7_free) (K_PKCS7_free)(a);
1520 else kdWarning() <<
"PKCS7_free not defined!" << endl;
1524 void KOpenSSLProxy::PKCS7_content_free(PKCS7 *a) {
1525 if (K_PKCS7_content_free) (K_PKCS7_content_free)(a);
1526 else kdWarning() <<
"PKCS7_content_free not defined!" << endl;
1530 int KOpenSSLProxy::i2d_PKCS7(PKCS7 *a,
unsigned char **pp) {
1531 if (K_i2d_PKCS7)
return (K_i2d_PKCS7)(a,pp);
1532 kdWarning() <<
"i2d_PKCS7 not defined!" << endl;
1537 PKCS7 *KOpenSSLProxy::d2i_PKCS7(PKCS7 **a,
unsigned char **pp,
long length) {
1538 if (K_d2i_PKCS7)
return (K_d2i_PKCS7)(a,pp,length);
1539 kdWarning() <<
"d2i_PKCS7 not defined!" << endl;
1544 int KOpenSSLProxy::i2d_PKCS7_fp(FILE *fp,PKCS7 *p7) {
1545 if (K_i2d_PKCS7_fp)
return (K_i2d_PKCS7_fp)(fp,p7);
1546 kdWarning() <<
"i2d_PKCS7_fd not defined!" << endl;
1551 PKCS7 *KOpenSSLProxy::d2i_PKCS7_fp(FILE *fp,PKCS7 **p7) {
1552 if (K_d2i_PKCS7_fp)
return (K_d2i_PKCS7_fp)(fp,p7);
1553 kdWarning() <<
"d2i_PKCS7_fp not defined!" << endl;
1558 int KOpenSSLProxy::i2d_PKCS7_bio(BIO *bp,PKCS7 *p7) {
1559 if (K_i2d_PKCS7_bio)
return (K_i2d_PKCS7_bio)(bp, p7);
1560 kdWarning() <<
"i2d_PKCS7_bio not defined!" << endl;
1565 PKCS7 *KOpenSSLProxy::d2i_PKCS7_bio(BIO *bp,PKCS7 **p7) {
1566 if (K_d2i_PKCS7_bio)
return (K_d2i_PKCS7_bio)(bp, p7);
1567 kdWarning() <<
"d2i_PKCS7_bio not defined!" << endl;
1572 PKCS7 *KOpenSSLProxy::PKCS7_dup(PKCS7 *p7) {
1573 if (K_PKCS7_dup)
return (K_PKCS7_dup)(p7);
1574 kdWarning() <<
"PKCS7_dup not defined!" << endl;
1579 PKCS7 *KOpenSSLProxy::PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
1580 BIO *data,
int flags) {
1581 if (K_PKCS7_sign)
return (K_PKCS7_sign)(signcert,pkey,certs,data,flags);
1582 kdWarning() <<
"PKCS7_sign not defined!" << endl;
1587 int KOpenSSLProxy::PKCS7_verify(PKCS7* p, STACK_OF(X509)* st, X509_STORE* s, BIO* in, BIO *out,
int flags) {
1588 if (K_PKCS7_verify)
return (K_PKCS7_verify)(p,st,s,in,out,flags);
1589 kdWarning() <<
"PKCS7_verify not defined!" << endl;
1594 STACK_OF(X509) *KOpenSSLProxy::PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
int flags) {
1595 if (K_PKCS7_get0_signers)
return (K_PKCS7_get0_signers)(p7,certs,flags);
1596 kdWarning() <<
"PKCS7_get0_signers not defined!" << endl;
1601 PKCS7 *KOpenSSLProxy::PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, EVP_CIPHER *cipher,
1603 if (K_PKCS7_encrypt)
return (K_PKCS7_encrypt)(certs,in,cipher,flags);
1604 kdWarning() <<
"PKCS7_encrypt not defined!" << endl;
1609 int KOpenSSLProxy::PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
int flags) {
1610 if (K_PKCS7_decrypt)
return (K_PKCS7_decrypt)(p7,pkey,cert,data,flags);
1611 kdWarning() <<
"PKCS7_decrypt not defined!" << endl;
1616 STACK_OF(X509_NAME) *KOpenSSLProxy::SSL_load_client_CA_file(
const char *file) {
1617 if (K_SSL_load_client_CA_file)
return (K_SSL_load_client_CA_file)(file);
1618 kdWarning() <<
"SSL_load_client_CA_file not defined!" << endl;
1623 STACK_OF(X509_INFO) *KOpenSSLProxy::PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
void *u) {
1624 if (K_PEM_X509_INFO_read)
return (K_PEM_X509_INFO_read)(fp,sk,cb,u);
1625 kdWarning() <<
"PEM_X509_INFO_read not defined!" << endl;
1630 X509 *KOpenSSLProxy::X509_d2i_fp(FILE *out, X509** buf) {
1631 if (K_ASN1_d2i_fp)
return reinterpret_cast<X509 *
>((K_ASN1_d2i_fp)(
reinterpret_cast<char *(*)()
>(K_X509_new),
reinterpret_cast<char *(*)()
>(K_d2i_X509), out,
reinterpret_cast<unsigned char **
>(buf)));
1632 kdWarning() <<
"X509_d2i_fp not defined!" << endl;
1637 int KOpenSSLProxy::SSL_peek(SSL *ssl,
void *buf,
int num) {
1638 if (K_SSL_peek)
return (K_SSL_peek)(ssl,buf,num);
1639 kdWarning() <<
"SSL_peek not defined!" << endl;
1644 const char *KOpenSSLProxy::RAND_file_name(
char *buf,
size_t num) {
1645 if (K_RAND_file_name)
return (K_RAND_file_name)(buf, num);
1646 kdWarning() <<
"RAND_file_name not defined!" << endl;
1651 int KOpenSSLProxy::RAND_load_file(
const char *filename,
long max_bytes) {
1652 if (K_RAND_load_file)
return (K_RAND_load_file)(filename, max_bytes);
1653 kdWarning() <<
"REND_load_file not defined!" << endl;
1658 int KOpenSSLProxy::RAND_write_file(
const char *filename) {
1659 if (K_RAND_write_file)
return (K_RAND_write_file)(filename);
1660 kdWarning() <<
"RAND_write_file not defined!" << endl;
1665 int KOpenSSLProxy::X509_PURPOSE_get_count() {
1666 if (K_X509_PURPOSE_get_count)
return (K_X509_PURPOSE_get_count)();
1667 kdWarning() <<
"X509_PURPOSE_get_count not defined!" << endl;
1672 int KOpenSSLProxy::X509_PURPOSE_get_id(X509_PURPOSE *p) {
1673 if (K_X509_PURPOSE_get_id)
return (K_X509_PURPOSE_get_id)(p);
1674 kdWarning() <<
"X509_PURPOSE_get_id not defined!" << endl;
1679 int KOpenSSLProxy::X509_check_purpose(X509 *x,
int id,
int ca) {
1680 if (K_X509_check_purpose)
return (K_X509_check_purpose)(x, id, ca);
1681 kdWarning() <<
"X509_check_purpose not defined!" << endl;
1686 X509_PURPOSE *KOpenSSLProxy::X509_PURPOSE_get0(
int idx) {
1687 if (K_X509_PURPOSE_get0)
return (K_X509_PURPOSE_get0)(idx);
1688 kdWarning() <<
"X509_PURPOSE_get0 not defined!" << endl;
1693 int KOpenSSLProxy::EVP_PKEY_assign(EVP_PKEY *pkey,
int type,
char *key) {
1694 if (K_EVP_PKEY_assign)
return (K_EVP_PKEY_assign)(pkey, type, key);
1695 kdWarning() <<
"EVP_PKEY_assign not defined!" << endl;
1700 int KOpenSSLProxy::X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey) {
1701 if (K_X509_REQ_set_pubkey)
return (K_X509_REQ_set_pubkey)(x, pkey);
1702 kdWarning() <<
"X509_REQ_set_pubkey not defined!" << endl;
1707 void KOpenSSLProxy::RSA_get0_key(
const RSA *r,
1708 const BIGNUM **n,
const BIGNUM **e,
const BIGNUM **d) {
1709 if (K_RSA_get0_key) {
1710 (K_RSA_get0_key)(r, n, e, d);
1713 kdWarning() <<
"REG_get0_key not defined!" << endl;
1717 RSA* KOpenSSLProxy::RSA_generate_key(
int bits,
unsigned long e,
void
1718 (*callback)(
int,
int,
void *),
void *cb_arg) {
1719 if (K_RSA_generate_key)
return (K_RSA_generate_key)(bits, e, callback, cb_arg);
1720 kdWarning() <<
"RSA_generate_key not defined!" << endl;
1725 void KOpenSSLProxy::DSA_get0_pqg(
const DSA *d,
1726 const BIGNUM **p,
const BIGNUM **q,
const BIGNUM **g) {
1727 if (K_DSA_get0_pqg) {
1728 (K_DSA_get0_pqg)(d, p, q, g);
1731 kdWarning() <<
"DSA_get0_pqg not defined!" << endl;
1735 void KOpenSSLProxy::DSA_get0_key(
const DSA *d,
1736 const BIGNUM **pub_key,
const BIGNUM **priv_key) {
1737 if (K_DSA_get0_key) {
1738 (K_DSA_get0_key)(d, pub_key, priv_key);
1741 kdWarning() <<
"DSA_get0_key not defined!" << endl;
1745 STACK *KOpenSSLProxy::X509_get1_email(X509 *x) {
1746 if (K_X509_get1_email)
return (K_X509_get1_email)(x);
1747 kdWarning() <<
"X509_get1_email not defined!" << endl;
1751 void KOpenSSLProxy::X509_email_free(STACK *sk) {
1752 if (K_X509_email_free) (K_X509_email_free)(sk);
1753 else kdWarning() <<
"X509_email_free not defined!" << endl;
1756 EVP_CIPHER *KOpenSSLProxy::EVP_des_ede3_cbc() {
1757 if (K_EVP_des_ede3_cbc)
return (K_EVP_des_ede3_cbc)();
1758 kdWarning() <<
"EVM_des_ede3_cbc not defined!" << endl;
1762 EVP_CIPHER *KOpenSSLProxy::EVP_des_cbc() {
1763 if (K_EVP_des_cbc)
return (K_EVP_des_cbc)();
1764 kdWarning() <<
"EVP_des_cbc not defined!" << endl;
1768 EVP_CIPHER *KOpenSSLProxy::EVP_rc2_cbc() {
1769 if (K_EVP_rc2_cbc)
return (K_EVP_rc2_cbc)();
1770 kdWarning() <<
"EVP_rc2_cbc not defined!" << endl;
1774 EVP_CIPHER *KOpenSSLProxy::EVP_rc2_64_cbc() {
1775 if (K_EVP_rc2_64_cbc)
return (K_EVP_rc2_64_cbc)();
1776 kdWarning() <<
"EVP_rc2_64_cbc not defined!" << endl;
1780 EVP_CIPHER *KOpenSSLProxy::EVP_rc2_40_cbc() {
1781 if (K_EVP_rc2_40_cbc)
return (K_EVP_rc2_40_cbc)();
1782 kdWarning() <<
"EVP_rc2_40_cbc not defined!" << endl;
1786 int KOpenSSLProxy::i2d_X509_REQ_fp(FILE *fp, X509_REQ *x) {
1787 if (K_i2d_X509_REQ_fp)
return (K_i2d_X509_REQ_fp)(fp,x);
1788 kdWarning() <<
"i2d_X509_REQ_fp not defined!" << endl;
1793 void KOpenSSLProxy::ERR_clear_error() {
1794 if (K_ERR_clear_error) (K_ERR_clear_error)();
1795 else kdWarning() <<
"ERR_clear_error not defined!" << endl;
1799 unsigned long KOpenSSLProxy::ERR_get_error() {
1800 if (K_ERR_get_error)
return (K_ERR_get_error)();
1801 kdWarning() <<
"ERR_get_error not defined!" << endl;
1806 void KOpenSSLProxy::ERR_print_errors_fp(FILE* fp) {
1807 if (K_ERR_print_errors_fp) (K_ERR_print_errors_fp)(fp);
1808 else kdWarning() <<
"ERR_print_errors_fp not defined!" << endl;
1812 SSL_SESSION *KOpenSSLProxy::SSL_get1_session(SSL *ssl) {
1813 if (K_SSL_get1_session)
return (K_SSL_get1_session)(ssl);
1814 kdWarning() <<
"SSL_get1_session not defined!" << endl;
1819 void KOpenSSLProxy::SSL_SESSION_free(SSL_SESSION *session) {
1820 if (K_SSL_SESSION_free) (K_SSL_SESSION_free)(session);
1821 else kdWarning() <<
"SSL_SESSION_free not defined!" << endl;
1825 int KOpenSSLProxy::SSL_set_session(SSL *ssl, SSL_SESSION *session) {
1826 if (K_SSL_set_session)
return (K_SSL_set_session)(ssl, session);
1827 kdWarning() <<
"SSL_set_session not defined!" << endl;
1832 SSL_SESSION *KOpenSSLProxy::d2i_SSL_SESSION(SSL_SESSION **a,
unsigned char **pp,
long length) {
1833 if (K_d2i_SSL_SESSION)
return (K_d2i_SSL_SESSION)(a, pp, length);
1834 kdWarning() <<
"d2i_SSL_SESSION not defined!" << endl;
1839 int KOpenSSLProxy::i2d_SSL_SESSION(SSL_SESSION *in,
unsigned char **pp) {
1840 if (K_i2d_SSL_SESSION)
return (K_i2d_SSL_SESSION)(in, pp);
1841 kdWarning() <<
"i2d_SSL_SESSION not defined!" << endl;
1846 int KOpenSSLProxy::i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *p) {
1847 if (K_i2d_PrivateKey_fp)
return (K_i2d_PrivateKey_fp)(fp, p);
1848 kdWarning() <<
"i2d_PrivateKey not defined!" << endl;
1853 int KOpenSSLProxy::i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *p,
const EVP_CIPHER *c,
char *k,
int klen, pem_password_cb *cb,
void *u) {
1854 if (K_i2d_PKCS8PrivateKey_fp)
return (K_i2d_PKCS8PrivateKey_fp)(fp, p, c, k, klen, cb, u);
1855 kdWarning() <<
"i2d_PKCS8PrivateKey_fp not defined!" << endl;
1860 void KOpenSSLProxy::RSA_free(RSA *rsa) {
1861 if (K_RSA_free) (K_RSA_free)(rsa);
1862 else kdWarning() <<
"RSA_free not defined!" << endl;
1866 EVP_CIPHER *KOpenSSLProxy::EVP_bf_cbc() {
1867 if (K_EVP_bf_cbc)
return (K_EVP_bf_cbc)();
1868 kdWarning() <<
"EVP_bf_cbc not defined!" << endl;
1873 int KOpenSSLProxy::X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey,
const EVP_MD *md) {
1874 if (K_X509_REQ_sign)
return (K_X509_REQ_sign)(x, pkey, md);
1875 kdWarning() <<
"X509_REQ_sign not defined!" << endl;
1880 int KOpenSSLProxy::X509_NAME_add_entry_by_txt(X509_NAME *name,
char *field,
1881 int type,
unsigned char *bytes,
int len,
int loc,
int set) {
1882 if (K_X509_NAME_add_entry_by_txt)
return (K_X509_NAME_add_entry_by_txt)(name, field, type, bytes, len, loc, set);
1883 kdWarning() <<
"X509_NAME_add_entry not defined!" << endl;
1888 X509_NAME *KOpenSSLProxy::X509_NAME_new() {
1889 if (K_X509_NAME_new)
return (K_X509_NAME_new)();
1890 kdWarning() <<
"X509_NAME_new not defined!" << endl;
1895 int KOpenSSLProxy::X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name) {
1896 if (K_X509_REQ_set_subject_name)
return (K_X509_REQ_set_subject_name)(req, name);
1897 kdWarning() <<
"X509_REQ_set_subject_name not defined!" << endl;
1902 unsigned char *KOpenSSLProxy::ASN1_STRING_data(ASN1_STRING *x) {
1903 if (K_ASN1_STRING_data)
return (K_ASN1_STRING_data)(x);
1904 kdWarning() <<
"ASN1_STRING_data not defined!" << endl;
1908 const unsigned char *KOpenSSLProxy::ASN1_STRING_get0_data(
const ASN1_STRING *x) {
1909 if (K_ASN1_STRING_get0_data)
return (K_ASN1_STRING_get0_data)(x);
1910 kdWarning() <<
"ASN1_STRING_get0_data not defined!" << endl;
1914 int KOpenSSLProxy::ASN1_STRING_length(
const ASN1_STRING *x) {
1915 if (K_ASN1_STRING_length)
return (K_ASN1_STRING_length)(x);
1916 kdWarning() <<
"ASN1_STRING_length not defined!" << endl;
1920 ASN1_OCTET_STRING *KOpenSSLProxy::ASN1_OCTET_STRING_new() {
1921 if (K_ASN1_OCTET_STRING_new)
return (K_ASN1_OCTET_STRING_new)();
1922 kdWarning() <<
"ASN1_OCTET_STRING_new not defined!" << endl;
1926 void KOpenSSLProxy::ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *x) {
1927 if (K_ASN1_OCTET_STRING_free) (K_ASN1_OCTET_STRING_free)(x);
1928 else kdWarning() <<
"ASN1_OCTET_STRING_free not defined!" << endl;
1931 int KOpenSSLProxy::ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str,
const unsigned char *data,
int len) {
1932 if (K_ASN1_OCTET_STRING_set)
return (K_ASN1_OCTET_STRING_set)(str, data, len);
1933 kdWarning() <<
"ASN1_OCTET_STRING_set not defined!" << endl;
1937 STACK_OF(SSL_CIPHER) *KOpenSSLProxy::SSL_get_ciphers(
const SSL* ssl) {
1938 if (K_SSL_get_ciphers)
return (K_SSL_get_ciphers)(ssl);
1939 kdWarning() <<
"SSL_get_ciphers not defined!" << endl;
1943 const ASN1_TIME* KOpenSSLProxy::X509_CRL_get0_lastUpdate(
const X509_CRL *crl) {
1944 if (K_X509_CRL_get0_lastUpdate)
return (K_X509_CRL_get0_lastUpdate)(crl);
1945 kdWarning() <<
"X509_CRL_get_lastUpdate not defined!" << endl;
1949 const ASN1_TIME* KOpenSSLProxy::X509_CRL_get0_nextUpdate(
const X509_CRL *crl) {
1950 if (K_X509_CRL_get0_nextUpdate)
return (K_X509_CRL_get0_nextUpdate)(crl);
1951 kdWarning() <<
"X509_CRL_get_nextUpdate not defined!" << endl;
1955 X509* KOpenSSLProxy::X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx) {
1956 if (K_X509_STORE_CTX_get_current_cert)
return (K_X509_STORE_CTX_get_current_cert)(ctx);
1957 kdWarning() <<
"X509_STORE_CTX_get_current_cert not defined!" << endl;
1961 int KOpenSSLProxy::X509_STORE_CTX_get_error(X509_STORE_CTX *ctx) {
1962 if (K_X509_STORE_CTX_get_error)
return (K_X509_STORE_CTX_get_error)(ctx);
1963 kdWarning() <<
"X509k_STORE_CTX_get_error not defined!" << endl;
1967 int KOpenSSLProxy::X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx) {
1968 if (K_X509_STORE_CTX_get_error_depth)
return (K_X509_STORE_CTX_get_error_depth)(ctx);
1969 kdWarning() <<
"X509_STORE_CTX_get_error_depth not defined!" << endl;
1973 void KOpenSSLProxy::X509_STORE_CTX_set_error(X509_STORE_CTX *ctx,
int s) {
1974 if (K_X509_STORE_CTX_set_error) {
1975 (K_X509_STORE_CTX_set_error)(ctx, s);
1978 kdWarning() <<
"X509_STORE_CTX_set_error not defined!" << endl;
1981 void KOpenSSLProxy::X509_STORE_set_verify_cb(X509_STORE *ctx,
1982 X509_STORE_CTX_verify_cb verify_cb) {
1983 if (K_X509_STORE_set_verify_cb) {
1984 (K_X509_STORE_set_verify_cb)(ctx, verify_cb);
1987 kdWarning() <<
"X590_STORE_set_verify_cb not defined!" << endl;
1990 STACK_OF(X509_OBJECT)* KOpenSSLProxy::X509_STORE_get0_objects(X509_STORE *v) {
1991 if (K_X509_STORE_get0_objects)
return (K_X509_STORE_get0_objects)(v);
1992 kdWarning() <<
"X509_STORE_get0_objects not defined!" << endl;
1996 X509_LOOKUP_TYPE KOpenSSLProxy::X509_OBJECT_get_type(
const X509_OBJECT *a) {
1997 if (K_X509_OBJECT_get_type)
return (K_X509_OBJECT_get_type)(a);
1998 kdWarning() <<
"X509_OBJECT_get_type not defined!" << endl;
1999 return X509_LU_NONE;
2002 X509* KOpenSSLProxy::X509_OBJECT_get0_X509(
const X509_OBJECT *a) {
2003 if (K_X509_OBJECT_get0_X509)
return (K_X509_OBJECT_get0_X509)(a);
2004 kdWarning() <<
"X509_OBJECT_get0_X509 not defined!" << endl;
2009 ASN1_TIME* KOpenSSLProxy::X509_getm_notAfter(
const X509 *x) {
2010 if (K_X509_getm_notAfter)
return (K_X509_getm_notAfter)(x);
2011 kdWarning() <<
"X509_get_notAfter not defined!" << endl;
2015 ASN1_TIME* KOpenSSLProxy::X509_getm_notBefore(
const X509 *x) {
2016 if (K_X509_getm_notBefore)
return (K_X509_getm_notBefore)(x);
2017 kdWarning() <<
"X509_get_notBefore not defined!" << endl;
2022 STACK* KOpenSSLProxy::sk_dup(
const STACK *s) {
2023 return OPENSSL_sk_dup(s);
2026 void KOpenSSLProxy::sk_free(STACK *s) {
2030 STACK* KOpenSSLProxy::sk_new(
int (*cmp)()) {
2031 return OPENSSL_sk_new(cmp);
2034 int KOpenSSLProxy::sk_num(STACK *s) {
2035 return OPENSSL_sk_num(s);
2038 char* KOpenSSLProxy::sk_pop(STACK *s) {
2039 return OPENSSL_sk_pop(s);
2042 int KOpenSSLProxy::sk_push(STACK *s,
char *d) {
2043 return OPENSSL_sk_push(s, d);
2046 char* KOpenSSLProxy::sk_value(STACK *s,
int n) {
2047 return OPENSSL_sk_value(s, n);
2050 void KOpenSSLProxy::X509_STORE_CTX_set_chain(X509_STORE_CTX *v, STACK_OF(X509)* x) {
2051 X509_STORE_CTX_set0_untrusted(v, x);
2054 SSL_METHOD* KOpenSSLProxy::SSLv23_client_method() {
2055 return TLS_client_method();
Dynamically load and wrap OpenSSL.
void destroy()
Destroy the class and start over - don't use this unless you know what you are doing.
bool hasLibSSL() const
Return true of libssl was found and loaded.
bool hasLibCrypto() const
Return true of libcrypto was found and loaded.
static KOpenSSLProxy * self()
Return an instance of class KOpenSSLProxy * You cannot delete this object.