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

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

Issue 1279963003: Add a function for parsing RFC 5280's "TBSCertificate". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_mapper
Patch Set: more reformatting Created 5 years, 4 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/test_helpers.h" 5 #include "net/cert/internal/test_helpers.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 mapping.value->assign(pem_tokenizer.data()); 76 mapping.value->assign(pem_tokenizer.data());
77 77
78 // Mark the mapping as having been satisfied. 78 // Mark the mapping as having been satisfied.
79 mapping.value = nullptr; 79 mapping.value = nullptr;
80 } 80 }
81 } 81 }
82 } 82 }
83 83
84 // Ensure that all specified blocks were found. 84 // Ensure that all specified blocks were found.
85 for (const auto& mapping : mappings_copy) { 85 for (const auto& mapping : mappings_copy) {
86 if (mapping.value) { 86 if (mapping.value && !mapping.optional) {
87 return ::testing::AssertionFailure() << "PEM block missing: " 87 return ::testing::AssertionFailure() << "PEM block missing: "
88 << mapping.block_name; 88 << mapping.block_name;
89 } 89 }
90 } 90 }
91 91
92 return ::testing::AssertionSuccess(); 92 return ::testing::AssertionSuccess();
93 } 93 }
94 94
95 } // namespace net 95 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698