~ubuntu-branches/ubuntu/jaunty/heimdal/jaunty

« back to all changes in this revision

Viewing changes to lib/hx509/crypto.c

  • Committer: Bazaar Package Importer
  • Author(s): Nick Ellery
  • Date: 2008-11-17 22:25:58 UTC
  • mfrom: (1.1.5 upstream) (2.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20081117222558-jd1aj1jth6ycdb0x
Tags: 1.2.dfsg.1-2.1ubuntu1
* Merge from debian unstable, remaining changes (LP: #299345):
  - Change libdb4.2-dev to libdb4.6-dev in build-deps
  - Add netbase to heimdal-kdc depends.
  - Set CPPFLAGS=-DLDAP_DEPRECATED to fix build with OpenLDAP 2.4 on
    64-bit architectures.
* Remove dependency on update-inetd to heimdal-servers and heimdal-kdc,
  as packages should rely on the inet-superserver to provide the
  update-inetd command.
* Drop the addition of -1 to the version of comerr-dev in build depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 */
33
33
 
34
34
#include "hx_locl.h"
35
 
RCSID("$Id: crypto.c 22435 2008-01-14 20:53:56Z lha $");
 
35
RCSID("$Id: crypto.c 22855 2008-04-07 18:49:24Z lha $");
36
36
 
37
37
struct hx509_crypto;
38
38
 
1592
1592
hx509_private_key
1593
1593
_hx509_private_key_ref(hx509_private_key key)
1594
1594
{
1595
 
    if (key->ref <= 0)
1596
 
        _hx509_abort("refcount <= 0");
 
1595
    if (key->ref == 0)
 
1596
        _hx509_abort("key refcount <= 0 on ref");
1597
1597
    key->ref++;
1598
 
    if (key->ref == 0)
1599
 
        _hx509_abort("refcount == 0");
 
1598
    if (key->ref == UINT_MAX)
 
1599
        _hx509_abort("key refcount == UINT_MAX on ref");
1600
1600
    return key;
1601
1601
}
1602
1602
 
1612
1612
    if (key == NULL || *key == NULL)
1613
1613
        return 0;
1614
1614
 
1615
 
    if ((*key)->ref <= 0)
1616
 
        _hx509_abort("refcount <= 0");
 
1615
    if ((*key)->ref == 0)
 
1616
        _hx509_abort("key refcount == 0 on free");
1617
1617
    if (--(*key)->ref > 0)
1618
1618
        return 0;
1619
1619