| Index: net/base/asn1_util.h
|
| diff --git a/net/base/asn1_util.h b/net/base/asn1_util.h
|
| index ea6277ac0345bac929552a9e7a4bbf5ea9101e24..dc9982be8d463a77798625d09da24dc53525ce58 100644
|
| --- a/net/base/asn1_util.h
|
| +++ b/net/base/asn1_util.h
|
| @@ -24,10 +24,12 @@ static const unsigned kSEQUENCE = 0x30;
|
|
|
| // These are flags that can be ORed with the above tag numbers.
|
| static const unsigned kContextSpecific = 0x80;
|
| -static const unsigned kCompound = 0x20;
|
| +static const unsigned kConstructed = 0x20;
|
|
|
| // kAny matches any tag value;
|
| static const unsigned kAny = 0x10000;
|
| +// kOptional denotes an optional element.
|
| +static const unsigned kOptional = 0x20000;
|
|
|
| // ParseElement parses a DER encoded ASN1 element from |in|, requiring that
|
| // it have the given |tag_value|. It returns true on success. The following
|
| @@ -38,6 +40,9 @@ static const unsigned kAny = 0x10000;
|
| // |in| is advanced over the element
|
| // |out| contains the element, including the tag and length bytes.
|
| // |out_header_len| contains the length of the tag and length bytes in |out|.
|
| +//
|
| +// If |tag_value & kOptional| is true then *out_header_len can be zero after a
|
| +// true return value if the element was not found.
|
| bool ParseElement(base::StringPiece* in,
|
| unsigned tag_value,
|
| base::StringPiece* out,
|
| @@ -45,11 +50,13 @@ bool ParseElement(base::StringPiece* in,
|
|
|
| // GetElement performs the same actions as ParseElement, except that the header
|
| // bytes are not included in the output.
|
| +//
|
| +// If |tag_value & kOptional| is true then this function cannot distinguish
|
| +// between a missing optional element and an empty one.
|
| bool GetElement(base::StringPiece* in,
|
| unsigned tag_value,
|
| base::StringPiece* out);
|
|
|
| -
|
| // ExtractSPKIFromDERCert parses the DER encoded certificate in |cert| and
|
| // extracts the bytes of the SubjectPublicKeyInfo. On successful return,
|
| // |spki_out| is set to contain the SPKI, pointing into |cert|.
|
| @@ -63,6 +70,8 @@ NET_TEST bool ExtractSPKIFromDERCert(base::StringPiece cert,
|
| // CRLs that only cover a subset of the reasons are omitted as the spec
|
| // requires that at least one CRL be included that covers all reasons.
|
| //
|
| +// CRLs that use an alternative issuer are also omitted.
|
| +//
|
| // The nested set of GeneralNames is flattened into a single list because
|
| // having several CRLs with one location is equivalent to having one CRL with
|
| // several locations as far as a CRL filter is concerned.
|
|
|