Index: net/der/parser.cc |
diff --git a/net/der/parser.cc b/net/der/parser.cc |
index 1d9cbc51086b00a7470addbe0d0448fdf03ecc90..c42d4200d6e6f721bcc70362db816636ed8d2300 100644 |
--- a/net/der/parser.cc |
+++ b/net/der/parser.cc |
@@ -186,6 +186,20 @@ bool Parser::ReadUint64(uint64_t* out) { |
return ParseUint64(encoded_int, out); |
} |
+bool Parser::ReadBitString(Input* bytes, uint8_t* unused_bits) { |
+ Input value; |
+ if (!ReadTag(kBitString, &value)) |
+ return false; |
+ return ParseBitString(value, bytes, unused_bits); |
+} |
+ |
+bool Parser::ReadBitStringNoUnusedBits(Input* bytes) { |
+ uint8_t unused_bits; |
+ if (!ReadBitString(bytes, &unused_bits)) |
+ return false; |
+ 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.
|
+} |
+ |
} // namespace der |
} // namespace net |