diff options
| author | Nils Maier <maierman@web.de> | 2013-04-05 05:55:57 +0200 |
|---|---|---|
| committer | Nils Maier <maierman@web.de> | 2013-04-05 23:10:47 +0200 |
| commit | 0bcbd947b47d8f3af6c04508f7d493edc901dfdc (patch) | |
| tree | 87d88ee26770477970db498ebfce06a1c4e832d0 /src/LibgnutlsTLSContext.h | |
| parent | b292ae1305e8915edd7099446bdd533ac5c4d0a4 (diff) | |
AppleTLS: Implement AppleTLS and Apple Message Digest
Diffstat (limited to 'src/LibgnutlsTLSContext.h')
| -rw-r--r-- | src/LibgnutlsTLSContext.h | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/src/LibgnutlsTLSContext.h b/src/LibgnutlsTLSContext.h index 4fc49fbc..8d744bd6 100644 --- a/src/LibgnutlsTLSContext.h +++ b/src/LibgnutlsTLSContext.h @@ -37,8 +37,6 @@ #include "common.h" -#include <string> - #include <gnutls/gnutls.h> #include "TLSContext.h" @@ -46,45 +44,41 @@ namespace aria2 { -class TLSContext { -private: - gnutls_certificate_credentials_t certCred_; - - TLSSessionSide side_; - - bool good_; - - bool peerVerificationEnabled_; +class GnuTLSContext : public TLSContext { public: - TLSContext(TLSSessionSide side); + GnuTLSContext(TLSSessionSide side); - ~TLSContext(); + virtual ~GnuTLSContext(); // private key `keyfile' must be decrypted. - bool addCredentialFile(const std::string& certfile, - const std::string& keyfile); + virtual bool addCredentialFile(const std::string& certfile, + const std::string& keyfile); - bool addSystemTrustedCACerts(); + virtual bool addSystemTrustedCACerts(); // certfile can contain multiple certificates. - bool addTrustedCACertFile(const std::string& certfile); - - bool good() const; + virtual bool addTrustedCACertFile(const std::string& certfile); - bool bad() const; + virtual bool good() const; - gnutls_certificate_credentials_t getCertCred() const; - - TLSSessionSide getSide() const - { + virtual TLSSessionSide getSide() const { return side_; } - void enablePeerVerification(); + virtual bool getVerifyPeer() const { + return verifyPeer_; + } + virtual void setVerifyPeer(bool verify) { + verifyPeer_ = verify; + } - void disablePeerVerification(); + gnutls_certificate_credentials_t getCertCred() const; - bool peerVerificationEnabled() const; +private: + gnutls_certificate_credentials_t certCred_; + TLSSessionSide side_; + bool good_; + bool verifyPeer_; }; } // namespace aria2 |
