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

Side by Side Diff: net/base/crl_set.cc

Issue 8427024: A quick fix for Mac GCC. (Closed) Base URL: svn://chrome-svn/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.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) 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 #include "base/base64.h" 5 #include "base/base64.h"
6 #include "base/json/json_reader.h" 6 #include "base/json/json_reader.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "crypto/sha2.h" 10 #include "crypto/sha2.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 403
404 *out_crl_set = crl_set; 404 *out_crl_set = crl_set;
405 return true; 405 return true;
406 } 406 }
407 407
408 CRLSet::Result CRLSet::CheckCertificate( 408 CRLSet::Result CRLSet::CheckCertificate(
409 const base::StringPiece& serial_number, 409 const base::StringPiece& serial_number,
410 const base::StringPiece& parent_spki) const { 410 const base::StringPiece& parent_spki) const {
411 base::StringPiece serial(serial_number); 411 base::StringPiece serial(serial_number);
412 412
413 if (!serial.empty() && serial[0] >= 0x80) { 413 if (!serial.empty() && (serial[0] & 0x80) != 0) {
414 // This serial number is negative but the process which generates CRL sets 414 // This serial number is negative but the process which generates CRL sets
415 // will reject any certificates with negative serial numbers as invalid. 415 // will reject any certificates with negative serial numbers as invalid.
416 return UNKNOWN; 416 return UNKNOWN;
417 } 417 }
418 418
419 // Remove any leading zero bytes. 419 // Remove any leading zero bytes.
420 while (serial.size() > 1 && serial[0] == 0x00) 420 while (serial.size() > 1 && serial[0] == 0x00)
421 serial.remove_prefix(1); 421 serial.remove_prefix(1);
422 422
423 std::map<std::string, size_t>::const_iterator i = 423 std::map<std::string, size_t>::const_iterator i =
(...skipping 21 matching lines...) Expand all
445 445
446 uint32 CRLSet::sequence() const { 446 uint32 CRLSet::sequence() const {
447 return sequence_; 447 return sequence_;
448 } 448 }
449 449
450 const CRLSet::CRLList& CRLSet::crls() const { 450 const CRLSet::CRLList& CRLSet::crls() const {
451 return crls_; 451 return crls_;
452 } 452 }
453 453
454 } // namespace net 454 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/base/x509_certificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698