diff options
| author | beck <> | 2000-12-15 02:58:47 +0000 |
|---|---|---|
| committer | beck <> | 2000-12-15 02:58:47 +0000 |
| commit | 9200bb13d15da4b2a23e6bc92c20e95b74aa2113 (patch) | |
| tree | 5c52d628ec1e34be76e7ef2a4235d248b7c44d24 /src/lib/libcrypto/asn1/x_x509.c | |
| parent | e131d25072e3d4197ba4b9bcc0d1b27d34d6488d (diff) | |
| download | openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.tar.gz openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.tar.bz2 openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.zip | |
openssl-engine-0.9.6 merge
Diffstat (limited to 'src/lib/libcrypto/asn1/x_x509.c')
| -rw-r--r-- | src/lib/libcrypto/asn1/x_x509.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/libcrypto/asn1/x_x509.c b/src/lib/libcrypto/asn1/x_x509.c index 11e564ea30..61ba856b17 100644 --- a/src/lib/libcrypto/asn1/x_x509.c +++ b/src/lib/libcrypto/asn1/x_x509.c | |||
| @@ -61,6 +61,7 @@ | |||
| 61 | #include <openssl/evp.h> | 61 | #include <openssl/evp.h> |
| 62 | #include <openssl/asn1_mac.h> | 62 | #include <openssl/asn1_mac.h> |
| 63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
| 64 | #include <openssl/x509v3.h> | ||
| 64 | 65 | ||
| 65 | static int x509_meth_num = 0; | 66 | static int x509_meth_num = 0; |
| 66 | static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_meth = NULL; | 67 | static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_meth = NULL; |
| @@ -102,7 +103,7 @@ X509 *d2i_X509(X509 **a, unsigned char **pp, long length) | |||
| 102 | M_ASN1_D2I_get(ret->cert_info,d2i_X509_CINF); | 103 | M_ASN1_D2I_get(ret->cert_info,d2i_X509_CINF); |
| 103 | M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR); | 104 | M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR); |
| 104 | M_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING); | 105 | M_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING); |
| 105 | if (ret->name != NULL) Free(ret->name); | 106 | if (ret->name != NULL) OPENSSL_free(ret->name); |
| 106 | ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0); | 107 | ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0); |
| 107 | 108 | ||
| 108 | M_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509); | 109 | M_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509); |
| @@ -114,11 +115,14 @@ X509 *X509_new(void) | |||
| 114 | ASN1_CTX c; | 115 | ASN1_CTX c; |
| 115 | 116 | ||
| 116 | M_ASN1_New_Malloc(ret,X509); | 117 | M_ASN1_New_Malloc(ret,X509); |
| 117 | ret->references=1; | ||
| 118 | ret->valid=0; | 118 | ret->valid=0; |
| 119 | ret->references=1; | ||
| 120 | ret->name = NULL; | ||
| 119 | ret->ex_flags = 0; | 121 | ret->ex_flags = 0; |
| 120 | ret->name=NULL; | 122 | ret->ex_pathlen = -1; |
| 121 | ret->aux=NULL; | 123 | ret->skid = NULL; |
| 124 | ret->akid = NULL; | ||
| 125 | ret->aux = NULL; | ||
| 122 | M_ASN1_New(ret->cert_info,X509_CINF_new); | 126 | M_ASN1_New(ret->cert_info,X509_CINF_new); |
| 123 | M_ASN1_New(ret->sig_alg,X509_ALGOR_new); | 127 | M_ASN1_New(ret->sig_alg,X509_ALGOR_new); |
| 124 | M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new); | 128 | M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new); |
| @@ -151,9 +155,11 @@ void X509_free(X509 *a) | |||
| 151 | X509_ALGOR_free(a->sig_alg); | 155 | X509_ALGOR_free(a->sig_alg); |
| 152 | M_ASN1_BIT_STRING_free(a->signature); | 156 | M_ASN1_BIT_STRING_free(a->signature); |
| 153 | X509_CERT_AUX_free(a->aux); | 157 | X509_CERT_AUX_free(a->aux); |
| 158 | ASN1_OCTET_STRING_free(a->skid); | ||
| 159 | AUTHORITY_KEYID_free(a->akid); | ||
| 154 | 160 | ||
| 155 | if (a->name != NULL) Free(a->name); | 161 | if (a->name != NULL) OPENSSL_free(a->name); |
| 156 | Free(a); | 162 | OPENSSL_free(a); |
| 157 | } | 163 | } |
| 158 | 164 | ||
| 159 | int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 165 | int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
