summaryrefslogtreecommitdiffstats
path: root/tdeio/kssl/ksslpkcs12.cc
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2017-01-01 19:35:39 +0100
committerSlávek Banko <slavek.banko@axis.cz>2017-01-01 19:35:39 +0100
commite1861cb6811f7bac405ece204407ca46c000a453 (patch)
tree8883f182e51c13750d24c5b74ed058d4d9fce99e /tdeio/kssl/ksslpkcs12.cc
parentf32bc5176289b70bf1c6e7d2825d53f190bc4096 (diff)
downloadtdelibs-e1861cb6811f7bac405ece204407ca46c000a453.tar.gz
tdelibs-e1861cb6811f7bac405ece204407ca46c000a453.zip
Added support for OpenSSL 1.1
Some KOpenSSLProxy methods have been renamed to be consistent with OpenSSL 1.1 API names and to prevent hidden API changes. To ensure API / ABI compatibility, the original methods are still included but have been marked as deprecated. + SSLv23_client_method => TLS_client_method + X509_STORE_CTX_set_chain => X509_STORE_CTX_set0_untrusted + sk_dup => OPENSSL_sk_dup + sk_free => OPENSSL_sk_free + sk_new => OPENSSL_sk_new + sk_num => OPENSSL_sk_num + sk_pop => OPENSSL_sk_pop + sk_push => OPENSSL_sk_push + sk_value => OPENSSL_sk_value Additional methods have been added to KOpenSSLProxy to support the new OpenSSL 1.1 API functions that provide access to the (now) opaque SSL structures. Compatibility with OpenSSL < 1.1 is handled internally in KOpenSSLProxy. + BIO_get_data + DSA_get0_key + DSA_get0_pqg + EVP_PKEY_base_id + EVP_PKEY_get0_DSA + EVP_PKEY_get0_RSA + RSA_get0_key + X509_CRL_get0_lastUpdate + X509_CRL_get0_nextUpdate + X509_OBJECT_get0_X509 + X509_OBJECT_get_type + X509_STORE_CTX_get_current_cert + X509_STORE_CTX_get_error + X509_STORE_CTX_get_error_depth + X509_STORE_CTX_set_error + X509_STORE_get0_objects + X509_STORE_set_verify_cb + X509_get0_signature + X509_getm_notAfter + X509_getm_notBefore + X509_subject_name_cmp + _SSL_session_reused + _SSL_set_options Method "KSSL::setSession" has been renamed to "KSSL::takeSession" and its functionality has changed: the session is now transferred from the argument object to the invoked object. Since it is only used internally in TDE and the functionality is different, the method with the previous name has not been preserved. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdeio/kssl/ksslpkcs12.cc')
-rw-r--r--tdeio/kssl/ksslpkcs12.cc29
1 files changed, 4 insertions, 25 deletions
diff --git a/tdeio/kssl/ksslpkcs12.cc b/tdeio/kssl/ksslpkcs12.cc
index 9521e907b..08bc54a0b 100644
--- a/tdeio/kssl/ksslpkcs12.cc
+++ b/tdeio/kssl/ksslpkcs12.cc
@@ -34,16 +34,6 @@
#include <assert.h>
-#ifdef KSSL_HAVE_SSL
-#define sk_new kossl->sk_new
-#define sk_push kossl->sk_push
-#define sk_free kossl->sk_free
-#define sk_value kossl->sk_value
-#define sk_num kossl->sk_num
-#define sk_dup kossl->sk_dup
-#define sk_pop kossl->sk_pop
-#endif
-
KSSLPKCS12::KSSLPKCS12() {
_pkcs = NULL;
@@ -60,11 +50,11 @@ KSSLPKCS12::~KSSLPKCS12() {
if (_pkey) kossl->EVP_PKEY_free(_pkey);
if (_caStack) {
for (;;) {
- X509* x5 = sk_X509_pop(_caStack);
+ X509* x5 = reinterpret_cast<X509*>(kossl->OPENSSL_sk_pop(_caStack));
if (!x5) break;
kossl->X509_free(x5);
}
- sk_X509_free(_caStack);
+ kossl->OPENSSL_sk_free(_caStack);
}
if (_pkcs) kossl->PKCS12_free(_pkcs);
#endif
@@ -151,11 +141,11 @@ X509 *x = NULL;
if (_pkey) kossl->EVP_PKEY_free(_pkey);
if (_caStack) {
for (;;) {
- X509* x5 = sk_X509_pop(_caStack);
+ X509* x5 = reinterpret_cast<X509*>(kossl->OPENSSL_sk_pop(_caStack));
if (!x5) break;
kossl->X509_free(x5);
}
- sk_X509_free(_caStack);
+ kossl->OPENSSL_sk_free(_caStack);
}
_pkey = NULL;
_caStack = NULL;
@@ -282,14 +272,3 @@ TQString KSSLPKCS12::name() {
return _cert->getSubject();
}
-
-#ifdef KSSL_HAVE_SSL
-#undef sk_new
-#undef sk_push
-#undef sk_free
-#undef sk_value
-#undef sk_num
-#undef sk_pop
-#undef sk_dup
-#endif
-