summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslsocket_openssl_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/ssl/qsslsocket_openssl_p.h')
-rw-r--r--src/network/ssl/qsslsocket_openssl_p.h77
1 files changed, 33 insertions, 44 deletions
diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h
index 7a4e6b6..dec98ae 100644
--- a/src/network/ssl/qsslsocket_openssl_p.h
+++ b/src/network/ssl/qsslsocket_openssl_p.h
@@ -120,67 +120,56 @@ public:
};
#if defined(Q_OS_SYMBIAN)
+
+#include <QByteArray>
+#include <e32base.h>
+#include <f32file.h>
#include <unifiedcertstore.h> // link against certstore.lib
#include <ccertattributefilter.h> // link against ctframework.lib
-class QCertificateRetriever;
+// The purpose of this class is to wrap the asynchronous API of Symbian certificate store to one
+// synchronizable call. The user of this class needs to provide a TRequestStatus object which can
+// be used with User::WaitForRequest() unlike with the calls of the certificate store API.
+// A thread is used instead of a CActiveSchedulerWait scheme, because that would make the call
+// asynchronous (other events might be processed during the call even though the call would be seemingly
+// synchronous).
-class QCertificateConsumer : public QObject
+class CSymbianCertificateRetriever : public CActive
{
- Q_OBJECT
public:
- QCertificateConsumer(QObject* parent = 0);
- ~QCertificateConsumer();
-
- void finish();
-
- void addEncodedCertificate(const QByteArray& certificate)
- { certificates.append(certificate); }
- QList<QByteArray> encodedCertificates() const { return certificates; }
-
-public slots:
- void start();
+ static CSymbianCertificateRetriever* NewL();
+ ~CSymbianCertificateRetriever();
-signals:
- void finished();
+ int GetCertificates(QList<QByteArray> &aCertificates);
private:
- QList<QByteArray> certificates;
- QCertificateRetriever *retriever;
-};
-
-
-class QCertificateRetriever : public CActive
-{
-public:
- QCertificateRetriever(QCertificateConsumer* consumer);
- ~QCertificateRetriever();
-
- void fetch();
+ void ConstructL();
+ CSymbianCertificateRetriever();
+ static TInt ThreadEntryPoint(TAny* aParams);
+ void doThreadEntryL();
+ void GetCertificateL();
+ void DoCancel();
+ void RunL();
+ TInt RunError(TInt aError);
private:
- virtual void RunL();
- virtual void DoCancel();
-
- void run();
- void list();
- void retrieveNextCertificate();
-
enum {
Initializing,
Listing,
RetrievingCertificates
- } state;
-
- CUnifiedCertStore* certStore;
- RMPointerArray<CCTCertInfo> certs;
- CCertAttributeFilter* certFilter;
- QCertificateConsumer* consumer;
- int currentCertificateIndex;
- QByteArray currentCertificate;
- TPtr8 certDescriptor;
+ } iState;
+
+ RThread iThread;
+ CUnifiedCertStore* iCertStore;
+ RMPointerArray<CCTCertInfo> iCertInfos;
+ CCertAttributeFilter* iCertFilter;
+ TInt iCurrentCertIndex;
+ QByteArray iCertificateData;
+ QList<QByteArray>* iCertificates;
+ TInt iSequenceError;
};
+
#endif