Chromium Code Reviews| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 return ReadConstructed(kSequence, out); | 179 return ReadConstructed(kSequence, out); |
| 180 } | 180 } |
| 181 | 181 |
| 182 bool Parser::ReadUint64(uint64_t* out) { | 182 bool Parser::ReadUint64(uint64_t* out) { |
| 183 Input encoded_int; | 183 Input encoded_int; |
| 184 if (!ReadTag(kInteger, &encoded_int)) | 184 if (!ReadTag(kInteger, &encoded_int)) |
| 185 return false; | 185 return false; |
| 186 return ParseUint64(encoded_int, out); | 186 return ParseUint64(encoded_int, out); |
| 187 } | 187 } |
| 188 | 188 |
| 189 bool Parser::ReadBitString(Input* bytes, uint8_t* unused_bits) { | |
| 190 Input value; | |
| 191 if (!ReadTag(kBitString, &value)) | |
| 192 return false; | |
| 193 return ParseBitString(value, bytes, unused_bits); | |
| 194 } | |
| 195 | |
| 196 bool Parser::ReadBitStringNoUnusedBits(Input* bytes) { | |
| 197 uint8_t unused_bits; | |
| 198 if (!ReadBitString(bytes, &unused_bits)) | |
| 199 return false; | |
| 200 return unused_bits == 0; | |
|
nharper
2015/07/21 23:23:47
This approach results in modifying *bytes even if
eroman
2015/07/22 17:05:23
Done.
| |
| 201 } | |
| 202 | |
| 189 } // namespace der | 203 } // namespace der |
| 190 | 204 |
| 191 } // namespace net | 205 } // namespace net |
| OLD | NEW |