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

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

Issue 8568040: Refuse to accept certificate chains containing any RSA public key smaller (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 | « no previous file | net/base/x509_certificate.h » ('j') | net/base/x509_certificate.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 16 matching lines...) Expand all
27 namespace net { 27 namespace net {
28 28
29 class X509Certificate; 29 class X509Certificate;
30 30
31 // SHA-1 fingerprint (160 bits) of a certificate. 31 // SHA-1 fingerprint (160 bits) of a certificate.
32 struct SHA1Fingerprint { 32 struct 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 bool operator==(const SHA1Fingerprint& other) const {
38 return Equals(other);
39 }
40
37 unsigned char data[20]; 41 unsigned char data[20];
38 }; 42 };
39 43
40 class SHA1FingerprintLessThan { 44 class SHA1FingerprintLessThan {
41 public: 45 public:
42 bool operator() (const SHA1Fingerprint& lhs, 46 bool operator() (const SHA1Fingerprint& lhs,
43 const SHA1Fingerprint& rhs) const { 47 const SHA1Fingerprint& rhs) const {
44 return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) < 0; 48 return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) < 0;
45 } 49 }
46 }; 50 };
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 // Attempts to parse |raw_date|, an ASN.1 date/time string encoded as 150 // Attempts to parse |raw_date|, an ASN.1 date/time string encoded as
147 // |format|, and writes the result into |*time|. If an invalid date is 151 // |format|, and writes the result into |*time|. If an invalid date is
148 // specified, or if parsing fails, returns false, and |*time| will not be 152 // specified, or if parsing fails, returns false, and |*time| will not be
149 // updated. 153 // updated.
150 bool ParseCertificateDate(const base::StringPiece& raw_date, 154 bool ParseCertificateDate(const base::StringPiece& raw_date,
151 CertDateFormat format, 155 CertDateFormat format,
152 base::Time* time); 156 base::Time* time);
153 } // namespace net 157 } // namespace net
154 158
155 #endif // NET_BASE_X509_CERT_TYPES_H_ 159 #endif // NET_BASE_X509_CERT_TYPES_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/x509_certificate.h » ('j') | net/base/x509_certificate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698