optimizations, certificate verification, code cleanup

This commit is contained in:
Günter Obiltschnig
2014-10-09 20:54:07 +02:00
parent 5b0fa2e06a
commit 80952e11d1
10 changed files with 596 additions and 397 deletions

View File

@@ -123,6 +123,25 @@ public:
/// Returns true if verification against the issuer certificate
/// was successful, false otherwise.
bool verify(const std::string& hostName) const;
/// Verifies the validity of the certificate against the host name.
///
/// For this check to be successful, the certificate must contain
/// a domain name that matches the domain name
/// of the host.
///
/// Returns true if verification succeeded, or false otherwise.
static bool verify(const Poco::Net::X509Certificate& cert, const std::string& hostName);
/// Verifies the validity of the certificate against the host name.
///
/// For this check to be successful, the certificate must contain
/// a domain name that matches the domain name
/// of the host.
///
/// Returns true if verification succeeded, or false otherwise.
const PCCERT_CONTEXT system() const;
/// Returns the underlying WinCrypt certificate.
@@ -139,6 +158,9 @@ protected:
void importPEMCertificate(const char* pBuffer, std::size_t size);
void importDERCertificate(const char* pBuffer, std::size_t size);
static bool containsWildcards(const std::string& commonName);
static bool matchWildcard(const std::string& alias, const std::string& hostName);
private:
enum
{