~ubuntu-branches/ubuntu/utopic/openssl/utopic

« back to all changes in this revision

Viewing changes to crypto/asn1/x_x509.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2011-04-02 13:19:19 UTC
  • mfrom: (1.2.1 upstream) (11.2.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 55.
  • Revision ID: james.westby@ubuntu.com-20110402131919-anszuslper64ey9e
Tags: 1.0.0d-1
* New upstream version
  - Fixes CVE-2011-0014
* Make libssl-doc Replaces/Breaks with old libssl-dev packages
  (Closes: #607609)
* Only export the symbols we should, instead of all.
* Add symbol file.
* Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
#include <openssl/x509.h>
64
64
#include <openssl/x509v3.h>
65
65
 
66
 
ASN1_SEQUENCE(X509_CINF) = {
 
66
ASN1_SEQUENCE_enc(X509_CINF, enc, 0) = {
67
67
        ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0),
68
68
        ASN1_SIMPLE(X509_CINF, serialNumber, ASN1_INTEGER),
69
69
        ASN1_SIMPLE(X509_CINF, signature, X509_ALGOR),
74
74
        ASN1_IMP_OPT(X509_CINF, issuerUID, ASN1_BIT_STRING, 1),
75
75
        ASN1_IMP_OPT(X509_CINF, subjectUID, ASN1_BIT_STRING, 2),
76
76
        ASN1_EXP_SEQUENCE_OF_OPT(X509_CINF, extensions, X509_EXTENSION, 3)
77
 
} ASN1_SEQUENCE_END(X509_CINF)
 
77
} ASN1_SEQUENCE_END_enc(X509_CINF, X509_CINF)
78
78
 
79
79
IMPLEMENT_ASN1_FUNCTIONS(X509_CINF)
80
80
/* X509 top level structure needs a bit of customisation */
81
81
 
82
82
extern void policy_cache_free(X509_POLICY_CACHE *cache);
83
83
 
84
 
static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it)
 
84
static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
 
85
                                                                void *exarg)
85
86
{
86
87
        X509 *ret = (X509 *)*pval;
87
88
 
99
100
                ret->rfc3779_asid = NULL;
100
101
#endif
101
102
                ret->aux = NULL;
 
103
                ret->crldp = NULL;
102
104
                CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data);
103
105
                break;
104
106
 
112
114
                X509_CERT_AUX_free(ret->aux);
113
115
                ASN1_OCTET_STRING_free(ret->skid);
114
116
                AUTHORITY_KEYID_free(ret->akid);
 
117
                CRL_DIST_POINTS_free(ret->crldp);
115
118
                policy_cache_free(ret->policy_cache);
 
119
                GENERAL_NAMES_free(ret->altname);
 
120
                NAME_CONSTRAINTS_free(ret->nc);
116
121
#ifndef OPENSSL_NO_RFC3779
117
122
                sk_IPAddressFamily_pop_free(ret->rfc3779_addr, IPAddressFamily_free);
118
123
                ASIdentifiers_free(ret->rfc3779_asid);
136
141
IMPLEMENT_ASN1_FUNCTIONS(X509)
137
142
IMPLEMENT_ASN1_DUP_FUNCTION(X509)
138
143
 
139
 
static ASN1_METHOD meth=
140
 
    {
141
 
    (I2D_OF(void))  i2d_X509,
142
 
    (D2I_OF(void)) d2i_X509,
143
 
    (void *(*)(void))X509_new,
144
 
    (void (*)(void *)) X509_free
145
 
    };
146
 
 
147
 
ASN1_METHOD *X509_asn1_meth(void)
148
 
        {
149
 
        return(&meth);
150
 
        }
151
 
 
152
144
int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
153
145
             CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
154
146
        {