~andersk/ubuntu/oneiric/openssl/spurious-reboot

« back to all changes in this revision

Viewing changes to crypto/pem/pem_info.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-05-01 23:51:53 UTC
  • mfrom: (11.1.20 sid)
  • Revision ID: james.westby@ubuntu.com-20110501235153-bjcxitndquaezb68
Tags: 1.0.0d-2ubuntu1
* Resynchronise with Debian (LP: #675566).  Remaining changes:
  - debian/libssl1.0.0.postinst:
    + Display a system restart required notification bubble on libssl1.0.0
      upgrade.
    + Use a different priority for libssl1.0.0/restart-services depending
      on whether a desktop, or server dist-upgrade is being performed.
  - debian/{libssl1.0.0-udeb.dirs, control, rules}: Create
    libssl1.0.0-udeb, for the benefit of wget-udeb (no wget-udeb package
    in Debian).
  - debian/{libcrypto1.0.0-udeb.dirs, libssl1.0.0.dirs, libssl1.0.0.files,
    rules}: Move runtime libraries to /lib, for the benefit of
    wpasupplicant.
  - debian/patches/aesni.patch: Backport Intel AES-NI support, now from
    http://rt.openssl.org/Ticket/Display.html?id=2065 rather than the
    0.9.8 variant.
  - debian/patches/Bsymbolic-functions.patch: Link using
    -Bsymbolic-functions.
  - debian/patches/perlpath-quilt.patch: Don't change perl #! paths under
    .pc.
  - debian/rules:
    + Don't run 'make test' when cross-building.
    + Use host compiler when cross-building.  Patch from Neil Williams.
    + Don't build for processors no longer supported: i486, i586 (on
      i386), v8 (on sparc).
    + Fix Makefile to properly clean up libs/ dirs in clean target.
    + Replace duplicate files in the doc directory with symlinks.
* Update architectures affected by Bsymbolic-functions.patch.
* Drop debian/patches/no-sslv2.patch; Debian now adds the 'no-ssl2'
  configure option, which compiles out SSLv2 support entirely, so this is
  no longer needed.
* Drop openssl-doc in favour of the libssl-doc package introduced by
  Debian.  Add Conflicts/Replaces until the next LTS release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
        long len,error=0;
99
99
        int ok=0;
100
100
        STACK_OF(X509_INFO) *ret=NULL;
101
 
        unsigned int i,raw;
102
 
        d2i_of_void *d2i;
 
101
        unsigned int i,raw,ptype;
 
102
        d2i_of_void *d2i = 0;
103
103
 
104
104
        if (sk == NULL)
105
105
                {
116
116
        for (;;)
117
117
                {
118
118
                raw=0;
 
119
                ptype = 0;
119
120
                i=PEM_read_bio(bp,&name,&header,&data,&len);
120
121
                if (i == 0)
121
122
                        {
166
167
#ifndef OPENSSL_NO_RSA
167
168
                        if (strcmp(name,PEM_STRING_RSA) == 0)
168
169
                        {
169
 
                        d2i=(D2I_OF(void))d2i_RSAPrivateKey;
170
170
                        if (xi->x_pkey != NULL) 
171
171
                                {
172
172
                                if (!sk_X509_INFO_push(ret,xi)) goto err;
178
178
                        xi->enc_len=0;
179
179
 
180
180
                        xi->x_pkey=X509_PKEY_new();
181
 
                        if ((xi->x_pkey->dec_pkey=EVP_PKEY_new()) == NULL)
182
 
                                goto err;
183
 
                        xi->x_pkey->dec_pkey->type=EVP_PKEY_RSA;
184
 
                        pp=&(xi->x_pkey->dec_pkey->pkey.rsa);
 
181
                        ptype=EVP_PKEY_RSA;
 
182
                        pp=&xi->x_pkey->dec_pkey;
185
183
                        if ((int)strlen(header) > 10) /* assume encrypted */
186
184
                                raw=1;
187
185
                        }
202
200
                        xi->enc_len=0;
203
201
 
204
202
                        xi->x_pkey=X509_PKEY_new();
205
 
                        if ((xi->x_pkey->dec_pkey=EVP_PKEY_new()) == NULL)
206
 
                                goto err;
207
 
                        xi->x_pkey->dec_pkey->type=EVP_PKEY_DSA;
208
 
                        pp=&xi->x_pkey->dec_pkey->pkey.dsa;
 
203
                        ptype = EVP_PKEY_DSA;
 
204
                        pp=&xi->x_pkey->dec_pkey;
209
205
                        if ((int)strlen(header) > 10) /* assume encrypted */
210
206
                                raw=1;
211
207
                        }
226
222
                        xi->enc_len=0;
227
223
 
228
224
                        xi->x_pkey=X509_PKEY_new();
229
 
                        if ((xi->x_pkey->dec_pkey=EVP_PKEY_new()) == NULL)
230
 
                                goto err;
231
 
                        xi->x_pkey->dec_pkey->type=EVP_PKEY_EC;
232
 
                        pp=&(xi->x_pkey->dec_pkey->pkey.ec);
 
225
                        ptype = EVP_PKEY_EC;
 
226
                        pp=&xi->x_pkey->dec_pkey;
233
227
                        if ((int)strlen(header) > 10) /* assume encrypted */
234
228
                                raw=1;
235
229
                        }
251
245
                                if (!PEM_do_header(&cipher,data,&len,cb,u))
252
246
                                        goto err;
253
247
                                p=data;
254
 
                                if (d2i(pp,&p,len) == NULL)
 
248
                                if (ptype)
 
249
                                        {
 
250
                                        if (!d2i_PrivateKey(ptype, pp, &p, len))
 
251
                                                {
 
252
                                                PEMerr(PEM_F_PEM_X509_INFO_READ_BIO,ERR_R_ASN1_LIB);
 
253
                                                goto err;
 
254
                                                }
 
255
                                        }
 
256
                                else if (d2i(pp,&p,len) == NULL)
255
257
                                        {
256
258
                                        PEMerr(PEM_F_PEM_X509_INFO_READ_BIO,ERR_R_ASN1_LIB);
257
259
                                        goto err;
337
339
                {
338
340
                if ( (xi->enc_data!=NULL) && (xi->enc_len>0) )
339
341
                        {
 
342
                        if (enc == NULL)
 
343
                                {
 
344
                                PEMerr(PEM_F_PEM_X509_INFO_WRITE_BIO,PEM_R_CIPHER_IS_NULL);
 
345
                                goto err;
 
346
                                }
 
347
 
340
348
                        /* copy from weirdo names into more normal things */
341
349
                        iv=xi->enc_cipher.iv;
342
350
                        data=(unsigned char *)xi->enc_data;