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

Side by Side Diff: net/cert/known_roots_nss.cc

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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/cert/known_roots_nss.h"
6
7 #include <cert.h>
8 #include <pk11pub.h>
9
10 #include <memory>
11
12 namespace net {
13
14 // IsKnownRoot returns true if the given certificate is one that we believe
15 // is a standard (as opposed to user-installed) root.
16 bool IsKnownRoot(CERTCertificate* root) {
17 if (!root || !root->slot)
18 return false;
19
20 // This magic name is taken from
21 // http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/security/nss/lib/ckfw/b uiltins/constants.c&rev=1.13&mark=86,89#79
22 return 0 == strcmp(PK11_GetSlotName(root->slot), "NSS Builtin Objects");
23 }
24
25 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698