Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: net/cert/known_roots_mac.h

Issue 2833623002: Extract IsKnownRoot() functionality for testing if a certificate is a (Closed)
Patch Set: checkpoint Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/cert/known_roots_mac.h
diff --git a/net/cert/known_roots_mac.h b/net/cert/known_roots_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..5093d180ae33e68c00adb1ce489c7a4b24f9be31
--- /dev/null
+++ b/net/cert/known_roots_mac.h
@@ -0,0 +1,28 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_CERT_KNOWN_ROOTS_MAC_H_
+#define NET_CERT_KNOWN_ROOTS_MAC_H_
+
+#include <Security/Security.h>
+
+namespace net {
+
+// IsKnownRoot returns true if the given certificate is one that we believe
+// is a standard (as opposed to user-installed) root.
+//
+// NOTE: The first call will lazily initialize the known roots, which requires
+// holding crypto::GetMacSecurityServicesLock(). Callers must therefore either
+// acquire that lock prior to calling this, or eagerly initialize beforehand
+// using InitializeKnownRoots().
+bool IsKnownRoot(SecCertificateRef cert);
+
+// Calling this is optional as initialization will otherwise be done lazily when
+// calling IsKnownRoot(). When calling this, the current thread must NOT already
+// be holding/ crypto::GetMacSecurityServicesLock().
+void InitializeKnownRoots();
+
+} // namespace net
+
+#endif // NET_CERT_KNOWN_ROOTS_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698