X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcarddav%2Fcarddav.h;h=c4deeb2ee6f7a172e9d4c2d36e8e362e854ae107;hb=26c542881613813bd6a671a56e78f129944f68e6;hp=fd1068a450352fff2b487daad9e31f0e2fc84ed1;hpb=45729fca56479bd9158486e0cda0c4a94b4dd1dc;p=xestiaab%2F.git diff --git a/source/carddav/carddav.h b/source/carddav/carddav.h index fd1068a..c4deeb2 100644 --- a/source/carddav/carddav.h +++ b/source/carddav/carddav.h @@ -1,3 +1,21 @@ +// carddav.h - CardDAV Object header file. +// +// (c) 2012-2015 Xestia Software Development. +// +// This file is part of Xestia Address Book. +// +// Xestia Address Book is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by the +// Free Software Foundation, version 3 of the license. +// +// Xestia Address Book is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with Xestia Address Book. If not, see + #include #include #include @@ -5,7 +23,7 @@ #include #include #include "../vcard/vcard.h" -#include "../frmActivityMgr.h" +#include "../actmgr/frmActivityMgr.h" #include "../common/sslcertstructs.h" #ifndef CALDAV_CALDAV_H @@ -21,6 +39,12 @@ struct ContactListData{ std::map ListData; }; +struct UploadDataStruc{ + wxString *readptr; + long sizeleft; + int seek = 0; +}; + /*struct CertificateData{ std::multimap CertificateData; bool CertValid; @@ -38,6 +62,7 @@ struct CertificateCollection{ size_t WritebackFunc(char *ptr, size_t size, size_t nmemb, wxString *userdata); int ProgressFunc(void *clientdata, double TTDown, double NDown, double TTUp, double NUp); +size_t UploadReadFunc(void *ptr, size_t size, size_t nmemb, void *userdata); class CardDAV { @@ -51,7 +76,9 @@ class CardDAV bool SSLVerify(); bool AbleToLogin(); bool HasValidResponse(); - wxString GetResponseData(); + bool IsSelfSigned(); + wxString GetResponseData(); + void AllowSelfSignTest(bool AllowSelfSignIn); bool Connect(); bool ConnectThread(); void ProcessData(); @@ -79,6 +106,12 @@ class CardDAV static SSLCertCollection BuildSSLCollection(CURL *conn); wxString ETagValueResult(); wxString GetErrorMessage(); + + // SSL Verification tests when connecting. + + static CURLcode SSLVerifyTest(); + static SSLCertCollection GetSSLVerifyResults(); + //size_t WritebackFunc(char *ptr, size_t size, size_t nmemb, FILE *userdata); private: static wxString ServerAddress; @@ -110,6 +143,8 @@ class CardDAV static char curlerrbuffer[CURL_ERROR_SIZE]; static SSLCertCollection SSLCertCol; static wxString ErrorMessage; + static wxString ErrorBufferMessage; + static bool AllowSelfSign; protected: static int SSLErrorCode; static int ConnectionErrorCode; @@ -117,6 +152,7 @@ class CardDAV static wxString PageData; static CURLcode claconncode; static int HTTPErrorCode; + static SSLCertCollection VerifyCertCollection; };