From ede6ef5e0813e87b27648c32d1d6de212d967d4e Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Tue, 10 Feb 2009 12:13:08 +0000 Subject: [PATCH] Submitted by: Peter Sylvester Reviewed by: steve If tagging is universal and SET or SEQUENCE set constructed bit. --- crypto/asn1/asn1_gen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c index 04395d2281..ec18cbff4f 100644 --- a/crypto/asn1/asn1_gen.c +++ b/crypto/asn1/asn1_gen.c @@ -245,8 +245,14 @@ ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf) /* If IMPLICIT, output tag */ if (asn1_tags.imp_tag != -1) + { + if (asn1_tags.imp_class == V_ASN1_UNIVERSAL + && (asn1_tags.imp_tag == V_ASN1_SEQUENCE + || asn1_tags.imp_tag == V_ASN1_SET) ) + hdr_constructed = V_ASN1_CONSTRUCTED; ASN1_put_object(&p, hdr_constructed, hdr_len, asn1_tags.imp_tag, asn1_tags.imp_class); + } /* Copy across original encoding */ memcpy(p, cpy_start, cpy_len); -- 2.25.1