Chromium Code Reviews| Index: net/der/parser.h |
| diff --git a/net/der/parser.h b/net/der/parser.h |
| index 2192371d6c62890aea9426acb052d61071100033..5fd583c2e7ab08ad37133f7ba84ac9e0bb32f6a7 100644 |
| --- a/net/der/parser.h |
| +++ b/net/der/parser.h |
| @@ -19,6 +19,7 @@ namespace net { |
| namespace der { |
| class BitString; |
| +struct GeneralizedTime; |
| // Parses a DER-encoded ASN.1 structure. DER (distinguished encoding rules) |
| // encodes each data value with a tag, length, and value (TLV). The tag |
| @@ -146,6 +147,15 @@ class NET_EXPORT Parser { |
| // to be 0x30 (SEQUENCE). |
| bool ReadSequence(Parser* out) WARN_UNUSED_RESULT; |
| + // Expects the current tag to be kInteger, and calls ParseUint8 on the |
| + // current value. Note that DER-encoded integers are arbitrary precision, |
| + // so this method will fail for valid input that represents an integer |
| + // outside the range of an int8_t. |
|
eroman
2016/02/19 02:27:34
uint8_t right?
svaldez
2016/02/19 15:13:55
Done.
|
| + // |
| + // Note that on failure the Parser is left in an undefined state (the |
| + // input may or may not have been advanced). |
| + bool ReadUint8(uint8_t* out) WARN_UNUSED_RESULT; |
| + |
| // Expects the current tag to be kInteger, and calls ParseUint64 on the |
| // current value. Note that DER-encoded integers are arbitrary precision, |
| // so this method will fail for valid input that represents an integer |
| @@ -161,6 +171,12 @@ class NET_EXPORT Parser { |
| // input may or may not have been advanced). |
| bool ReadBitString(BitString* out) WARN_UNUSED_RESULT; |
| + // Reads a GeneralizeTime. On success fills |out| and returns true. |
| + // |
| + // Note that on failure the Parser is left in an undefined state (the |
| + // input may or may not have been advanced). |
| + bool ReadGeneralizedTime(GeneralizedTime* out) WARN_UNUSED_RESULT; |
| + |
| // Lower level methods. The previous methods couple reading data from the |
| // input with advancing the Parser's internal pointer to the next TLV; these |
| // lower level methods decouple those two steps into methods that read from |