diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2006-11-16 00:19:39 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2006-11-16 00:19:39 +0000 |
commit | de12116417081f7b834bca4a583f97169040ce52 (patch) | |
tree | 84f4f8286418d1fc35d1837019701277a208e921 /crypto/asn1/asn1_gen.c | |
parent | 28b987aec9474e8c0cf1cc12273018edf3a1eca1 (diff) |
Initial, incomplete support for typesafe macros without using function
casts.
Diffstat (limited to 'crypto/asn1/asn1_gen.c')
-rw-r--r-- | crypto/asn1/asn1_gen.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c index e21c05e1d0..a6cd1ad20e 100644 --- a/crypto/asn1/asn1_gen.c +++ b/crypto/asn1/asn1_gen.c @@ -442,9 +442,9 @@ static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf) ASN1_TYPE *ret = NULL; STACK_OF(ASN1_TYPE) *sk = NULL; STACK_OF(CONF_VALUE) *sect = NULL; - unsigned char *der = NULL, *p; + unsigned char *der = NULL; int derlen; - int i, is_set; + int i; sk = sk_ASN1_TYPE_new_null(); if (section) { @@ -465,17 +465,9 @@ static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf) /* Now we has a STACK of the components, convert to the correct form */ if (utype == V_ASN1_SET) - is_set = 1; + derlen = i2d_ASN1_SET_ANY(sk, &der); else - is_set = 0; - - - derlen = i2d_ASN1_SET_OF_ASN1_TYPE(sk, NULL, i2d_ASN1_TYPE, utype, - V_ASN1_UNIVERSAL, is_set); - der = OPENSSL_malloc(derlen); - p = der; - i2d_ASN1_SET_OF_ASN1_TYPE(sk, &p, i2d_ASN1_TYPE, utype, - V_ASN1_UNIVERSAL, is_set); + derlen = i2d_ASN1_SEQUENCE_ANY(sk, &der); if (!(ret = ASN1_TYPE_new())) goto bad; |