asn1: Further IMPLICIT tagging fixes
Commit 89389bc7a
(asn1: Fix long-standing IMPLICIT tagging brokenness)
was incomplete. Removing the hacks in lib/asn1/cms.asn1 revealed this.
Now the ASN.1 compiler generates enums to indicate what is the class and
tag of each type. This is needed so the decoder functions generated by
the compiler can know what tag to restore.
Now, too, the compiler does handle IMPLICIT tags whose encoded length is
different from that of the underlying type.
However, we now don't handle indefinite BER and non-DER definite lengths
(DCE) following IMPLICIT tags. This would affect only CMS in-tree.
This commit is contained in:
@@ -642,6 +642,15 @@ der_match_tag2 (const unsigned char *p, size_t len,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns 0 if the encoded data at `p' of length `len' starts with the tag of
|
||||
* class `cls`, type `type', and tag value `tag', and puts the length of the
|
||||
* payload (i.e., the length of V in TLV, not the length of TLV) in
|
||||
* `*length_ret', and the size of the whole thing (the TLV) in `*size' if
|
||||
* `size' is not NULL.
|
||||
*
|
||||
* Else returns an error.
|
||||
*/
|
||||
int ASN1CALL
|
||||
der_match_tag_and_length (const unsigned char *p, size_t len,
|
||||
Der_class cls, Der_type *type, unsigned int tag,
|
||||
|
Reference in New Issue
Block a user