2017-11-15 13:09:22 +00:00
|
|
|
// Copyright (c) 2017 GitHub, Inc.
|
2016-10-17 10:33:24 +00:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2018-10-19 18:51:43 +00:00
|
|
|
#ifndef ATOM_BROWSER_NET_REQUIRE_CT_DELEGATE_H_
|
|
|
|
#define ATOM_BROWSER_NET_REQUIRE_CT_DELEGATE_H_
|
2016-10-17 10:33:24 +00:00
|
|
|
|
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "net/http/transport_security_state.h"
|
|
|
|
|
2018-10-19 18:51:43 +00:00
|
|
|
namespace atom {
|
2016-10-17 10:33:24 +00:00
|
|
|
|
2017-11-15 13:09:22 +00:00
|
|
|
class RequireCTDelegate
|
|
|
|
: public net::TransportSecurityState::RequireCTDelegate {
|
2016-10-17 10:33:24 +00:00
|
|
|
public:
|
2017-11-15 13:09:22 +00:00
|
|
|
RequireCTDelegate();
|
|
|
|
~RequireCTDelegate() override;
|
2016-10-17 10:33:24 +00:00
|
|
|
|
|
|
|
void AddCTExcludedHost(const std::string& host);
|
|
|
|
void ClearCTExcludedHostsList();
|
|
|
|
|
|
|
|
// net::TransportSecurityState::RequireCTDelegate:
|
2018-07-20 21:09:52 +00:00
|
|
|
CTRequirementLevel IsCTRequiredForHost(
|
|
|
|
const std::string& host,
|
|
|
|
const net::X509Certificate* chain,
|
|
|
|
const net::HashValueVector& hashes) override;
|
2016-10-17 10:33:24 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::set<std::string> ct_excluded_hosts_;
|
2017-11-15 13:09:22 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(RequireCTDelegate);
|
2016-10-17 10:33:24 +00:00
|
|
|
};
|
|
|
|
|
2018-10-19 18:51:43 +00:00
|
|
|
} // namespace atom
|
2016-10-17 10:33:24 +00:00
|
|
|
|
2018-10-19 18:51:43 +00:00
|
|
|
#endif // ATOM_BROWSER_NET_REQUIRE_CT_DELEGATE_H_
|