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

Side by Side Diff: net/base/x509_cert_types.h

Issue 9415040: Refactor TransportSecurityState. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/base/transport_security_state_unittest.cc ('k') | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_X509_CERT_TYPES_H_ 5 #ifndef NET_BASE_X509_CERT_TYPES_H_
6 #define NET_BASE_X509_CERT_TYPES_H_ 6 #define NET_BASE_X509_CERT_TYPES_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 // SHA-1 fingerprint (160 bits) of a certificate. 31 // SHA-1 fingerprint (160 bits) of a certificate.
32 struct NET_EXPORT SHA1Fingerprint { 32 struct NET_EXPORT SHA1Fingerprint {
33 bool Equals(const SHA1Fingerprint& other) const { 33 bool Equals(const SHA1Fingerprint& other) const {
34 return memcmp(data, other.data, sizeof(data)) == 0; 34 return memcmp(data, other.data, sizeof(data)) == 0;
35 } 35 }
36 36
37 unsigned char data[20]; 37 unsigned char data[20];
38 }; 38 };
39 39
40 // In the future there will be a generic Fingerprint type, with at least two
41 // implementations: SHA1 and SHA256. See http://crbug.com/117914. Until that
42 // work is done (in a separate patch) this typedef bridges the gap.
43 typedef SHA1Fingerprint Fingerprint;
44
45 typedef std::vector<Fingerprint> FingerprintVector;
46
40 class NET_EXPORT SHA1FingerprintLessThan { 47 class NET_EXPORT SHA1FingerprintLessThan {
41 public: 48 public:
42 bool operator() (const SHA1Fingerprint& lhs, 49 bool operator() (const SHA1Fingerprint& lhs,
43 const SHA1Fingerprint& rhs) const { 50 const SHA1Fingerprint& rhs) const {
44 return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) < 0; 51 return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) < 0;
45 } 52 }
46 }; 53 };
47 54
48 // IsSHA1HashInSortedArray returns true iff |hash| is in |array|, a sorted 55 // IsSHA1HashInSortedArray returns true iff |hash| is in |array|, a sorted
49 // array of SHA1 hashes. 56 // array of SHA1 hashes.
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Attempts to parse |raw_date|, an ASN.1 date/time string encoded as 158 // Attempts to parse |raw_date|, an ASN.1 date/time string encoded as
152 // |format|, and writes the result into |*time|. If an invalid date is 159 // |format|, and writes the result into |*time|. If an invalid date is
153 // specified, or if parsing fails, returns false, and |*time| will not be 160 // specified, or if parsing fails, returns false, and |*time| will not be
154 // updated. 161 // updated.
155 bool ParseCertificateDate(const base::StringPiece& raw_date, 162 bool ParseCertificateDate(const base::StringPiece& raw_date,
156 CertDateFormat format, 163 CertDateFormat format,
157 base::Time* time); 164 base::Time* time);
158 } // namespace net 165 } // namespace net
159 166
160 #endif // NET_BASE_X509_CERT_TYPES_H_ 167 #endif // NET_BASE_X509_CERT_TYPES_H_
OLDNEW
« no previous file with comments | « net/base/transport_security_state_unittest.cc ('k') | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698