X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fx509v3%2Fv3_enum.c;h=010c9d6260a92939a7f5679a620800db10f4f5b6;hp=017f6f3607afc5c10471cd4ccdb19b191cbdf265;hb=51eb1b81f6970312e6324ed9cdad6ccb7758f633;hpb=c74f1eb9bde5c66be3d6685dcc395f39a53add55 diff --git a/crypto/x509v3/v3_enum.c b/crypto/x509v3/v3_enum.c index 017f6f3607..010c9d6260 100644 --- a/crypto/x509v3/v3_enum.c +++ b/crypto/x509v3/v3_enum.c @@ -57,12 +57,8 @@ */ #include -#include -#include -#include -#include "x509v3.h" - -static ASN1_ENUMERATED *asn1_enumerated_new(); +#include "cryptlib.h" +#include static ENUMERATED_NAMES crl_reasons[] = { {0, "Unspecified", "unspecified"}, @@ -77,29 +73,22 @@ static ENUMERATED_NAMES crl_reasons[] = { }; X509V3_EXT_METHOD v3_crl_reason = { -NID_crl_reason, 0, -(X509V3_EXT_NEW)asn1_enumerated_new, ASN1_STRING_free, -(X509V3_EXT_D2I)d2i_ASN1_ENUMERATED, -i2d_ASN1_ENUMERATED, +NID_crl_reason, 0, ASN1_ITEM_ref(ASN1_ENUMERATED), +0,0,0,0, (X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE, -(X509V3_EXT_S2I)NULL, -NULL, NULL, NULL, (char *)crl_reasons}; - +0, +0,0,0,0, +crl_reasons}; -static ASN1_ENUMERATED *asn1_enumerated_new() -{ - return ASN1_ENUMERATED_new(); -} -char *i2s_ASN1_ENUMERATED_TABLE(method, e) -X509V3_EXT_METHOD *method; -ASN1_ENUMERATED *e; +char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, + ASN1_ENUMERATED *e) { ENUMERATED_NAMES *enam; long strval; strval = ASN1_ENUMERATED_get(e); - for(enam =(ENUMERATED_NAMES *)method->usr_data; enam->lname; enam++) { - if(strval == enam->bitnum) return str_dup(enam->lname); + for(enam = method->usr_data; enam->lname; enam++) { + if(strval == enam->bitnum) return BUF_strdup(enam->lname); } return i2s_ASN1_ENUMERATED(method, e); }