22 #include <ksslconfig.h>
25 #include <openssl/opensslv.h>
32 #include <QtCore/QCoreApplication>
33 #include <QtCore/QFile>
34 #include <QtCore/QRegExp>
42 static int (*K_SSL_connect) (SSL *) = 0L;
43 static int (*K_SSL_accept) (SSL *) = 0L;
44 static int (*K_SSL_read) (SSL *,
void *, int) = 0L;
45 static int (*K_SSL_write) (SSL *,
const void *, int) = 0L;
46 static SSL *(*K_SSL_new) (SSL_CTX *) = 0L;
47 static void (*K_SSL_free) (SSL *) = 0L;
48 static int (*K_SSL_shutdown) (SSL *) = 0L;
49 static SSL_CTX *(*K_SSL_CTX_new)(SSL_METHOD *) = 0L;
50 static void (*K_SSL_CTX_free) (SSL_CTX *) = 0L;
51 static int (*K_SSL_set_fd) (SSL *, int) = 0L;
52 static int (*K_SSL_pending) (SSL *) = 0L;
53 static int (*K_SSL_peek) (SSL *,
void *, int) = 0L;
54 static int (*K_SSL_CTX_set_cipher_list)(SSL_CTX *,
const char *) = 0L;
55 static void (*K_SSL_CTX_set_verify)(SSL_CTX *, int,
56 int (*)(int, X509_STORE_CTX *)) = 0L;
57 static int (*K_SSL_use_certificate)(SSL *, X509 *) = 0L;
58 static SSL_CIPHER *(*K_SSL_get_current_cipher)(SSL *) = 0L;
59 static long (*K_SSL_ctrl) (SSL *,int, long,
char *) = 0L;
60 static int (*K_RAND_egd) (
const char *) = 0L;
61 static const char* (*K_RAND_file_name) (
char *, size_t) = 0L;
62 static int (*K_RAND_load_file) (
const char *, long) = 0L;
63 static int (*K_RAND_write_file) (
const char *) = 0L;
64 static SSL_METHOD * (*K_TLSv1_client_method) () = 0L;
65 static SSL_METHOD * (*K_SSLv23_client_method) () = 0L;
66 static X509 * (*K_SSL_get_peer_certificate) (SSL *) = 0L;
67 static int (*K_SSL_CIPHER_get_bits) (SSL_CIPHER *,
int *) = 0L;
68 static char * (*K_SSL_CIPHER_get_version) (SSL_CIPHER *) = 0L;
69 static const char * (*K_SSL_CIPHER_get_name) (SSL_CIPHER *) = 0L;
70 static char * (*K_SSL_CIPHER_description) (SSL_CIPHER *,
char *, int) = 0L;
71 static X509 * (*K_d2i_X509) (X509 **,
unsigned char **,long) = 0L;
72 static int (*K_i2d_X509) (X509 *,
unsigned char **) = 0L;
73 static int (*K_X509_cmp) (X509 *, X509 *) = 0L;
74 static void (*K_X509_STORE_CTX_free) (X509_STORE_CTX *) = 0L;
75 static int (*K_X509_verify_cert) (X509_STORE_CTX *) = 0L;
76 static X509_STORE_CTX *(*K_X509_STORE_CTX_new) (void) = 0L;
77 static void (*K_X509_STORE_free) (X509_STORE *) = 0L;
78 static X509_STORE *(*K_X509_STORE_new) (void) = 0L;
79 static void (*K_X509_free) (X509 *) = 0L;
80 static char *(*K_X509_NAME_oneline) (X509_NAME *,
char *,int) = 0L;
81 static X509_NAME *(*K_X509_get_subject_name) (X509 *) = 0L;
82 static X509_NAME *(*K_X509_get_issuer_name) (X509 *) = 0L;
83 static X509_LOOKUP *(*K_X509_STORE_add_lookup) (X509_STORE *, X509_LOOKUP_METHOD *) = 0L;
84 static X509_LOOKUP_METHOD *(*K_X509_LOOKUP_file)(void) = 0L;
85 static void (*K_X509_LOOKUP_free)(X509_LOOKUP *) = 0L;
86 static int (*K_X509_LOOKUP_ctrl)(X509_LOOKUP *, int,
const char *, long,
char **) = 0L;
87 static void (*K_X509_STORE_CTX_init)(X509_STORE_CTX *, X509_STORE *, X509 *,
STACK_OF(X509) *) = 0L;
88 static void (*K_CRYPTO_free) (
void *) = 0L;
89 static X509* (*K_X509_dup) (X509 *) = 0L;
90 static BIO_METHOD *(*K_BIO_s_mem) (void) = 0L;
91 static BIO* (*K_BIO_new) (BIO_METHOD *) = 0L;
92 static BIO* (*K_BIO_new_fp) (FILE *, int) = 0L;
93 static BIO* (*K_BIO_new_mem_buf) (
void *, int) = 0L;
94 static int (*K_BIO_free) (BIO *) = 0L;
95 static long (*K_BIO_ctrl) (BIO *,int,long,
void *) = 0L;
96 static int (*K_BIO_write) (BIO *b,
const void *data,
int len) = 0L;
97 static int (*K_PEM_ASN1_write_bio) (int (*)(),
const char *,BIO *,
char *,
98 const EVP_CIPHER *,
unsigned char *,
int ,
99 pem_password_cb *,
void *) = 0L;
100 static int (*K_ASN1_item_i2d_fp)(ASN1_ITEM *,FILE *,
unsigned char *) = 0L;
101 static ASN1_ITEM *K_NETSCAPE_X509_it = 0L;
102 static int (*K_X509_print_fp) (FILE *, X509*) = 0L;
103 static int (*K_i2d_PKCS12) (PKCS12*,
unsigned char**) = 0L;
104 static int (*K_i2d_PKCS12_fp) (FILE *, PKCS12*) = 0L;
105 static int (*K_PKCS12_newpass) (PKCS12*,
char*,
char*) = 0L;
106 static PKCS12* (*K_d2i_PKCS12_fp) (FILE*, PKCS12**) = 0L;
107 static PKCS12* (*K_PKCS12_new) (void) = 0L;
108 static void (*K_PKCS12_free) (PKCS12 *) = 0L;
109 static int (*K_PKCS12_parse) (PKCS12*,
const char *, EVP_PKEY**,
111 static void (*K_EVP_PKEY_free) (EVP_PKEY *) = 0L;
112 static EVP_PKEY* (*K_EVP_PKEY_new) () = 0L;
113 static void (*K_X509_REQ_free) (X509_REQ *) = 0L;
114 static X509_REQ* (*K_X509_REQ_new) () = 0L;
115 static int (*K_SSL_CTX_use_PrivateKey) (SSL_CTX*, EVP_PKEY*) = 0L;
116 static int (*K_SSL_CTX_use_certificate) (SSL_CTX*, X509*) = 0L;
117 static int (*K_SSL_get_error) (SSL*, int) = 0L;
118 static STACK_OF(X509)* (*K_SSL_get_peer_cert_chain) (SSL*) = 0L;
119 static void (*K_X509_STORE_CTX_set_chain) (X509_STORE_CTX *,
STACK_OF(X509)*) = 0L;
120 static void (*K_X509_STORE_CTX_set_purpose) (X509_STORE_CTX *, int) = 0L;
121 static void (*K_sk_free) (STACK*) = 0L;
122 static int (*K_sk_num) (STACK*) = 0L;
123 static char* (*K_sk_pop) (STACK*) = 0L;
124 static char* (*K_sk_value) (STACK*, int) = 0L;
125 static STACK* (*K_sk_new) (int (*)()) = 0L;
126 static int (*K_sk_push) (STACK*,
char*) = 0L;
127 static STACK* (*K_sk_dup) (STACK *) = 0L;
128 static char * (*K_i2s_ASN1_INTEGER) (X509V3_EXT_METHOD *, ASN1_INTEGER *) =0L;
129 static ASN1_INTEGER * (*K_X509_get_serialNumber) (X509 *) = 0L;
130 static EVP_PKEY *(*K_X509_get_pubkey)(X509 *) = 0L;
131 static int (*K_i2d_PublicKey)(EVP_PKEY *,
unsigned char **) = 0L;
132 static int (*K_X509_check_private_key)(X509 *, EVP_PKEY *) = 0L;
133 static char * (*K_BN_bn2hex)(
const BIGNUM *) = 0L;
134 static int (*K_X509_digest)(
const X509 *,
const EVP_MD *,
unsigned char *,
unsigned int *) = 0L;
135 static EVP_MD* (*K_EVP_md5)() = 0L;
136 static void (*K_ASN1_INTEGER_free)(ASN1_INTEGER *) = 0L;
137 static int (*K_OBJ_obj2nid)(ASN1_OBJECT *) = 0L;
138 static const char * (*K_OBJ_nid2ln)(int) = 0L;
139 static int (*K_X509_get_ext_count)(X509*) = 0L;
140 static int (*K_X509_get_ext_by_NID)(X509*, int, int) = 0L;
141 static int (*K_X509_get_ext_by_OBJ)(X509*,ASN1_OBJECT*,int) = 0L;
142 static X509_EXTENSION *(*K_X509_get_ext)(X509*,
int loc) = 0L;
143 static X509_EXTENSION *(*K_X509_delete_ext)(X509*, int) = 0L;
144 static int (*K_X509_add_ext)(X509*, X509_EXTENSION*, int) = 0L;
145 static void *(*K_X509_get_ext_d2i)(X509*, int,
int*,
int*) = 0L;
146 static char *(*K_i2s_ASN1_OCTET_STRING)(X509V3_EXT_METHOD*, ASN1_OCTET_STRING*) = 0L;
147 static int (*K_ASN1_BIT_STRING_get_bit)(ASN1_BIT_STRING*, int) = 0L;
148 static PKCS7 *(*K_PKCS7_new)() = 0L;
149 static void (*K_PKCS7_free)(PKCS7*) = 0L;
150 static void (*K_PKCS7_content_free)(PKCS7*) = 0L;
151 static int (*K_i2d_PKCS7)(PKCS7*,
unsigned char**) = 0L;
152 static PKCS7 *(*K_d2i_PKCS7)(PKCS7**,
unsigned char**,long) = 0L;
153 static int (*K_i2d_PKCS7_fp)(FILE*,PKCS7*) = 0L;
154 static PKCS7* (*K_d2i_PKCS7_fp)(FILE*,PKCS7**) = 0L;
155 static int (*K_i2d_PKCS7_bio)(BIO *bp,PKCS7 *p7) = 0L;
156 static PKCS7 *(*K_d2i_PKCS7_bio)(BIO *bp,PKCS7 **p7) = 0L;
157 static PKCS7* (*K_PKCS7_dup)(PKCS7*) = 0L;
158 static STACK_OF(X509_NAME) *(*K_SSL_load_client_CA_file)(
const char*) = 0L;
159 static STACK_OF(X509_INFO) *(*K_PEM_X509_INFO_read)(FILE*,
STACK_OF(X509_INFO)*, pem_password_cb*,
void*) = 0L;
160 static char *(*K_ASN1_d2i_fp)(
char *(*)(),
char *(*)(),FILE*,
unsigned char**) = 0L;
161 static X509 *(*K_X509_new)() = 0L;
162 static int (*K_X509_PURPOSE_get_count)() = 0L;
163 static int (*K_X509_PURPOSE_get_id)(X509_PURPOSE *) = 0L;
164 static int (*K_X509_check_purpose)(X509*,int,int) = 0L;
165 static X509_PURPOSE* (*K_X509_PURPOSE_get0)(int) = 0L;
166 static int (*K_EVP_PKEY_assign)(EVP_PKEY*, int,
char*) = 0L;
167 static int (*K_X509_REQ_set_pubkey)(X509_REQ*, EVP_PKEY*) = 0L;
168 static RSA *(*K_RSA_generate_key)(int,
unsigned long, void (*)(int,int,
void *),
void *) = 0L;
169 static int (*K_i2d_X509_REQ_fp)(FILE*, X509_REQ*) = 0L;
170 static void (*K_ERR_clear_error)() = 0L;
171 static unsigned long (*K_ERR_get_error)() = 0L;
172 static void (*K_ERR_print_errors_fp)(FILE*) = 0L;
173 static PKCS7 *(*K_PKCS7_sign)(X509*, EVP_PKEY*,
STACK_OF(X509)*, BIO*, int) = 0L;
174 static int (*K_PKCS7_verify)(PKCS7*,
STACK_OF(X509)*,X509_STORE*,BIO*,BIO*,int) = 0L;
175 static STACK_OF(X509) *(*K_PKCS7_get0_signers)(PKCS7 *,
STACK_OF(X509) *, int) = 0L;
176 static PKCS7 *(*K_PKCS7_encrypt)(
STACK_OF(X509) *, BIO *, EVP_CIPHER *, int) = 0L;
177 static int (*K_PKCS7_decrypt)(PKCS7 *, EVP_PKEY *, X509 *, BIO *, int) = 0L;
178 static SSL_SESSION* (*K_SSL_get1_session)(SSL*) = 0L;
179 static void (*K_SSL_SESSION_free)(SSL_SESSION*) = 0L;
180 static int (*K_SSL_set_session)(SSL*,SSL_SESSION*) = 0L;
181 static SSL_SESSION* (*K_d2i_SSL_SESSION)(SSL_SESSION**,
unsigned char**, long) = 0L;
182 static int (*K_i2d_SSL_SESSION)(SSL_SESSION*,
unsigned char**) = 0L;
183 static STACK *(*K_X509_get1_email)(X509 *x) = 0L;
184 static void (*K_X509_email_free)(STACK *sk) = 0L;
185 static EVP_CIPHER *(*K_EVP_des_ede3_cbc)() = 0L;
186 static EVP_CIPHER *(*K_EVP_des_cbc)() = 0L;
187 static EVP_CIPHER *(*K_EVP_rc2_cbc)() = 0L;
188 static EVP_CIPHER *(*K_EVP_rc2_64_cbc)() = 0L;
189 static EVP_CIPHER *(*K_EVP_rc2_40_cbc)() = 0L;
190 static int (*K_i2d_PrivateKey_fp)(FILE*,EVP_PKEY*) = 0L;
191 static int (*K_i2d_PKCS8PrivateKey_fp)(FILE*, EVP_PKEY*,
const EVP_CIPHER*,
char*, int, pem_password_cb*,
void*) = 0L;
192 static void (*K_RSA_free)(RSA*) = 0L;
193 static EVP_CIPHER *(*K_EVP_bf_cbc)() = 0L;
194 static int (*K_X509_REQ_sign)(X509_REQ*, EVP_PKEY*,
const EVP_MD*) = 0L;
195 static int (*K_X509_NAME_add_entry_by_txt)(X509_NAME*,
char*, int,
unsigned char*, int, int, int) = 0L;
196 static X509_NAME *(*K_X509_NAME_new)() = 0L;
197 static int (*K_X509_REQ_set_subject_name)(X509_REQ*,X509_NAME*) = 0L;
198 static unsigned char *(*K_ASN1_STRING_data)(ASN1_STRING*) = 0L;
199 static int (*K_ASN1_STRING_length)(ASN1_STRING*) = 0L;
200 static STACK_OF(SSL_CIPHER) *(*K_SSL_get_ciphers)(
const SSL *ssl) = 0L;
206 class KOpenSSLProxyPrivate
209 KOpenSSLProxyPrivate()
210 : sslLib(0), cryptoLib(0),
ok(false)
218 static void cleanupKOpenSSLProxy() {
219 delete KOpenSSLProxyPrivate::sSelf;
225 return d->sslLib != 0L;
230 return d->cryptoLib != 0L;
236 KOpenSSLProxyPrivate::sSelf = 0;
241 #include <QtCore/QDir>
242 #include <QtCore/QString>
243 #include <QtCore/QStringList>
248 QString filter =
"lib"+name+
".so.*";
259 uint s = filter.length()-1;
260 for (QStringList::const_iterator it = l.begin(); it != l.end(); ++it) {
261 QString numberpart = (*it).mid(s);
262 uint endmaj = numberpart.indexOf(
'.');
266 int maj = numberpart.left(endmaj).toInt(&ok);
269 int min = numberpart.mid(endmaj+1).toInt(&ok);
272 if (maj > bestmaj || (maj == bestmaj && min > bestmin)) {
285 KOpenSSLProxy::KOpenSSLProxy()
286 : d(new KOpenSSLProxyPrivate())
296 if (!upath.isEmpty())
300 d->cryptoLib =
new KLibrary(
"libeay32.dll");
301 if (!d->cryptoLib->load()) {
305 #elif defined(__OpenBSD__)
307 QString libname = findMostRecentLib(
"/usr/lib" KDELIBSUFF,
"crypto");
308 if (!libname.isNull()) {
309 d->cryptoLib =
new KLibrary(libname);
310 d->cryptoLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
311 if (!d->cryptoLib->load()) {
317 #elif defined(__CYGWIN__)
318 libpaths <<
"/usr/bin/"
321 libnamess <<
"cygssl-0.9.8.dll"
322 <<
"cygssl-0.9.7.dll"
325 libnamesc <<
"cygcrypto-0.9.8.dll"
326 <<
"cygcrypto-0.9.7.dll"
331 <<
"/opt/freeware/lib/"
333 <<
"/usr/lib" KDELIBSUFF
"/"
334 <<
"/usr/ssl/lib" KDELIBSUFF
"/"
335 <<
"/usr/local/lib" KDELIBSUFF
"/"
336 <<
"/usr/local/openssl/lib" KDELIBSUFF
"/"
337 <<
"/usr/local/ssl/lib" KDELIBSUFF
"/"
338 <<
"/opt/openssl/lib" KDELIBSUFF
"/"
339 <<
"/lib" KDELIBSUFF
"/"
347 <<
"libssl.a(libssl.so.0)"
348 #elif defined(__APPLE__)
350 <<
"libssl.0.9.dylib"
352 #ifdef SHLIB_VERSION_NUMBER
353 <<
"libssl.so." SHLIB_VERSION_NUMBER
364 <<
"libcrypto.a(libcrypto.so.0)"
365 #elif defined(__APPLE__)
367 <<
"libcrypto.0.9.dylib"
369 #ifdef SHLIB_VERSION_NUMBER
370 <<
"libcrypto.so." SHLIB_VERSION_NUMBER
378 for (QStringList::const_iterator it = libpaths.constBegin();
379 it != libpaths.constEnd();
381 for (QStringList::const_iterator shit = libnamesc.constBegin();
382 shit != libnamesc.constEnd();
385 if (!alib.isEmpty() && !alib.endsWith(
'/'))
389 QString tmpStr(alib.toLatin1().constData());
390 tmpStr.remove(QRegExp(
"\\(.*\\)"));
391 if (!
access(tmpStr.toLatin1(), R_OK)) {
393 d->cryptoLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
395 if (d->cryptoLib && d->cryptoLib->load()) {
403 if (d->cryptoLib)
break;
408 K_X509_free = (void (*) (X509 *)) d->cryptoLib->resolveFunction(
"X509_free");
409 K_RAND_egd = (int (*)(
const char *)) d->cryptoLib->resolveFunction(
"RAND_egd");
410 K_RAND_load_file = (int (*)(
const char *, long)) d->cryptoLib->resolveFunction(
"RAND_load_file");
411 K_RAND_file_name = (
const char* (*)(
char *, size_t)) d->cryptoLib->resolveFunction(
"RAND_file_name");
412 K_RAND_write_file = (int (*)(
const char *)) d->cryptoLib->resolveFunction(
"RAND_write_file");
413 K_CRYPTO_free = (void (*) (
void *)) d->cryptoLib->resolveFunction(
"CRYPTO_free");
414 K_d2i_X509 = (X509 * (*)(X509 **,
unsigned char **,long)) d->cryptoLib->resolveFunction(
"d2i_X509");
415 K_i2d_X509 = (int (*)(X509 *,
unsigned char **)) d->cryptoLib->resolveFunction(
"i2d_X509");
416 K_X509_cmp = (int (*)(X509 *, X509 *)) d->cryptoLib->resolveFunction(
"X509_cmp");
417 K_X509_STORE_CTX_new = (X509_STORE_CTX * (*) (void)) d->cryptoLib->resolveFunction(
"X509_STORE_CTX_new");
418 K_X509_STORE_CTX_free = (void (*) (X509_STORE_CTX *)) d->cryptoLib->resolveFunction(
"X509_STORE_CTX_free");
419 K_X509_verify_cert = (int (*) (X509_STORE_CTX *)) d->cryptoLib->resolveFunction(
"X509_verify_cert");
420 K_X509_STORE_new = (X509_STORE * (*) (void)) d->cryptoLib->resolveFunction(
"X509_STORE_new");
421 K_X509_STORE_free = (void (*) (X509_STORE *)) d->cryptoLib->resolveFunction(
"X509_STORE_free");
422 K_X509_NAME_oneline = (
char * (*) (X509_NAME *,
char *,int)) d->cryptoLib->resolveFunction(
"X509_NAME_oneline");
423 K_X509_get_subject_name = (X509_NAME * (*) (X509 *)) d->cryptoLib->resolveFunction(
"X509_get_subject_name");
424 K_X509_get_issuer_name = (X509_NAME * (*) (X509 *)) d->cryptoLib->resolveFunction(
"X509_get_issuer_name");
425 K_X509_STORE_add_lookup = (X509_LOOKUP *(*) (X509_STORE *, X509_LOOKUP_METHOD *)) d->cryptoLib->resolveFunction(
"X509_STORE_add_lookup");
426 K_X509_LOOKUP_file = (X509_LOOKUP_METHOD *(*)(void)) d->cryptoLib->resolveFunction(
"X509_LOOKUP_file");
427 K_X509_LOOKUP_free = (void (*)(X509_LOOKUP *)) d->cryptoLib->resolveFunction(
"X509_LOOKUP_free");
428 K_X509_LOOKUP_ctrl = (int (*)(X509_LOOKUP *, int,
const char *, long,
char **)) d->cryptoLib->resolveFunction(
"X509_LOOKUP_ctrl");
429 K_X509_STORE_CTX_init = (void (*)(X509_STORE_CTX *, X509_STORE *, X509 *,
STACK_OF(X509) *)) d->cryptoLib->resolveFunction(
"X509_STORE_CTX_init");
430 K_X509_dup = (X509* (*)(X509*)) d->cryptoLib->resolveFunction(
"X509_dup");
431 K_BIO_s_mem = (BIO_METHOD *(*) (void)) d->cryptoLib->resolveFunction(
"BIO_s_mem");
432 K_BIO_new = (BIO* (*)(BIO_METHOD *)) d->cryptoLib->resolveFunction(
"BIO_new");
433 K_BIO_new_fp = (BIO* (*)(FILE*, int)) d->cryptoLib->resolveFunction(
"BIO_new_fp");
434 K_BIO_new_mem_buf = (BIO* (*)(
void *, int)) d->cryptoLib->resolveFunction(
"BIO_new_mem_buf");
435 K_BIO_free = (int (*)(BIO*)) d->cryptoLib->resolveFunction(
"BIO_free");
436 K_BIO_ctrl = (long (*) (BIO *,int,long,
void *)) d->cryptoLib->resolveFunction(
"BIO_ctrl");
437 K_BIO_write = (int (*) (BIO *b,
const void *data,
int len)) d->cryptoLib->resolveFunction(
"BIO_write");
438 K_PEM_ASN1_write_bio = (int (*)(int (*)(),
const char *,BIO*,
char*,
const EVP_CIPHER *,
unsigned char *,
int, pem_password_cb *,
void *)) d->cryptoLib->resolveFunction(
"PEM_ASN1_write_bio");
439 K_ASN1_item_i2d_fp = (int (*)(ASN1_ITEM *, FILE*,
unsigned char *))
440 d->cryptoLib->resolveFunction(
"ASN1_item_i2d_fp");
441 K_NETSCAPE_X509_it = (ASN1_ITEM *) d->cryptoLib->resolveFunction(
"NETSCAPE_X509_it");
442 K_X509_print_fp = (int (*)(FILE*, X509*)) d->cryptoLib->resolveFunction(
"X509_print_fp");
443 K_i2d_PKCS12 = (int (*)(PKCS12*,
unsigned char**)) d->cryptoLib->resolveFunction(
"i2d_PKCS12");
444 K_i2d_PKCS12_fp = (int (*)(FILE *, PKCS12*)) d->cryptoLib->resolveFunction(
"i2d_PKCS12_fp");
445 K_PKCS12_newpass = (int (*)(PKCS12*,
char*,
char*)) d->cryptoLib->resolveFunction(
"PKCS12_newpass");
446 K_d2i_PKCS12_fp = (PKCS12* (*)(FILE*, PKCS12**)) d->cryptoLib->resolveFunction(
"d2i_PKCS12_fp");
447 K_PKCS12_new = (PKCS12* (*)()) d->cryptoLib->resolveFunction(
"PKCS12_new");
448 K_PKCS12_free = (void (*)(PKCS12 *)) d->cryptoLib->resolveFunction(
"PKCS12_free");
449 K_PKCS12_parse = (int (*)(PKCS12*,
const char *, EVP_PKEY**,
450 X509**,
STACK_OF(X509)**)) d->cryptoLib->resolveFunction(
"PKCS12_parse");
451 K_EVP_PKEY_free = (void (*) (EVP_PKEY *)) d->cryptoLib->resolveFunction(
"EVP_PKEY_free");
452 K_EVP_PKEY_new = (EVP_PKEY* (*)()) d->cryptoLib->resolveFunction(
"EVP_PKEY_new");
453 K_X509_REQ_free = (void (*)(X509_REQ*)) d->cryptoLib->resolveFunction(
"X509_REQ_free");
454 K_X509_REQ_new = (X509_REQ* (*)()) d->cryptoLib->resolveFunction(
"X509_REQ_new");
455 K_X509_STORE_CTX_set_chain = (void (*)(X509_STORE_CTX *,
STACK_OF(X509)*)) d->cryptoLib->resolveFunction(
"X509_STORE_CTX_set_chain");
456 K_X509_STORE_CTX_set_purpose = (void (*)(X509_STORE_CTX *, int)) d->cryptoLib->resolveFunction(
"X509_STORE_CTX_set_purpose");
457 K_sk_free = (void (*) (STACK *)) d->cryptoLib->resolveFunction(
"sk_free");
458 K_sk_num = (int (*) (STACK *)) d->cryptoLib->resolveFunction(
"sk_num");
459 K_sk_pop = (
char* (*) (STACK *)) d->cryptoLib->resolveFunction(
"sk_pop");
460 K_sk_value = (
char* (*) (STACK *, int)) d->cryptoLib->resolveFunction(
"sk_value");
461 K_sk_new = (STACK* (*) (int (*)())) d->cryptoLib->resolveFunction(
"sk_new");
462 K_sk_push = (int (*) (STACK*,
char*)) d->cryptoLib->resolveFunction(
"sk_push");
463 K_sk_dup = (STACK* (*) (STACK *)) d->cryptoLib->resolveFunction(
"sk_dup");
464 K_i2s_ASN1_INTEGER = (
char *(*) (X509V3_EXT_METHOD *, ASN1_INTEGER *)) d->cryptoLib->resolveFunction(
"i2s_ASN1_INTEGER");
465 K_X509_get_serialNumber = (ASN1_INTEGER * (*) (X509 *)) d->cryptoLib->resolveFunction(
"X509_get_serialNumber");
466 K_X509_get_pubkey = (EVP_PKEY *(*)(X509 *)) d->cryptoLib->resolveFunction(
"X509_get_pubkey");
467 K_i2d_PublicKey = (int (*)(EVP_PKEY *,
unsigned char **)) d->cryptoLib->resolveFunction(
"i2d_PublicKey");
468 K_X509_check_private_key = (int (*)(X509 *, EVP_PKEY *)) d->cryptoLib->resolveFunction(
"X509_check_private_key");
469 K_BN_bn2hex = (
char *(*)(
const BIGNUM *)) d->cryptoLib->resolveFunction(
"BN_bn2hex");
470 K_X509_digest = (int (*)(
const X509 *,
const EVP_MD *,
unsigned char *,
unsigned int *)) d->cryptoLib->resolveFunction(
"X509_digest");
471 K_EVP_md5 = (EVP_MD *(*)()) d->cryptoLib->resolveFunction(
"EVP_md5");
472 K_ASN1_INTEGER_free = (void (*)(ASN1_INTEGER *)) d->cryptoLib->resolveFunction(
"ASN1_INTEGER_free");
473 K_OBJ_obj2nid = (int (*)(ASN1_OBJECT *)) d->cryptoLib->resolveFunction(
"OBJ_obj2nid");
474 K_OBJ_nid2ln = (
const char *(*)(int)) d->cryptoLib->resolveFunction(
"OBJ_nid2ln");
475 K_X509_get_ext_count = (int (*)(X509*)) d->cryptoLib->resolveFunction(
"X509_get_ext_count");
476 K_X509_get_ext_by_NID = (int (*)(X509*,int,int)) d->cryptoLib->resolveFunction(
"X509_get_ext_by_NID");
477 K_X509_get_ext_by_OBJ = (int (*)(X509*,ASN1_OBJECT*,int)) d->cryptoLib->resolveFunction(
"X509_get_ext_by_OBJ");
478 K_X509_get_ext = (X509_EXTENSION* (*)(X509*,int)) d->cryptoLib->resolveFunction(
"X509_get_ext");
479 K_X509_delete_ext = (X509_EXTENSION* (*)(X509*,int)) d->cryptoLib->resolveFunction(
"X509_delete_ext");
480 K_X509_add_ext = (int (*)(X509*,X509_EXTENSION*,int)) d->cryptoLib->resolveFunction(
"X509_add_ext");
481 K_X509_get_ext_d2i = (
void* (*)(X509*,int,
int*,
int*)) d->cryptoLib->resolveFunction(
"X509_get_ext_d2i");
482 K_i2s_ASN1_OCTET_STRING = (
char *(*)(X509V3_EXT_METHOD*,ASN1_OCTET_STRING*)) d->cryptoLib->resolveFunction(
"i2s_ASN1_OCTET_STRING");
483 K_ASN1_BIT_STRING_get_bit = (int (*)(ASN1_BIT_STRING*,int)) d->cryptoLib->resolveFunction(
"ASN1_BIT_STRING_get_bit");
484 K_PKCS7_new = (PKCS7 *(*)()) d->cryptoLib->resolveFunction(
"PKCS7_new");
485 K_PKCS7_free = (void (*)(PKCS7*)) d->cryptoLib->resolveFunction(
"PKCS7_free");
486 K_PKCS7_content_free = (void (*)(PKCS7*)) d->cryptoLib->resolveFunction(
"PKCS7_content_free");
487 K_i2d_PKCS7 = (int (*)(PKCS7*,
unsigned char**)) d->cryptoLib->resolveFunction(
"i2d_PKCS7");
488 K_i2d_PKCS7_fp = (int (*)(FILE*,PKCS7*)) d->cryptoLib->resolveFunction(
"i2d_PKCS7_fp");
489 K_i2d_PKCS7_bio = (int (*)(BIO *bp,PKCS7 *p7)) d->cryptoLib->resolveFunction(
"i2d_PKCS7_bio");
490 K_d2i_PKCS7 = (PKCS7* (*)(PKCS7**,
unsigned char**,long)) d->cryptoLib->resolveFunction(
"d2i_PKCS7");
491 K_d2i_PKCS7_fp = (PKCS7 *(*)(FILE *,PKCS7**)) d->cryptoLib->resolveFunction(
"d2i_PKCS7_fp");
492 K_d2i_PKCS7_bio = (PKCS7 *(*)(BIO *bp,PKCS7 **p7)) d->cryptoLib->resolveFunction(
"d2i_PKCS7_bio");
493 K_PKCS7_dup = (PKCS7* (*)(PKCS7*)) d->cryptoLib->resolveFunction(
"PKCS7_dup");
494 K_PKCS7_sign = (PKCS7 *(*)(X509*, EVP_PKEY*,
STACK_OF(X509)*, BIO*, int)) d->cryptoLib->resolveFunction(
"PKCS7_sign");
495 K_PKCS7_verify = (int (*)(PKCS7*,
STACK_OF(X509)*,X509_STORE*,BIO*,BIO*,int)) d->cryptoLib->resolveFunction(
"PKCS7_verify");
496 K_PKCS7_get0_signers = (
STACK_OF(X509) *(*)(PKCS7 *,
STACK_OF(X509) *, int)) d->cryptoLib->resolveFunction(
"PKCS7_get0_signers");
497 K_PKCS7_encrypt = (PKCS7* (*)(
STACK_OF(X509) *, BIO *, EVP_CIPHER *, int)) d->cryptoLib->resolveFunction(
"PKCS7_encrypt");
498 K_PKCS7_decrypt = (int (*)(PKCS7 *, EVP_PKEY *, X509 *, BIO *, int)) d->cryptoLib->resolveFunction(
"PKCS7_decrypt");
499 K_PEM_X509_INFO_read = (
STACK_OF(X509_INFO) *(*)(FILE*,
STACK_OF(X509_INFO)*, pem_password_cb*,
void *)) d->cryptoLib->resolveFunction(
"PEM_X509_INFO_read");
500 K_ASN1_d2i_fp = (
char *(*)(
char *(*)(),
char *(*)(),FILE*,
unsigned char**)) d->cryptoLib->resolveFunction(
"ASN1_d2i_fp");
501 K_X509_new = (X509 *(*)()) d->cryptoLib->resolveFunction(
"X509_new");
502 K_X509_PURPOSE_get_count = (int (*)()) d->cryptoLib->resolveFunction(
"X509_PURPOSE_get_count");
503 K_X509_PURPOSE_get_id = (int (*)(X509_PURPOSE *)) d->cryptoLib->resolveFunction(
"X509_PURPOSE_get_id");
504 K_X509_check_purpose = (int (*)(X509*,int,int)) d->cryptoLib->resolveFunction(
"X509_check_purpose");
505 K_X509_PURPOSE_get0 = (X509_PURPOSE *(*)(int)) d->cryptoLib->resolveFunction(
"X509_PURPOSE_get0");
506 K_EVP_PKEY_assign = (int (*)(EVP_PKEY*, int,
char*)) d->cryptoLib->resolveFunction(
"EVP_PKEY_assign");
507 K_X509_REQ_set_pubkey = (int (*)(X509_REQ*, EVP_PKEY*)) d->cryptoLib->resolveFunction(
"X509_REQ_set_pubkey");
508 K_RSA_generate_key = (RSA* (*)(int,
unsigned long, void (*)(int,int,
void *),
void *)) d->cryptoLib->resolveFunction(
"RSA_generate_key");
509 K_i2d_X509_REQ_fp = (int (*)(FILE *, X509_REQ *)) d->cryptoLib->resolveFunction(
"i2d_X509_REQ_fp");
510 K_ERR_clear_error = (void (*)()) d->cryptoLib->resolveFunction(
"ERR_clear_error");
511 K_ERR_get_error = (
unsigned long (*)()) d->cryptoLib->resolveFunction(
"ERR_get_error");
512 K_ERR_print_errors_fp = (void (*)(FILE*)) d->cryptoLib->resolveFunction(
"ERR_print_errors_fp");
513 K_X509_get1_email = (STACK *(*)(X509 *x)) d->cryptoLib->resolveFunction(
"X509_get1_email");
514 K_X509_email_free = (void (*)(STACK *sk)) d->cryptoLib->resolveFunction(
"X509_email_free");
515 K_EVP_des_ede3_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction(
"EVP_des_ede3_cbc");
516 K_EVP_des_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction(
"EVP_des_cbc");
517 K_EVP_rc2_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction(
"EVP_rc2_cbc");
518 K_EVP_rc2_64_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction(
"EVP_rc2_64_cbc");
519 K_EVP_rc2_40_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction(
"EVP_rc2_40_cbc");
520 K_i2d_PrivateKey_fp = (int (*)(FILE*,EVP_PKEY*)) d->cryptoLib->resolveFunction(
"i2d_PrivateKey_fp");
521 K_i2d_PKCS8PrivateKey_fp = (int (*)(FILE*, EVP_PKEY*,
const EVP_CIPHER*,
char*, int, pem_password_cb*,
void*)) d->cryptoLib->resolveFunction(
"i2d_PKCS8PrivateKey_fp");
522 K_RSA_free = (void (*)(RSA*)) d->cryptoLib->resolveFunction(
"RSA_free");
523 K_EVP_bf_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction(
"EVP_bf_cbc");
524 K_X509_REQ_sign = (int (*)(X509_REQ*, EVP_PKEY*,
const EVP_MD*)) d->cryptoLib->resolveFunction(
"X509_REQ_sign");
525 K_X509_NAME_add_entry_by_txt = (int (*)(X509_NAME*,
char*, int,
unsigned char*, int, int, int)) d->cryptoLib->resolveFunction(
"X509_NAME_add_entry_by_txt");
526 K_X509_NAME_new = (X509_NAME *(*)()) d->cryptoLib->resolveFunction(
"X509_NAME_new");
527 K_X509_REQ_set_subject_name = (int (*)(X509_REQ*,X509_NAME*)) d->cryptoLib->resolveFunction(
"X509_REQ_set_subject_name");
528 K_ASN1_STRING_data = (
unsigned char *(*)(ASN1_STRING*)) d->cryptoLib->resolveFunction(
"ASN1_STRING_data");
529 K_ASN1_STRING_length = (int (*)(ASN1_STRING*)) d->cryptoLib->resolveFunction(
"ASN1_STRING_length");
534 d->sslLib =
new KLibrary(
"ssleay32.dll");
535 if (!d->sslLib->load()) {
539 #elif defined(__OpenBSD__)
541 QString libname = findMostRecentLib(
"/usr/lib",
"ssl");
542 if (!libname.isNull()) {
544 d->sslLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
545 if (!d->sslLib->load()) {
552 for (QStringList::const_iterator it = libpaths.constBegin();
553 it != libpaths.constEnd();
555 for (QStringList::const_iterator shit = libnamess.constBegin();
556 shit != libnamess.constEnd();
559 if (!alib.isEmpty() && !alib.endsWith(
'/'))
562 QString tmpStr(alib.toLatin1());
563 tmpStr.remove(QRegExp(
"\\(.*\\)"));
564 if (!
access(tmpStr.toLatin1(), R_OK)) {
566 d->sslLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
568 if (d->sslLib && d->sslLib->load()) {
576 if (d->sslLib)
break;
583 K_SSL_connect = (int (*)(SSL *)) d->sslLib->resolveFunction(
"SSL_connect");
584 K_SSL_accept = (int (*)(SSL *)) d->sslLib->resolveFunction(
"SSL_accept");
585 K_SSL_read = (int (*)(SSL *,
void *, int)) d->sslLib->resolveFunction(
"SSL_read");
586 K_SSL_write = (int (*)(SSL *,
const void *, int))
587 d->sslLib->resolveFunction(
"SSL_write");
588 K_SSL_new = (SSL* (*)(SSL_CTX *)) d->sslLib->resolveFunction(
"SSL_new");
589 K_SSL_free = (void (*)(SSL *)) d->sslLib->resolveFunction(
"SSL_free");
590 K_SSL_shutdown = (int (*)(SSL *)) d->sslLib->resolveFunction(
"SSL_shutdown");
591 K_SSL_CTX_new = (SSL_CTX* (*)(SSL_METHOD*)) d->sslLib->resolveFunction(
"SSL_CTX_new");
592 K_SSL_CTX_free = (void (*)(SSL_CTX*)) d->sslLib->resolveFunction(
"SSL_CTX_free");
593 K_SSL_set_fd = (int (*)(SSL *, int)) d->sslLib->resolveFunction(
"SSL_set_fd");
594 K_SSL_pending = (int (*)(SSL *)) d->sslLib->resolveFunction(
"SSL_pending");
595 K_SSL_CTX_set_cipher_list = (int (*)(SSL_CTX *,
const char *))
596 d->sslLib->resolveFunction(
"SSL_CTX_set_cipher_list");
597 K_SSL_CTX_set_verify = (void (*)(SSL_CTX*, int, int (*)(int, X509_STORE_CTX*))) d->sslLib->resolveFunction(
"SSL_CTX_set_verify");
598 K_SSL_use_certificate = (int (*)(SSL*, X509*))
599 d->sslLib->resolveFunction(
"SSL_CTX_use_certificate");
600 K_SSL_get_current_cipher = (SSL_CIPHER *(*)(SSL *))
601 d->sslLib->resolveFunction(
"SSL_get_current_cipher");
602 K_SSL_ctrl = (long (*)(SSL * ,int, long,
char *))
603 d->sslLib->resolveFunction(
"SSL_ctrl");
604 K_TLSv1_client_method = (SSL_METHOD *(*)()) d->sslLib->resolveFunction(
"TLSv1_client_method");
605 K_SSLv23_client_method = (SSL_METHOD *(*)()) d->sslLib->resolveFunction(
"SSLv23_client_method");
606 K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) d->sslLib->resolveFunction(
"SSL_get_peer_certificate");
607 K_SSL_CIPHER_get_bits = (int (*)(SSL_CIPHER *,
int *)) d->sslLib->resolveFunction(
"SSL_CIPHER_get_bits");
608 K_SSL_CIPHER_get_version = (
char * (*)(SSL_CIPHER *)) d->sslLib->resolveFunction(
"SSL_CIPHER_get_version");
609 K_SSL_CIPHER_get_name = (
const char * (*)(SSL_CIPHER *)) d->sslLib->resolveFunction(
"SSL_CIPHER_get_name");
610 K_SSL_CIPHER_description = (
char * (*)(SSL_CIPHER *,
char *, int)) d->sslLib->resolveFunction(
"SSL_CIPHER_description");
611 K_SSL_CTX_use_PrivateKey = (int (*)(SSL_CTX*, EVP_PKEY*)) d->sslLib->resolveFunction(
"SSL_CTX_use_PrivateKey");
612 K_SSL_CTX_use_certificate = (int (*)(SSL_CTX*, X509*)) d->sslLib->resolveFunction(
"SSL_CTX_use_certificate");
613 K_SSL_get_error = (int (*)(SSL*, int)) d->sslLib->resolveFunction(
"SSL_get_error");
614 K_SSL_get_peer_cert_chain = (
STACK_OF(X509)* (*)(SSL*)) d->sslLib->resolveFunction(
"SSL_get_peer_cert_chain");
615 K_SSL_load_client_CA_file = (
STACK_OF(X509_NAME)* (*)(
const char *)) d->sslLib->resolveFunction(
"SSL_load_client_CA_file");
616 K_SSL_peek = (int (*)(SSL*,
void*,int)) d->sslLib->resolveFunction(
"SSL_peek");
617 K_SSL_get1_session = (SSL_SESSION* (*)(SSL*)) d->sslLib->resolveFunction(
"SSL_get1_session");
618 K_SSL_SESSION_free = (void (*)(SSL_SESSION*)) d->sslLib->resolveFunction(
"SSL_SESSION_free");
619 K_SSL_set_session = (int (*)(SSL*,SSL_SESSION*)) d->sslLib->resolveFunction(
"SSL_set_session");
620 K_d2i_SSL_SESSION = (SSL_SESSION* (*)(SSL_SESSION**,
unsigned char**, long)) d->sslLib->resolveFunction(
"d2i_SSL_SESSION");
621 K_i2d_SSL_SESSION = (int (*)(SSL_SESSION*,
unsigned char**)) d->sslLib->resolveFunction(
"i2d_SSL_SESSION");
622 K_SSL_get_ciphers = (
STACK_OF(SSL_CIPHER) *(*)(
const SSL*)) d->sslLib->resolveFunction(
"SSL_get_ciphers");
628 x = d->sslLib->resolveFunction(
"SSL_library_init");
630 if (x) ((int (*)())x)();
631 x = d->cryptoLib->resolveFunction(
"OpenSSL_add_all_algorithms");
633 x = d->cryptoLib->resolveFunction(
"OPENSSL_add_all_algorithms");
637 x = d->cryptoLib->resolveFunction(
"OpenSSL_add_all_algorithms_conf");
639 x = d->cryptoLib->resolveFunction(
"OPENSSL_add_all_algorithms_conf");
643 x = d->cryptoLib->resolveFunction(
"OpenSSL_add_all_algorithms_noconf");
645 x = d->cryptoLib->resolveFunction(
"OPENSSL_add_all_algorithms_noconf");
650 x = d->cryptoLib->resolveFunction(
"OpenSSL_add_all_ciphers");
652 x = d->cryptoLib->resolveFunction(
"OPENSSL_add_all_ciphers");
653 if (x) ((void (*)())x)();
654 x = d->cryptoLib->resolveFunction(
"OpenSSL_add_all_digests");
656 x = d->cryptoLib->resolveFunction(
"OPENSSL_add_all_digests");
657 if (x) ((void (*)())x)();
663 KOpenSSLProxy::~KOpenSSLProxy() {
668 d->cryptoLib->unload();
671 KOpenSSLProxyPrivate::sSelf = 0;
680 if(!KOpenSSLProxyPrivate::sSelf) {
682 qAddPostRoutine(KOpenSSLProxyPrivate::cleanupKOpenSSLProxy);
685 return KOpenSSLProxyPrivate::sSelf;
698 int KOpenSSLProxy::SSL_connect(SSL *ssl) {
699 if (K_SSL_connect)
return (K_SSL_connect)(ssl);
704 int KOpenSSLProxy::SSL_accept(SSL *ssl) {
705 if (K_SSL_accept)
return (K_SSL_accept)(ssl);
710 int KOpenSSLProxy::SSL_read(SSL *ssl,
void *buf,
int num) {
711 if (K_SSL_read)
return (K_SSL_read)(ssl, buf, num);
716 int KOpenSSLProxy::SSL_write(SSL *ssl,
const void *buf,
int num) {
717 if (K_SSL_write)
return (K_SSL_write)(ssl, buf, num);
722 SSL *KOpenSSLProxy::SSL_new(SSL_CTX *ctx) {
723 if (K_SSL_new)
return (K_SSL_new)(ctx);
728 void KOpenSSLProxy::SSL_free(SSL *ssl) {
729 if (K_SSL_free) (K_SSL_free)(ssl);
733 int KOpenSSLProxy::SSL_shutdown(SSL *ssl) {
734 if (K_SSL_shutdown)
return (K_SSL_shutdown)(ssl);
739 SSL_CTX *KOpenSSLProxy::SSL_CTX_new(SSL_METHOD *method) {
740 if (K_SSL_CTX_new)
return (K_SSL_CTX_new)(method);
745 void KOpenSSLProxy::SSL_CTX_free(SSL_CTX *ctx) {
746 if (K_SSL_CTX_free) (K_SSL_CTX_free)(ctx);
750 int KOpenSSLProxy::SSL_set_fd(SSL *ssl,
int fd) {
751 if (K_SSL_set_fd)
return (K_SSL_set_fd)(ssl, fd);
756 int KOpenSSLProxy::SSL_pending(SSL *ssl) {
757 if (K_SSL_pending)
return (K_SSL_pending)(ssl);
762 int KOpenSSLProxy::SSL_CTX_set_cipher_list(SSL_CTX *ctx,
const char *str) {
763 if (K_SSL_CTX_set_cipher_list)
return (K_SSL_CTX_set_cipher_list)(ctx, str);
768 void KOpenSSLProxy::SSL_CTX_set_verify(SSL_CTX *ctx,
int mode,
769 int (*verify_callback)(
int, X509_STORE_CTX *)) {
770 if (K_SSL_CTX_set_verify) (K_SSL_CTX_set_verify)(ctx, mode, verify_callback);
774 int KOpenSSLProxy::SSL_use_certificate(SSL *ssl, X509 *x) {
775 if (K_SSL_use_certificate)
return (K_SSL_use_certificate)(ssl, x);
780 SSL_CIPHER *KOpenSSLProxy::SSL_get_current_cipher(SSL *ssl) {
781 if (K_SSL_get_current_cipher)
return (K_SSL_get_current_cipher)(ssl);
786 long KOpenSSLProxy::SSL_ctrl(SSL *ssl,
int cmd,
long larg,
char *parg) {
787 if (K_SSL_ctrl)
return (K_SSL_ctrl)(ssl, cmd, larg, parg);
792 int KOpenSSLProxy::RAND_egd(
const char *path) {
793 if (K_RAND_egd)
return (K_RAND_egd)(path);
798 SSL_METHOD *KOpenSSLProxy::TLSv1_client_method() {
799 if (K_TLSv1_client_method)
return (K_TLSv1_client_method)();
804 SSL_METHOD *KOpenSSLProxy::SSLv23_client_method() {
805 if (K_SSLv23_client_method)
return (K_SSLv23_client_method)();
810 X509 *KOpenSSLProxy::SSL_get_peer_certificate(SSL *s) {
811 if (K_SSL_get_peer_certificate)
return (K_SSL_get_peer_certificate)(s);
816 int KOpenSSLProxy::SSL_CIPHER_get_bits(SSL_CIPHER *c,
int *alg_bits) {
817 if (K_SSL_CIPHER_get_bits)
return (K_SSL_CIPHER_get_bits)(c, alg_bits);
822 char * KOpenSSLProxy::SSL_CIPHER_get_version(SSL_CIPHER *c) {
823 if (K_SSL_CIPHER_get_version)
return (K_SSL_CIPHER_get_version)(c);
828 const char * KOpenSSLProxy::SSL_CIPHER_get_name(SSL_CIPHER *c) {
829 if (K_SSL_CIPHER_get_name)
return (K_SSL_CIPHER_get_name)(c);
834 char * KOpenSSLProxy::SSL_CIPHER_description(SSL_CIPHER *c,
char *buf,
int size) {
835 if (K_SSL_CIPHER_description)
return (K_SSL_CIPHER_description)(c,buf,size);
840 X509 * KOpenSSLProxy::d2i_X509(X509 **a,
unsigned char **pp,
long length) {
841 if (K_d2i_X509)
return (K_d2i_X509)(a,pp,length);
846 int KOpenSSLProxy::i2d_X509(X509 *a,
unsigned char **pp) {
847 if (K_i2d_X509)
return (K_i2d_X509)(a,pp);
852 int KOpenSSLProxy::X509_cmp(X509 *a, X509 *b) {
853 if (K_X509_cmp)
return (K_X509_cmp)(a,b);
858 X509_STORE *KOpenSSLProxy::X509_STORE_new(
void) {
859 if (K_X509_STORE_new)
return (K_X509_STORE_new)();
864 void KOpenSSLProxy::X509_STORE_free(X509_STORE *v) {
865 if (K_X509_STORE_free) (K_X509_STORE_free)(v);
869 X509_STORE_CTX *KOpenSSLProxy::X509_STORE_CTX_new(
void) {
870 if (K_X509_STORE_CTX_new)
return (K_X509_STORE_CTX_new)();
875 void KOpenSSLProxy::X509_STORE_CTX_free(X509_STORE_CTX *ctx) {
876 if (K_X509_STORE_CTX_free) (K_X509_STORE_CTX_free)(ctx);
880 int KOpenSSLProxy::X509_verify_cert(X509_STORE_CTX *ctx) {
881 if (K_X509_verify_cert)
return (K_X509_verify_cert)(ctx);
886 void KOpenSSLProxy::X509_free(X509 *a) {
887 if (K_X509_free) (K_X509_free)(a);
891 char *KOpenSSLProxy::X509_NAME_oneline(X509_NAME *a,
char *buf,
int size) {
892 if (K_X509_NAME_oneline)
return (K_X509_NAME_oneline)(a,buf,size);
897 X509_NAME *KOpenSSLProxy::X509_get_subject_name(X509 *a) {
898 if (K_X509_get_subject_name)
return (K_X509_get_subject_name)(a);
903 X509_NAME *KOpenSSLProxy::X509_get_issuer_name(X509 *a) {
904 if (K_X509_get_issuer_name)
return (K_X509_get_issuer_name)(a);
909 X509_LOOKUP *KOpenSSLProxy::X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) {
910 if (K_X509_STORE_add_lookup)
return (K_X509_STORE_add_lookup)(v,m);
915 X509_LOOKUP_METHOD *KOpenSSLProxy::X509_LOOKUP_file(
void) {
916 if (K_X509_LOOKUP_file)
return (K_X509_LOOKUP_file)();
921 void KOpenSSLProxy::X509_LOOKUP_free(X509_LOOKUP *x) {
922 if (K_X509_LOOKUP_free) (K_X509_LOOKUP_free)(x);
926 int KOpenSSLProxy::X509_LOOKUP_ctrl(X509_LOOKUP *ctx,
int cmd,
const char *argc,
long argl,
char **ret) {
927 if (K_X509_LOOKUP_ctrl)
return (K_X509_LOOKUP_ctrl)(ctx,cmd,argc,argl,ret);
932 void KOpenSSLProxy::X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
STACK_OF(X509) *chain) {
933 if (K_X509_STORE_CTX_init) (K_X509_STORE_CTX_init)(ctx,store,x509,chain);
937 void KOpenSSLProxy::CRYPTO_free(
void *x) {
938 if (K_CRYPTO_free) (K_CRYPTO_free)(x);
942 X509 *KOpenSSLProxy::X509_dup(X509 *x509) {
943 if (K_X509_dup)
return (K_X509_dup)(x509);
948 BIO *KOpenSSLProxy::BIO_new(BIO_METHOD *type) {
949 if (K_BIO_new)
return (K_BIO_new)(type);
954 BIO_METHOD *KOpenSSLProxy::BIO_s_mem(
void) {
955 if (K_BIO_s_mem)
return (K_BIO_s_mem)();
960 BIO *KOpenSSLProxy::BIO_new_fp(FILE *stream,
int close_flag) {
961 if (K_BIO_new_fp)
return (K_BIO_new_fp)(stream, close_flag);
966 BIO *KOpenSSLProxy::BIO_new_mem_buf(
void *buf,
int len) {
967 if (K_BIO_new_mem_buf)
return (K_BIO_new_mem_buf)(buf,len);
972 int KOpenSSLProxy::BIO_free(BIO *a) {
973 if (K_BIO_free)
return (K_BIO_free)(a);
979 if (K_BIO_ctrl)
return (K_BIO_ctrl)(bp,cmd,larg,parg);
984 int KOpenSSLProxy::BIO_write(BIO *b,
const void *data,
int len) {
985 if (K_BIO_write)
return (K_BIO_write)(b, data, len);
990 int KOpenSSLProxy::PEM_write_bio_X509(BIO *bp, X509 *x) {
991 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);
995 int KOpenSSLProxy::ASN1_item_i2d_fp(FILE *out,
unsigned char *x) {
996 if (K_ASN1_item_i2d_fp && K_NETSCAPE_X509_it)
997 return (K_ASN1_item_i2d_fp)(K_NETSCAPE_X509_it, out, x);
1002 int KOpenSSLProxy::X509_print(FILE *
fp, X509 *x) {
1003 if (K_X509_print_fp)
return (K_X509_print_fp)(
fp, x);
1008 PKCS12 *KOpenSSLProxy::d2i_PKCS12_fp(FILE *fp, PKCS12 **p12) {
1009 if (K_d2i_PKCS12_fp)
return (K_d2i_PKCS12_fp)(
fp, p12);
1014 int KOpenSSLProxy::PKCS12_newpass(PKCS12 *p12,
char *oldpass,
char *newpass) {
1015 if (K_PKCS12_newpass)
return (K_PKCS12_newpass)(p12, oldpass, newpass);
1020 int KOpenSSLProxy::i2d_PKCS12(PKCS12 *p12,
unsigned char **p) {
1021 if (K_i2d_PKCS12)
return (K_i2d_PKCS12)(p12, p);
1026 int KOpenSSLProxy::i2d_PKCS12_fp(FILE *fp, PKCS12 *p12) {
1027 if (K_i2d_PKCS12_fp)
return (K_i2d_PKCS12_fp)(
fp, p12);
1032 PKCS12 *KOpenSSLProxy::PKCS12_new(
void) {
1033 if (K_PKCS12_new)
return (K_PKCS12_new)();
1038 void KOpenSSLProxy::PKCS12_free(PKCS12 *a) {
1039 if (K_PKCS12_free) (K_PKCS12_free)(a);
1043 int KOpenSSLProxy::PKCS12_parse(PKCS12 *p12,
const char *pass, EVP_PKEY **pkey,
1044 X509 **cert,
STACK_OF(X509) **ca) {
1045 if (K_PKCS12_parse)
return (K_PKCS12_parse) (p12, pass, pkey, cert, ca);
1050 void KOpenSSLProxy::EVP_PKEY_free(EVP_PKEY *x) {
1051 if (K_EVP_PKEY_free) (K_EVP_PKEY_free)(x);
1055 EVP_PKEY* KOpenSSLProxy::EVP_PKEY_new() {
1056 if (K_EVP_PKEY_new)
return (K_EVP_PKEY_new)();
1061 void KOpenSSLProxy::X509_REQ_free(X509_REQ *x) {
1062 if (K_X509_REQ_free) (K_X509_REQ_free)(x);
1066 X509_REQ* KOpenSSLProxy::X509_REQ_new() {
1067 if (K_X509_REQ_new)
return (K_X509_REQ_new)();
1072 int KOpenSSLProxy::SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) {
1073 if (K_SSL_CTX_use_PrivateKey)
return (K_SSL_CTX_use_PrivateKey)(ctx,pkey);
1078 int KOpenSSLProxy::SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x) {
1079 if (K_SSL_CTX_use_certificate)
return (K_SSL_CTX_use_certificate)(ctx,x);
1084 int KOpenSSLProxy::SSL_get_error(SSL *ssl,
int rc) {
1085 if (K_SSL_get_error)
return (K_SSL_get_error)(ssl,rc);
1090 STACK_OF(X509) *KOpenSSLProxy::SSL_get_peer_cert_chain(SSL *s) {
1091 if (K_SSL_get_peer_cert_chain)
return (K_SSL_get_peer_cert_chain)(s);
1097 if (K_sk_free) (K_sk_free)(s);
1102 if (K_sk_num)
return (K_sk_num)(s);
1107 char *KOpenSSLProxy::sk_pop(STACK *s) {
1108 if (K_sk_pop)
return (K_sk_pop)(s);
1114 if (K_sk_value)
return (K_sk_value)(s, n);
1119 void KOpenSSLProxy::X509_STORE_CTX_set_chain(X509_STORE_CTX *v,
STACK_OF(X509)* x) {
1120 if (K_X509_STORE_CTX_set_chain) (K_X509_STORE_CTX_set_chain)(v,x);
1123 void KOpenSSLProxy::X509_STORE_CTX_set_purpose(X509_STORE_CTX *v,
int purpose) {
1124 if (K_X509_STORE_CTX_set_purpose) (K_X509_STORE_CTX_set_purpose)(v,purpose);
1129 if (K_sk_dup)
return (K_sk_dup)(s);
1135 if (K_sk_new)
return (K_sk_new)(cmp);
1141 if (K_sk_push)
return (K_sk_push)(s,d);
1146 char *KOpenSSLProxy::i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint) {
1147 if (K_i2s_ASN1_INTEGER)
return (K_i2s_ASN1_INTEGER)(meth, aint);
1152 ASN1_INTEGER *KOpenSSLProxy::X509_get_serialNumber(X509 *x) {
1153 if (K_X509_get_serialNumber)
return (K_X509_get_serialNumber)(x);
1158 EVP_PKEY *KOpenSSLProxy::X509_get_pubkey(X509 *x) {
1159 if (K_X509_get_pubkey)
return (K_X509_get_pubkey)(x);
1164 int KOpenSSLProxy::i2d_PublicKey(EVP_PKEY *a,
unsigned char **pp) {
1165 if (K_i2d_PublicKey)
return (K_i2d_PublicKey)(a,pp);
1170 int KOpenSSLProxy::X509_check_private_key(X509 *x, EVP_PKEY *p) {
1171 if (K_X509_check_private_key)
return (K_X509_check_private_key)(x,p);
1176 char *KOpenSSLProxy::BN_bn2hex(
const BIGNUM *a) {
1177 if (K_BN_bn2hex)
return (K_BN_bn2hex)(a);
1182 int KOpenSSLProxy::X509_digest(
const X509 *x,
const EVP_MD *t,
unsigned char *md,
unsigned int *len) {
1183 if (K_X509_digest)
return (K_X509_digest)(x, t, md, len);
1188 EVP_MD *KOpenSSLProxy::EVP_md5() {
1189 if (K_EVP_md5)
return (K_EVP_md5)();
1194 void KOpenSSLProxy::ASN1_INTEGER_free(ASN1_INTEGER *a) {
1195 if (K_ASN1_INTEGER_free) (K_ASN1_INTEGER_free)(a);
1199 int KOpenSSLProxy::OBJ_obj2nid(ASN1_OBJECT *o) {
1200 if (K_OBJ_obj2nid)
return (K_OBJ_obj2nid)(o);
1205 const char * KOpenSSLProxy::OBJ_nid2ln(
int n) {
1206 if (K_OBJ_nid2ln)
return (K_OBJ_nid2ln)(n);
1211 int KOpenSSLProxy::X509_get_ext_count(X509 *x) {
1212 if (K_X509_get_ext_count)
return (K_X509_get_ext_count)(x);
1217 int KOpenSSLProxy::X509_get_ext_by_NID(X509 *x,
int nid,
int lastpos) {
1218 if (K_X509_get_ext_by_NID)
return (K_X509_get_ext_by_NID)(x,nid,lastpos);
1223 int KOpenSSLProxy::X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,
int lastpos) {
1224 if (K_X509_get_ext_by_OBJ)
return (K_X509_get_ext_by_OBJ)(x,obj,lastpos);
1229 X509_EXTENSION *KOpenSSLProxy::X509_get_ext(X509 *x,
int loc) {
1230 if (K_X509_get_ext)
return (K_X509_get_ext)(x,loc);
1235 X509_EXTENSION *KOpenSSLProxy::X509_delete_ext(X509 *x,
int loc) {
1236 if (K_X509_delete_ext)
return (K_X509_delete_ext)(x,loc);
1241 int KOpenSSLProxy::X509_add_ext(X509 *x, X509_EXTENSION *ex,
int loc) {
1242 if (K_X509_add_ext)
return (K_X509_add_ext)(x,ex,loc);
1247 void *KOpenSSLProxy::X509_get_ext_d2i(X509 *x,
int nid,
int *crit,
int *idx) {
1248 if (K_X509_get_ext_d2i)
return (K_X509_get_ext_d2i)(x,nid,crit,idx);
1253 char *KOpenSSLProxy::i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5) {
1254 if (K_i2s_ASN1_OCTET_STRING)
return (K_i2s_ASN1_OCTET_STRING)(method,ia5);
1259 int KOpenSSLProxy::ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a,
int n) {
1260 if (K_ASN1_BIT_STRING_get_bit)
return (K_ASN1_BIT_STRING_get_bit)(a,n);
1265 PKCS7 *KOpenSSLProxy::PKCS7_new(
void) {
1266 if (K_PKCS7_new)
return (K_PKCS7_new)();
1271 void KOpenSSLProxy::PKCS7_free(PKCS7 *a) {
1272 if (K_PKCS7_free) (K_PKCS7_free)(a);
1276 void KOpenSSLProxy::PKCS7_content_free(PKCS7 *a) {
1277 if (K_PKCS7_content_free) (K_PKCS7_content_free)(a);
1281 int KOpenSSLProxy::i2d_PKCS7(PKCS7 *a,
unsigned char **pp) {
1282 if (K_i2d_PKCS7)
return (K_i2d_PKCS7)(a,pp);
1287 PKCS7 *KOpenSSLProxy::d2i_PKCS7(PKCS7 **a,
unsigned char **pp,
long length) {
1288 if (K_d2i_PKCS7)
return (K_d2i_PKCS7)(a,pp,length);
1293 int KOpenSSLProxy::i2d_PKCS7_fp(FILE *fp,PKCS7 *p7) {
1294 if (K_i2d_PKCS7_fp)
return (K_i2d_PKCS7_fp)(
fp,p7);
1299 PKCS7 *KOpenSSLProxy::d2i_PKCS7_fp(FILE *fp,PKCS7 **p7) {
1300 if (K_d2i_PKCS7_fp)
return (K_d2i_PKCS7_fp)(
fp,p7);
1305 int KOpenSSLProxy::i2d_PKCS7_bio(BIO *bp,PKCS7 *p7) {
1306 if (K_i2d_PKCS7_bio)
return (K_i2d_PKCS7_bio)(bp, p7);
1311 PKCS7 *KOpenSSLProxy::d2i_PKCS7_bio(BIO *bp,PKCS7 **p7) {
1312 if (K_d2i_PKCS7_bio)
return (K_d2i_PKCS7_bio)(bp, p7);
1317 PKCS7 *KOpenSSLProxy::PKCS7_dup(PKCS7 *p7) {
1318 if (K_PKCS7_dup)
return (K_PKCS7_dup)(p7);
1323 PKCS7 *KOpenSSLProxy::PKCS7_sign(X509 *signcert, EVP_PKEY *pkey,
STACK_OF(X509) *certs,
1324 BIO *data,
int flags) {
1325 if (K_PKCS7_sign)
return (K_PKCS7_sign)(signcert,pkey,certs,data,flags);
1330 int KOpenSSLProxy::PKCS7_verify(PKCS7* p,
STACK_OF(X509)* st, X509_STORE* s, BIO* in, BIO *out,
int flags) {
1331 if (K_PKCS7_verify)
return (K_PKCS7_verify)(p,st,s,in,out,flags);
1336 STACK_OF(X509) *KOpenSSLProxy::PKCS7_get0_signers(PKCS7 *p7,
STACK_OF(X509) *certs,
int flags) {
1337 if (K_PKCS7_get0_signers)
return (K_PKCS7_get0_signers)(p7,certs,flags);
1342 PKCS7 *KOpenSSLProxy::PKCS7_encrypt(
STACK_OF(X509) *certs, BIO *in, EVP_CIPHER *cipher,
1344 if (K_PKCS7_encrypt)
return (K_PKCS7_encrypt)(certs,in,cipher,flags);
1349 int KOpenSSLProxy::PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
int flags) {
1350 if (K_PKCS7_decrypt)
return (K_PKCS7_decrypt)(p7,pkey,cert,data,flags);
1355 STACK_OF(X509_NAME) *KOpenSSLProxy::SSL_load_client_CA_file(
const char *file) {
1356 if (K_SSL_load_client_CA_file)
return (K_SSL_load_client_CA_file)(file);
1361 STACK_OF(X509_INFO) *KOpenSSLProxy::PEM_X509_INFO_read(FILE *fp,
STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
void *u) {
1362 if (K_PEM_X509_INFO_read)
return (K_PEM_X509_INFO_read)(
fp,sk,cb,u);
1367 X509 *KOpenSSLProxy::X509_d2i_fp(FILE *out, X509** buf) {
1368 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)));
1373 int KOpenSSLProxy::SSL_peek(SSL *ssl,
void *buf,
int num) {
1374 if (K_SSL_peek)
return (K_SSL_peek)(ssl,buf,num);
1379 const char *KOpenSSLProxy::RAND_file_name(
char *buf,
size_t num) {
1380 if (K_RAND_file_name)
return (K_RAND_file_name)(buf, num);
1385 int KOpenSSLProxy::RAND_load_file(
const char *filename,
long max_bytes) {
1386 if (K_RAND_load_file)
return (K_RAND_load_file)(filename, max_bytes);
1391 int KOpenSSLProxy::RAND_write_file(
const char *filename) {
1392 if (K_RAND_write_file)
return (K_RAND_write_file)(filename);
1397 int KOpenSSLProxy::X509_PURPOSE_get_count() {
1398 if (K_X509_PURPOSE_get_count)
return (K_X509_PURPOSE_get_count)();
1403 int KOpenSSLProxy::X509_PURPOSE_get_id(X509_PURPOSE *p) {
1404 if (K_X509_PURPOSE_get_id)
return (K_X509_PURPOSE_get_id)(p);
1409 int KOpenSSLProxy::X509_check_purpose(X509 *x,
int id,
int ca) {
1410 if (K_X509_check_purpose)
return (K_X509_check_purpose)(x, id, ca);
1415 X509_PURPOSE *KOpenSSLProxy::X509_PURPOSE_get0(
int idx) {
1416 if (K_X509_PURPOSE_get0)
return (K_X509_PURPOSE_get0)(idx);
1421 int KOpenSSLProxy::EVP_PKEY_assign(EVP_PKEY *pkey,
int type,
char *key) {
1422 if (K_EVP_PKEY_assign)
return (K_EVP_PKEY_assign)(pkey, type, key);
1427 int KOpenSSLProxy::X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey) {
1428 if (K_X509_REQ_set_pubkey)
return (K_X509_REQ_set_pubkey)(x, pkey);
1433 RSA* KOpenSSLProxy::RSA_generate_key(
int bits,
unsigned long e,
void
1434 (*callback)(
int,
int,
void *),
void *cb_arg) {
1435 if (K_RSA_generate_key)
return (K_RSA_generate_key)(bits, e, callback, cb_arg);
1439 STACK *KOpenSSLProxy::X509_get1_email(X509 *x) {
1440 if (K_X509_get1_email)
return (K_X509_get1_email)(x);
1444 void KOpenSSLProxy::X509_email_free(STACK *sk) {
1445 if (K_X509_email_free) (K_X509_email_free)(sk);
1448 EVP_CIPHER *KOpenSSLProxy::EVP_des_ede3_cbc() {
1449 if (K_EVP_des_ede3_cbc)
return (K_EVP_des_ede3_cbc)();
1453 EVP_CIPHER *KOpenSSLProxy::EVP_des_cbc() {
1454 if (K_EVP_des_cbc)
return (K_EVP_des_cbc)();
1458 EVP_CIPHER *KOpenSSLProxy::EVP_rc2_cbc() {
1459 if (K_EVP_rc2_cbc)
return (K_EVP_rc2_cbc)();
1463 EVP_CIPHER *KOpenSSLProxy::EVP_rc2_64_cbc() {
1464 if (K_EVP_rc2_64_cbc)
return (K_EVP_rc2_64_cbc)();
1468 EVP_CIPHER *KOpenSSLProxy::EVP_rc2_40_cbc() {
1469 if (K_EVP_rc2_40_cbc)
return (K_EVP_rc2_40_cbc)();
1473 int KOpenSSLProxy::i2d_X509_REQ_fp(FILE *fp, X509_REQ *x) {
1474 if (K_i2d_X509_REQ_fp)
return (K_i2d_X509_REQ_fp)(
fp,x);
1479 void KOpenSSLProxy::ERR_clear_error() {
1480 if (K_ERR_clear_error) (K_ERR_clear_error)();
1484 unsigned long KOpenSSLProxy::ERR_get_error() {
1485 if (K_ERR_get_error)
return (K_ERR_get_error)();
1486 else return 0xffffffff;
1490 void KOpenSSLProxy::ERR_print_errors_fp(FILE* fp) {
1491 if (K_ERR_print_errors_fp) (K_ERR_print_errors_fp)(fp);
1495 SSL_SESSION *KOpenSSLProxy::SSL_get1_session(SSL *ssl) {
1496 if (K_SSL_get1_session)
return (K_SSL_get1_session)(ssl);
1501 void KOpenSSLProxy::SSL_SESSION_free(SSL_SESSION *session) {
1502 if (K_SSL_SESSION_free) (K_SSL_SESSION_free)(session);
1506 int KOpenSSLProxy::SSL_set_session(SSL *ssl, SSL_SESSION *session) {
1507 if (K_SSL_set_session)
return (K_SSL_set_session)(ssl, session);
1512 SSL_SESSION *KOpenSSLProxy::d2i_SSL_SESSION(SSL_SESSION **a,
unsigned char **pp,
long length) {
1513 if (K_d2i_SSL_SESSION)
return (K_d2i_SSL_SESSION)(a, pp, length);
1518 int KOpenSSLProxy::i2d_SSL_SESSION(SSL_SESSION *in,
unsigned char **pp) {
1519 if (K_i2d_SSL_SESSION)
return (K_i2d_SSL_SESSION)(in, pp);
1524 int KOpenSSLProxy::i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *p) {
1525 if (K_i2d_PrivateKey_fp)
return (K_i2d_PrivateKey_fp)(
fp, p);
1530 int KOpenSSLProxy::i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *p,
const EVP_CIPHER *c,
char *k,
int klen, pem_password_cb *cb,
void *u) {
1531 if (K_i2d_PKCS8PrivateKey_fp)
return (K_i2d_PKCS8PrivateKey_fp)(
fp, p, c, k, klen, cb, u);
1536 void KOpenSSLProxy::RSA_free(RSA *rsa) {
1537 if (K_RSA_free) (K_RSA_free)(rsa);
1541 EVP_CIPHER *KOpenSSLProxy::EVP_bf_cbc() {
1542 if (K_EVP_bf_cbc)
return (K_EVP_bf_cbc)();
1547 int KOpenSSLProxy::X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey,
const EVP_MD *md) {
1548 if (K_X509_REQ_sign)
return (K_X509_REQ_sign)(x, pkey, md);
1553 int KOpenSSLProxy::X509_NAME_add_entry_by_txt(X509_NAME *name,
char *field,
1554 int type,
unsigned char *bytes,
int len,
int loc,
int set) {
1555 if (K_X509_NAME_add_entry_by_txt)
return (K_X509_NAME_add_entry_by_txt)(name, field, type, bytes, len, loc, set);
1560 X509_NAME *KOpenSSLProxy::X509_NAME_new() {
1561 if (K_X509_NAME_new)
return (K_X509_NAME_new)();
1566 int KOpenSSLProxy::X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name) {
1567 if (K_X509_REQ_set_subject_name)
return (K_X509_REQ_set_subject_name)(req, name);
1572 unsigned char *KOpenSSLProxy::ASN1_STRING_data(ASN1_STRING *x) {
1573 if (K_ASN1_STRING_data)
return (K_ASN1_STRING_data)(x);
1578 int KOpenSSLProxy::ASN1_STRING_length(ASN1_STRING *x) {
1579 if (K_ASN1_STRING_length)
return (K_ASN1_STRING_length)(x);
1584 STACK_OF(SSL_CIPHER) *KOpenSSLProxy::SSL_get_ciphers(
const SSL* ssl) {
1585 if (K_SSL_get_ciphers)
return (K_SSL_get_ciphers)(ssl);
bool hasLibCrypto() const
Return true of libcrypto was found and loaded.
Dynamically load and wrap OpenSSL.
QString dir(const QString &fileClass)
Returns the most recently used directory accociated with this file-class.
int access(const QString &path, int mode)
bool hasLibSSL() const
Return true of libssl was found and loaded.
static KOpenSSLProxy * self()
Return an instance of class KOpenSSLProxy * You cannot delete this object.
void destroy()
Destroy the class and start over - don't use this unless you know what you are doing.
void(* void_function_ptr)()