-der_write_tags(asn_TYPE_descriptor_t *sd,
- size_t struct_length,
- int tag_mode, int last_tag_form,
- ber_tlv_tag_t tag, /* EXPLICIT or IMPLICIT tag */
- asn_app_consume_bytes_f *cb,
- void *app_key) {
- ber_tlv_tag_t *tags; /* Copy of tags stream */
- int tags_count; /* Number of tags */
- size_t overall_length;
- ssize_t *lens;
- int i;
-
- ASN_DEBUG("Writing tags (%s, tm=%d, tc=%d, tag=%s, mtc=%d)",
+der_write_tags(const asn_TYPE_descriptor_t *sd, size_t struct_length,
+ int tag_mode, int last_tag_form,
+ ber_tlv_tag_t tag, /* EXPLICIT or IMPLICIT tag */
+ asn_app_consume_bytes_f *cb, void *app_key) {
+#define ASN1_DER_MAX_TAGS_COUNT 4
+ ber_tlv_tag_t
+ tags_buf_scratch[ASN1_DER_MAX_TAGS_COUNT * sizeof(ber_tlv_tag_t)];
+ ssize_t lens[ASN1_DER_MAX_TAGS_COUNT * sizeof(ssize_t)];
+ const ber_tlv_tag_t *tags; /* Copy of tags stream */
+ int tags_count; /* Number of tags */
+ size_t overall_length;
+ int i;
+
+ ASN_DEBUG("Writing tags (%s, tm=%d, tc=%d, tag=%s, mtc=%d)",