~ubuntu-branches/ubuntu/jaunty/nss/jaunty-proposed

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/certdb/certdb.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack, Fabien Tassin, Alexander Sack
  • Date: 2009-01-11 15:06:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090111150617-iz4lw05qgy2odorl
Tags: 3.12.2~rc1-0ubuntu1
* New upstream snapshot: 3.12.2 RC1

[ Fabien Tassin <fta@ubuntu.com> ]
* Remove patch applied upstream:
  - drop debian/patches/80_security_tools.patch
  - update debian/patches/series
* Update diverged patches:
  - update debian/patches/38_kbsd.patch
  - update debian/patches/38_mips64_build.patch
* Add new symbols to symbols file
  - update debian/libnss3-1d.symbols

[ Alexander Sack <asac@ubuntu.com> ]
* disable soname patch to become binary compatible with upstream
  - update debian/patches/series
* flip links: libnss3.so <- libnss3.so.1d (before: libnss3.so ->
  libnss3.so.1d); same link flipping was done for all other previously
  soname patched libs: libnssutil3.so, libsmime3.so.1d, libssl3.so.1d
  - update debian/libnss3-1d.links
  - update debian/libnss3-1d.symbols
* properly transition links in preinst and postrm; also cover abort-
  cases in the other maintainer scripts
  - add debian/libnss3-1d.postinst
  - add debian/libnss3-1d.postrm
  - add debian/libnss3-1d.preinst
  - add debian/libnss3-1d.prerm
* remove hack from debian/rules that debian uses to recreate
  libsoftokn3.so with a versioned SONAME
  - update debian/rules
* install the unversioned .so binaries
  - update debian/rules
* only install the 4 main libraries into /usr/lib; all the others
  go to pkglibdir
  - update debian/rules
* higher bar for libnspr4 Build-Depend to >= 4.7.3~, which is
  the version where the soname droppage is going to happen
  - update debian/control
* explitily pass libraries to be used for dpkg-gensymbols run of
  dh_makeshlibs
  - update debian/rules
* fix lintian complain about no-shlibs-control-file
  - update debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
/*
39
39
 * Certificate handling code
40
40
 *
41
 
 * $Id: certdb.c,v 1.91 2008/03/15 02:15:34 alexei.volkov.bugs%sun.com Exp $
 
41
 * $Id: certdb.c,v 1.92 2008/05/16 03:38:39 nelson%bolyard.com Exp $
42
42
 */
43
43
 
44
44
#include "nssilock.h"
1489
1489
    unsigned int      hnLen;
1490
1490
    int               DNSextCount    = 0;
1491
1491
    int               IPextCount     = 0;
1492
 
    PRBool            isIPaddr;
 
1492
    PRBool            isIPaddr       = PR_FALSE;
1493
1493
    SECStatus         rv             = SECFailure;
1494
1494
    SECItem           subAltName;
1495
1495
    PRNetAddr         netAddr;
1503
1503
    rv = CERT_FindCertExtension(cert, SEC_OID_X509_SUBJECT_ALT_NAME, 
1504
1504
                                &subAltName);
1505
1505
    if (rv != SECSuccess) {
1506
 
        goto finish;
 
1506
        goto fail;
1507
1507
    }
1508
1508
    isIPaddr = (PR_SUCCESS == PR_StringToNetAddr(hn, &netAddr));
1509
1509
    rv = SECFailure;
1510
1510
    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
1511
1511
    if (!arena) 
1512
 
        goto finish;
 
1512
        goto fail;
1513
1513
 
1514
1514
    nameList = current = CERT_DecodeAltNameExtension(arena, &subAltName);
1515
1515
    if (!current)
1516
 
        goto finish;
 
1516
        goto fail;
1517
1517
 
1518
1518
    do {
1519
1519
        switch (current->type) {
1527
1527
                    cnBufLen = cnLen + 1;
1528
1528
                    cn = (char *)PORT_ArenaAlloc(arena, cnBufLen);
1529
1529
                    if (!cn)
1530
 
                        goto finish;
 
1530
                        goto fail;
1531
1531
                }
1532
1532
                PORT_Memcpy(cn, current->name.other.data, cnLen);
1533
1533
                cn[cnLen] = 0;
1579
1579
        current = CERT_GetNextGeneralName(current);
1580
1580
    } while (current != nameList);
1581
1581
 
1582
 
    if ((!isIPaddr && !DNSextCount) || (isIPaddr && !IPextCount)) {
 
1582
fail:
 
1583
 
 
1584
    if (!(isIPaddr ? IPextCount : DNSextCount)) {
1583
1585
        /* no relevant value in the extension was found. */
1584
1586
        PORT_SetError(SEC_ERROR_EXTENSION_NOT_FOUND);
1585
1587
    } else {