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

Unified Diff: net/cert/internal/test_helpers.cc

Issue 1214933009: Class for parsing and evaluating RFC 5280 NameConstraints. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compare_DN2
Patch Set: changes for comment #16 Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/internal/test_helpers.h ('k') | net/cert/internal/verify_name_match.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/test_helpers.cc
diff --git a/net/cert/internal/test_helpers.cc b/net/cert/internal/test_helpers.cc
index 0b5363d8acc7da720b37c2698226f91a189a9c0a..18e1f6ca74e72fd1744dcd19560293b16206d665 100644
--- a/net/cert/internal/test_helpers.cc
+++ b/net/cert/internal/test_helpers.cc
@@ -9,6 +9,8 @@
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "net/cert/pem_tokenizer.h"
+#include "net/der/parser.h"
+#include "testing/gtest/include/gtest/gtest.h"
namespace net {
@@ -34,6 +36,20 @@ der::Input InputFromString(const std::string* s) {
return der::Input(reinterpret_cast<const uint8_t*>(s->data()), s->size());
}
+der::Input SequenceValueFromString(const std::string* s) {
+ der::Parser parser(InputFromString(s));
+ der::Input data;
+ if (!parser.ReadTag(der::kSequence, &data)) {
+ ADD_FAILURE();
+ return der::Input();
+ }
+ if (parser.HasMore()) {
+ ADD_FAILURE();
+ return der::Input();
+ }
+ return data;
+}
+
::testing::AssertionResult ReadTestDataFromPemFile(
const std::string& file_path_ascii,
const PemBlockMapping* mappings,
« no previous file with comments | « net/cert/internal/test_helpers.h ('k') | net/cert/internal/verify_name_match.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698