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, |