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

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

Issue 2872113002: Add parsing code for RFC 5280 PolicyConstraints. (Closed)
Patch Set: update ios bundle_data Created 3 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
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 "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "net/cert/internal/cert_errors.h" 10 #include "net/cert/internal/cert_errors.h"
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 // the broken encoding. 631 // the broken encoding.
632 } 632 }
633 633
634 // pathLenConstraint INTEGER (0..MAX) OPTIONAL } 634 // pathLenConstraint INTEGER (0..MAX) OPTIONAL }
635 der::Input encoded_path_len; 635 der::Input encoded_path_len;
636 if (!sequence_parser.ReadOptionalTag(der::kInteger, &encoded_path_len, 636 if (!sequence_parser.ReadOptionalTag(der::kInteger, &encoded_path_len,
637 &out->has_path_len)) { 637 &out->has_path_len)) {
638 return false; 638 return false;
639 } 639 }
640 if (out->has_path_len) { 640 if (out->has_path_len) {
641 // TODO(eroman): Surface reason for failure if length was longer than uint8.
641 if (!der::ParseUint8(encoded_path_len, &out->path_len)) 642 if (!der::ParseUint8(encoded_path_len, &out->path_len))
642 return false; 643 return false;
643 } else { 644 } else {
644 // Default initialize to 0 as a precaution. 645 // Default initialize to 0 as a precaution.
645 out->path_len = 0; 646 out->path_len = 0;
646 } 647 }
647 648
648 // There shouldn't be any unconsumed data in the extension. 649 // There shouldn't be any unconsumed data in the extension.
649 if (sequence_parser.HasMore()) 650 if (sequence_parser.HasMore())
650 return false; 651 return false;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 out_ca_issuers_uris->push_back(uri); 724 out_ca_issuers_uris->push_back(uri);
724 else if (access_method_oid == AdOcspOid()) 725 else if (access_method_oid == AdOcspOid())
725 out_ocsp_uris->push_back(uri); 726 out_ocsp_uris->push_back(uri);
726 } 727 }
727 } 728 }
728 729
729 return true; 730 return true;
730 } 731 }
731 732
732 } // namespace net 733 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/certificate_policies_unittest.cc ('k') | net/cert/internal/parsed_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698