| OLD | NEW | 
|---|
|  | (Empty) | 
| 1 // Copyright (c) 2015 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 #ifndef NET_CERT_CERT_VERIFY_PROC_WHITELIST_H_ |  | 
| 6 #define NET_CERT_CERT_VERIFY_PROC_WHITELIST_H_ |  | 
| 7 |  | 
| 8 #include <stddef.h> |  | 
| 9 #include <stdint.h> |  | 
| 10 |  | 
| 11 #include "base/strings/string_piece.h" |  | 
| 12 #include "crypto/sha2.h" |  | 
| 13 #include "net/base/hash_value.h" |  | 
| 14 #include "net/base/net_export.h" |  | 
| 15 |  | 
| 16 namespace net { |  | 
| 17 |  | 
| 18 class X509Certificate; |  | 
| 19 |  | 
| 20 // Returns true if |cert| has been issued by a CA that is constrained from |  | 
| 21 // issuing new certificates and |cert| is not within the whitelist of |  | 
| 22 // existing certificates. Returns false if |cert| was issued by an |  | 
| 23 // unconstrained CA or if it was in the whitelist for that |  | 
| 24 // CA. |  | 
| 25 // |cert| should be the verified certificate chain, with |public_key_hashes| |  | 
| 26 // being the set of hashes of the SPKIs within the verified chain, and |  | 
| 27 // |hostname| as the GURL-normalized hostname. |  | 
| 28 bool NET_EXPORT_PRIVATE |  | 
| 29 IsNonWhitelistedCertificate(const X509Certificate& cert, |  | 
| 30                             const HashValueVector& public_key_hashes, |  | 
| 31                             base::StringPiece hostname); |  | 
| 32 |  | 
| 33 // Returns true if |host| is in (or a subdomain of) a whitelisted host |  | 
| 34 // in |graph|, which is a DAFSA constructed by |  | 
| 35 // //net/tools/dafsa/make_dafsa.py that is |graph_length| bytes long. |  | 
| 36 bool NET_EXPORT_PRIVATE IsWhitelistedHost(const unsigned char* graph, |  | 
| 37                                           size_t graph_length, |  | 
| 38                                           base::StringPiece host); |  | 
| 39 |  | 
| 40 }  // namespace net |  | 
| 41 |  | 
| 42 #endif  // NET_CERT_CERT_VERIFY_PROC_WHITELIST_H_ |  | 
| OLD | NEW | 
|---|