~ubuntu-branches/ubuntu/oneiric/openssl/oneiric

« back to all changes in this revision

Viewing changes to crypto/asn1/asn1_lib.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:
340
340
        return(1);
341
341
        }
342
342
 
343
 
ASN1_STRING *ASN1_STRING_dup(ASN1_STRING *str)
 
343
int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str)
 
344
        {
 
345
        if (str == NULL)
 
346
                return 0;
 
347
        dst->type = str->type;
 
348
        if (!ASN1_STRING_set(dst,str->data,str->length))
 
349
                return 0;
 
350
        dst->flags = str->flags;
 
351
        return 1;
 
352
        }
 
353
 
 
354
ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str)
344
355
        {
345
356
        ASN1_STRING *ret;
346
 
 
347
 
        if (str == NULL) return(NULL);
348
 
        if ((ret=ASN1_STRING_type_new(str->type)) == NULL)
349
 
                return(NULL);
350
 
        if (!ASN1_STRING_set(ret,str->data,str->length))
 
357
        if (!str)
 
358
                 return NULL;
 
359
        ret=ASN1_STRING_new();
 
360
        if (!ret)
 
361
                return NULL;
 
362
        if (!ASN1_STRING_copy(ret,str))
351
363
                {
352
364
                ASN1_STRING_free(ret);
353
 
                return(NULL);
 
365
                return NULL;
354
366
                }
355
 
        ret->flags = str->flags;
356
 
        return(ret);
 
367
        return ret;
357
368
        }
358
369
 
359
370
int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)
427
438
void ASN1_STRING_free(ASN1_STRING *a)
428
439
        {
429
440
        if (a == NULL) return;
430
 
        if (a->data != NULL) OPENSSL_free(a->data);
 
441
        if (a->data && !(a->flags & ASN1_STRING_FLAG_NDEF))
 
442
                OPENSSL_free(a->data);
431
443
        OPENSSL_free(a);
432
444
        }
433
445
 
434
 
int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b)
 
446
int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
435
447
        {
436
448
        int i;
437
449
 
457
469
        ERR_add_error_data(4,"address=",buf1," offset=",buf2);
458
470
        }
459
471
 
460
 
int ASN1_STRING_length(ASN1_STRING *x)
 
472
int ASN1_STRING_length(const ASN1_STRING *x)
461
473
{ return M_ASN1_STRING_length(x); }
462
474
 
463
475
void ASN1_STRING_length_set(ASN1_STRING *x, int len)