diff options
Diffstat (limited to 'src/network/ssl/qsslsocket_p.h')
-rw-r--r-- | src/network/ssl/qsslsocket_p.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h index 8e22664..42ae98f 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -66,6 +66,24 @@ QT_BEGIN_NAMESPACE +#if defined(Q_OS_MAC) +#include <Security/SecCertificate.h> +#include <CoreFoundation/CFArray.h> + typedef OSStatus (*PtrSecCertificateGetData)(SecCertificateRef, CSSM_DATA_PTR); + typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*); + typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*); +#elif defined(Q_OS_WIN) +#include <Wincrypt.h> +#ifndef HCRYPTPROV_LEGACY +#define HCRYPTPROV_LEGACY HCRYPTPROV +#endif + typedef HCERTSTORE (WINAPI *PtrCertOpenSystemStoreW)(HCRYPTPROV_LEGACY, LPCWSTR); + typedef PCCERT_CONTEXT (WINAPI *PtrCertFindCertificateInStore)(HCERTSTORE, DWORD, DWORD, DWORD, const void*, PCCERT_CONTEXT); + typedef BOOL (WINAPI *PtrCertCloseStore)(HCERTSTORE, DWORD); +#endif + + + class QSslSocketPrivate : public QTcpSocketPrivate { Q_DECLARE_PUBLIC(QSslSocket) @@ -106,6 +124,16 @@ public: static void addDefaultCaCertificate(const QSslCertificate &cert); static void addDefaultCaCertificates(const QList<QSslCertificate> &certs); +#if defined(Q_OS_MAC) + static PtrSecCertificateGetData ptrSecCertificateGetData; + static PtrSecTrustSettingsCopyCertificates ptrSecTrustSettingsCopyCertificates; + static PtrSecTrustCopyAnchorCertificates ptrSecTrustCopyAnchorCertificates; +#elif defined(Q_OS_WIN) + static PtrCertOpenSystemStoreW ptrCertOpenSystemStoreW; + static PtrCertFindCertificateInStore ptrCertFindCertificateInStore; + static PtrCertCloseStore ptrCertCloseStore; +#endif + // The socket itself, including private slots. QTcpSocket *plainSocket; void createPlainSocket(QIODevice::OpenMode openMode); |