| OLD | NEW |
| 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/numerics/safe_math.h" | 6 #include "base/numerics/safe_math.h" |
| 7 #include "net/der/parse_values.h" | 7 #include "net/der/parse_values.h" |
| 8 #include "net/der/parser.h" | 8 #include "net/der/parser.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 if (!ReadTag(tag, &data)) | 172 if (!ReadTag(tag, &data)) |
| 173 return false; | 173 return false; |
| 174 *out = Parser(data); | 174 *out = Parser(data); |
| 175 return true; | 175 return true; |
| 176 } | 176 } |
| 177 | 177 |
| 178 bool Parser::ReadSequence(Parser* out) { | 178 bool Parser::ReadSequence(Parser* out) { |
| 179 return ReadConstructed(kSequence, out); | 179 return ReadConstructed(kSequence, out); |
| 180 } | 180 } |
| 181 | 181 |
| 182 bool Parser::ReadUint8(uint8_t* out) { |
| 183 Input encoded_int; |
| 184 if (!ReadTag(kInteger, &encoded_int)) |
| 185 return false; |
| 186 return ParseUint8(encoded_int, out); |
| 187 } |
| 188 |
| 182 bool Parser::ReadUint64(uint64_t* out) { | 189 bool Parser::ReadUint64(uint64_t* out) { |
| 183 Input encoded_int; | 190 Input encoded_int; |
| 184 if (!ReadTag(kInteger, &encoded_int)) | 191 if (!ReadTag(kInteger, &encoded_int)) |
| 185 return false; | 192 return false; |
| 186 return ParseUint64(encoded_int, out); | 193 return ParseUint64(encoded_int, out); |
| 187 } | 194 } |
| 188 | 195 |
| 189 bool Parser::ReadBitString(BitString* bit_string) { | 196 bool Parser::ReadBitString(BitString* bit_string) { |
| 190 Input value; | 197 Input value; |
| 191 if (!ReadTag(kBitString, &value)) | 198 if (!ReadTag(kBitString, &value)) |
| 192 return false; | 199 return false; |
| 193 return ParseBitString(value, bit_string); | 200 return ParseBitString(value, bit_string); |
| 194 } | 201 } |
| 195 | 202 |
| 203 bool Parser::ReadGeneralizedTime(GeneralizedTime* out) { |
| 204 Input value; |
| 205 if (!ReadTag(kGeneralizedTime, &value)) |
| 206 return false; |
| 207 return ParseGeneralizedTime(value, out); |
| 208 } |
| 209 |
| 196 } // namespace der | 210 } // namespace der |
| 197 | 211 |
| 198 } // namespace net | 212 } // namespace net |
| OLD | NEW |