| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/crl_set_storage.h" | 5 #include "net/cert/crl_set_storage.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return NULL; | 125 return NULL; |
| 126 | 126 |
| 127 const base::StringPiece header_bytes(data->data(), header_len); | 127 const base::StringPiece header_bytes(data->data(), header_len); |
| 128 data->remove_prefix(header_len); | 128 data->remove_prefix(header_len); |
| 129 | 129 |
| 130 std::unique_ptr<base::Value> header = | 130 std::unique_ptr<base::Value> header = |
| 131 base::JSONReader::Read(header_bytes, base::JSON_ALLOW_TRAILING_COMMAS); | 131 base::JSONReader::Read(header_bytes, base::JSON_ALLOW_TRAILING_COMMAS); |
| 132 if (header.get() == NULL) | 132 if (header.get() == NULL) |
| 133 return NULL; | 133 return NULL; |
| 134 | 134 |
| 135 if (!header->IsType(base::Value::TYPE_DICTIONARY)) | 135 if (!header->IsType(base::Value::Type::DICTIONARY)) |
| 136 return NULL; | 136 return NULL; |
| 137 return static_cast<base::DictionaryValue*>(header.release()); | 137 return static_cast<base::DictionaryValue*>(header.release()); |
| 138 } | 138 } |
| 139 | 139 |
| 140 // kCurrentFileVersion is the version of the CRLSet file format that we | 140 // kCurrentFileVersion is the version of the CRLSet file format that we |
| 141 // currently implement. | 141 // currently implement. |
| 142 static const int kCurrentFileVersion = 0; | 142 static const int kCurrentFileVersion = 0; |
| 143 | 143 |
| 144 static bool ReadCRL(base::StringPiece* data, std::string* out_parent_spki_hash, | 144 static bool ReadCRL(base::StringPiece* data, std::string* out_parent_spki_hash, |
| 145 std::vector<std::string>* out_serials) { | 145 std::vector<std::string>* out_serials) { |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 memcpy(out + off, j->data(), j->size()); | 545 memcpy(out + off, j->data(), j->size()); |
| 546 off += j->size(); | 546 off += j->size(); |
| 547 } | 547 } |
| 548 } | 548 } |
| 549 | 549 |
| 550 CHECK_EQ(off, len); | 550 CHECK_EQ(off, len); |
| 551 return ret; | 551 return ret; |
| 552 } | 552 } |
| 553 | 553 |
| 554 } // namespace net | 554 } // namespace net |
| OLD | NEW |