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

Side by Side Diff: net/cert/internal/parse_certificate.cc

Issue 1890193003: Make Cast certificate verification enforce constraints specified in the trusted root certificate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: list datafiles for ios (needed following the rebase) Created 4 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
« no previous file with comments | « net/cert/internal/parse_certificate.h ('k') | net/cert/internal/verify_certificate_chain.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "net/cert/internal/parse_certificate.h" 5 #include "net/cert/internal/parse_certificate.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "net/der/input.h" 9 #include "net/der/input.h"
10 #include "net/der/parse_values.h" 10 #include "net/der/parse_values.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // guarantees they are all zero. 143 // guarantees they are all zero.
144 for (size_t i = 0; i < bits.bytes().Length(); ++i) { 144 for (size_t i = 0; i < bits.bytes().Length(); ++i) {
145 if (bits.bytes().UnsafeData()[i] != 0) 145 if (bits.bytes().UnsafeData()[i] != 0)
146 return false; 146 return false;
147 } 147 }
148 return true; 148 return true;
149 } 149 }
150 150
151 } // namespace 151 } // namespace
152 152
153 ParsedCertificate::ParsedCertificate() {}
154
155 ParsedCertificate::~ParsedCertificate() {}
156
153 ParsedTbsCertificate::ParsedTbsCertificate() {} 157 ParsedTbsCertificate::ParsedTbsCertificate() {}
154 158
155 ParsedTbsCertificate::~ParsedTbsCertificate() {} 159 ParsedTbsCertificate::~ParsedTbsCertificate() {}
156 160
157 bool VerifySerialNumber(const der::Input& value) { 161 bool VerifySerialNumber(const der::Input& value) {
158 bool unused_negative; 162 bool unused_negative;
159 if (!der::IsValidInteger(value, &unused_negative)) 163 if (!der::IsValidInteger(value, &unused_negative))
160 return false; 164 return false;
161 165
162 // Check if the serial number is too long per RFC 5280. 166 // Check if the serial number is too long per RFC 5280.
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 // 573 //
570 // When the keyUsage extension appears in a certificate, at least 574 // When the keyUsage extension appears in a certificate, at least
571 // one of the bits MUST be set to 1. 575 // one of the bits MUST be set to 1.
572 if (BitStringIsAllZeros(*key_usage)) 576 if (BitStringIsAllZeros(*key_usage))
573 return false; 577 return false;
574 578
575 return true; 579 return true;
576 } 580 }
577 581
578 } // namespace net 582 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/parse_certificate.h ('k') | net/cert/internal/verify_certificate_chain.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698