Use basename of objxref.pl not whole path in generated header.
[oweals/openssl.git] / crypto / asn1 / asn1_gen.c
index a0f7e452f68580eee4af60608555680188f3f90f..ec18cbff4f90383ccee24b03b216241b7383fa9e 100644 (file)
@@ -145,7 +145,7 @@ ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)
        unsigned char *p;
        const unsigned char *cp;
        int cpy_len;
-       size_t hdr_len;
+       long hdr_len;
        int hdr_constructed = 0, hdr_tag, hdr_class;
        int r;
 
@@ -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);