#include "net/cert/ev_root_ca_metadata.h"
#include <string_view>
#include "base/containers/contains.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "third_party/boringssl/src/pki/input.h"
#if defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/mem.h"
#endif
namespace net {
namespace {
#if defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
struct EVMetadata { … };
#include "net/data/ssl/chrome_root_store/chrome-ev-roots-inc.cc"
#endif
}
static base::LazyInstance<EVRootCAMetadata>::Leaky g_ev_root_ca_metadata = …;
EVRootCAMetadata* EVRootCAMetadata::GetInstance() { … }
#if defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
namespace {
std::string OIDStringToDER(std::string_view policy) { … }
}
bool EVRootCAMetadata::IsEVPolicyOID(bssl::der::Input policy_oid) const { … }
bool EVRootCAMetadata::HasEVPolicyOID(const SHA256HashValue& fingerprint,
bssl::der::Input policy_oid) const { … }
bool EVRootCAMetadata::AddEVCA(const SHA256HashValue& fingerprint,
const char* policy) { … }
bool EVRootCAMetadata::RemoveEVCA(const SHA256HashValue& fingerprint) { … }
#else
bool EVRootCAMetadata::IsEVPolicyOID(bssl::der::Input policy_oid) const {
LOG(WARNING) << "Not implemented";
return false;
}
bool EVRootCAMetadata::HasEVPolicyOID(const SHA256HashValue& fingerprint,
bssl::der::Input policy_oid) const {
LOG(WARNING) << "Not implemented";
return false;
}
bool EVRootCAMetadata::AddEVCA(const SHA256HashValue& fingerprint,
const char* policy) {
LOG(WARNING) << "Not implemented";
return true;
}
bool EVRootCAMetadata::RemoveEVCA(const SHA256HashValue& fingerprint) {
LOG(WARNING) << "Not implemented";
return true;
}
#endif
EVRootCAMetadata::EVRootCAMetadata() { … }
EVRootCAMetadata::~EVRootCAMetadata() = default;
}