diff options
author | Timothy Pearson <[email protected]> | 2015-09-06 23:11:58 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2015-09-06 23:11:58 -0500 |
commit | 9d5f5058a1e5e34b0f67c4a54a785975780119dd (patch) | |
tree | bb0752a55b810f10328dcc0ed1dc2b2a42930aae /tdecore/tdehw | |
parent | c867c64aa9297e935d4c4a1d7c45430d01306e58 (diff) | |
download | tdelibs-9d5f5058a1e5e34b0f67c4a54a785975780119dd.tar.gz tdelibs-9d5f5058a1e5e34b0f67c4a54a785975780119dd.zip |
Fix issues with X509 certificate list usage
Diffstat (limited to 'tdecore/tdehw')
-rw-r--r-- | tdecore/tdehw/tdecryptographiccarddevice.cpp | 9 | ||||
-rw-r--r-- | tdecore/tdehw/tdecryptographiccarddevice.h | 13 |
2 files changed, 16 insertions, 6 deletions
diff --git a/tdecore/tdehw/tdecryptographiccarddevice.cpp b/tdecore/tdehw/tdecryptographiccarddevice.cpp index 5686fa8c3..8cf8092d9 100644 --- a/tdecore/tdehw/tdecryptographiccarddevice.cpp +++ b/tdecore/tdehw/tdecryptographiccarddevice.cpp @@ -16,6 +16,8 @@ Boston, MA 02110-1301, USA. */ +#define _TDECRYPTOGRAPHICCARDDEVICE_INTERNAL 1 + #include "tdecryptographiccarddevice_private.h" #include "tdecryptographiccarddevice.h" @@ -343,9 +345,11 @@ int CryptoCardDeviceWatcher::retrieveCardCertificates(TQString readerName) { } void CryptoCardDeviceWatcher::deleteAllCertificatesFromCache() { - X509CertificatePtrListIterator it(cardDevice->m_cardCertificates); X509 *x509_cert; - while ((x509_cert = it.current()) != 0) { + + X509CertificatePtrListIterator it; + for (it = cardDevice->m_cardCertificates.begin(); it != cardDevice->m_cardCertificates.end(); ++it) { + x509_cert = *it; X509_free(x509_cert); } @@ -356,7 +360,6 @@ TDECryptographicCardDevice::TDECryptographicCardDevice(TDEGenericDeviceType::TDE m_watcherThread(NULL), m_watcherObject(NULL), m_cardPresent(false) { - m_cardCertificates.setAutoDelete(false); } TDECryptographicCardDevice::~TDECryptographicCardDevice() { diff --git a/tdecore/tdehw/tdecryptographiccarddevice.h b/tdecore/tdehw/tdecryptographiccarddevice.h index 2ffdc1a75..299ad0741 100644 --- a/tdecore/tdehw/tdecryptographiccarddevice.h +++ b/tdecore/tdehw/tdecryptographiccarddevice.h @@ -22,12 +22,19 @@ #include "tdegenericdevice.h" -class x509_st; +#ifndef _TDECRYPTOGRAPHICCARDDEVICE_INTERNAL + #ifdef KSSL_HAVE_SSL + typedef struct x509_st X509; + #else + class X509; + #endif +#endif + class TQEventLoopThread; class CryptoCardDeviceWatcher; -typedef TQPtrList<x509_st> X509CertificatePtrList; -typedef TQPtrListIterator<x509_st> X509CertificatePtrListIterator; +typedef TQValueList<X509*> X509CertificatePtrList; +typedef TQValueListIterator<X509*> X509CertificatePtrListIterator; class TDECORE_EXPORT TDECryptographicCardDevice : public TDEGenericDevice { |