| Index: net/der/parser.cc
|
| diff --git a/net/der/parser.cc b/net/der/parser.cc
|
| index 1d9cbc51086b00a7470addbe0d0448fdf03ecc90..b69b6273ed6c9281e795004c75722d7dbf46af58 100644
|
| --- a/net/der/parser.cc
|
| +++ b/net/der/parser.cc
|
| @@ -186,6 +186,26 @@ 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* out_bytes) {
|
| + Input bytes;
|
| + uint8_t unused_bits;
|
| + if (!ReadBitString(&bytes, &unused_bits))
|
| + return false;
|
| +
|
| + if (unused_bits != 0)
|
| + return false;
|
| +
|
| + *out_bytes = bytes;
|
| + return true;
|
| +}
|
| +
|
| } // namespace der
|
|
|
| } // namespace net
|
|
|