Back to index

lightning-sunbird  0.9+nobinonly
Defines | Typedefs | Functions | Variables
trustdomain.c File Reference
#include "dev.h"
#include "pkim.h"
#include "pki1t.h"
#include "cert.h"
#include "pki3hack.h"
#include "nssrwlk.h"

Go to the source code of this file.

Defines

#define NSSTRUSTDOMAIN_DEFAULT_CACHE_SIZE   32

Typedefs

typedef PRUint32 nssUpdateLevel

Functions

NSS_IMPLEMENT NSSTrustDomain * NSSTrustDomain_Create (NSSUTF8 *moduleOpt, NSSUTF8 *uriOpt, NSSUTF8 *opaqueOpt, void *reserved)
static void token_destructor (void *t)
NSS_IMPLEMENT PRStatus NSSTrustDomain_Destroy (NSSTrustDomain *td)
static NSSSlot ** nssTrustDomain_GetActiveSlots (NSSTrustDomain *td, nssUpdateLevel *updateLevel)
static nssSession * nssTrustDomain_GetSessionForToken (NSSTrustDomain *td, NSSToken *token)
NSS_IMPLEMENT PRStatus NSSTrustDomain_SetDefaultCallback (NSSTrustDomain *td, NSSCallback *newCallback, NSSCallback **oldCallbackOpt)
NSS_IMPLEMENT NSSCallback * nssTrustDomain_GetDefaultCallback (NSSTrustDomain *td, PRStatus *statusOpt)
NSS_IMPLEMENT NSSCallback * NSSTrustDomain_GetDefaultCallback (NSSTrustDomain *td, PRStatus *statusOpt)
NSS_IMPLEMENT PRStatus NSSTrustDomain_LoadModule (NSSTrustDomain *td, NSSUTF8 *moduleOpt, NSSUTF8 *uriOpt, NSSUTF8 *opaqueOpt, void *reserved)
NSS_IMPLEMENT PRStatus NSSTrustDomain_DisableToken (NSSTrustDomain *td, NSSToken *token, NSSError why)
NSS_IMPLEMENT PRStatus NSSTrustDomain_EnableToken (NSSTrustDomain *td, NSSToken *token)
NSS_IMPLEMENT PRStatus NSSTrustDomain_IsTokenEnabled (NSSTrustDomain *td, NSSToken *token, NSSError *whyOpt)
NSS_IMPLEMENT NSSSlot * NSSTrustDomain_FindSlotByName (NSSTrustDomain *td, NSSUTF8 *slotName)
NSS_IMPLEMENT NSSToken * NSSTrustDomain_FindTokenByName (NSSTrustDomain *td, NSSUTF8 *tokenName)
NSS_IMPLEMENT NSSToken * NSSTrustDomain_FindTokenBySlotName (NSSTrustDomain *td, NSSUTF8 *slotName)
NSS_IMPLEMENT NSSToken * NSSTrustDomain_FindTokenForAlgorithm (NSSTrustDomain *td, NSSOID *algorithm)
NSS_IMPLEMENT NSSToken * NSSTrustDomain_FindBestTokenForAlgorithms (NSSTrustDomain *td, NSSOID *algorithms[], PRUint32 nAlgorithmsOpt)
NSS_IMPLEMENT PRStatus NSSTrustDomain_Login (NSSTrustDomain *td, NSSCallback *uhhOpt)
NSS_IMPLEMENT PRStatus NSSTrustDomain_Logout (NSSTrustDomain *td)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_ImportCertificate (NSSTrustDomain *td, NSSCertificate *c)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_ImportPKIXCertificate (NSSTrustDomain *td, struct NSSPKIXCertificateStr *pc)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_ImportEncodedCertificate (NSSTrustDomain *td, NSSBER *ber)
NSS_IMPLEMENT NSSCertificate ** NSSTrustDomain_ImportEncodedCertificateChain (NSSTrustDomain *td, NSSBER *ber, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSPrivateKey * NSSTrustDomain_ImportEncodedPrivateKey (NSSTrustDomain *td, NSSBER *ber, NSSItem *passwordOpt, NSSCallback *uhhOpt, NSSToken *destination)
NSS_IMPLEMENT NSSPublicKey * NSSTrustDomain_ImportEncodedPublicKey (NSSTrustDomain *td, NSSBER *ber)
static NSSCertificate ** get_certs_from_list (nssList *list)
NSS_IMPLEMENT NSSCertificate ** nssTrustDomain_FindCertificatesByNickname (NSSTrustDomain *td, NSSUTF8 *name, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate ** NSSTrustDomain_FindCertificatesByNickname (NSSTrustDomain *td, NSSUTF8 *name, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * nssTrustDomain_FindBestCertificateByNickname (NSSTrustDomain *td, NSSUTF8 *name, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_FindBestCertificateByNickname (NSSTrustDomain *td, NSSUTF8 *name, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** nssTrustDomain_FindCertificatesBySubject (NSSTrustDomain *td, NSSDER *subject, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate ** NSSTrustDomain_FindCertificatesBySubject (NSSTrustDomain *td, NSSDER *subject, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * nssTrustDomain_FindBestCertificateBySubject (NSSTrustDomain *td, NSSDER *subject, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_FindBestCertificateBySubject (NSSTrustDomain *td, NSSDER *subject, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_FindBestCertificateByNameComponents (NSSTrustDomain *td, NSSUTF8 *nameComponents, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** NSSTrustDomain_FindCertificatesByNameComponents (NSSTrustDomain *td, NSSUTF8 *nameComponents, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * nssTrustDomain_FindCertificateByIssuerAndSerialNumber (NSSTrustDomain *td, NSSDER *issuer, NSSDER *serial)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_FindCertificateByIssuerAndSerialNumber (NSSTrustDomain *td, NSSDER *issuer, NSSDER *serial)
NSS_IMPLEMENT NSSCertificate * nssTrustDomain_FindCertificateByEncodedCertificate (NSSTrustDomain *td, NSSBER *ber)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_FindCertificateByEncodedCertificate (NSSTrustDomain *td, NSSBER *ber)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_FindBestCertificateByEmail (NSSTrustDomain *td, NSSASCII7 *email, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** NSSTrustDomain_FindCertificatesByEmail (NSSTrustDomain *td, NSSASCII7 *email, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_FindCertificateByOCSPHash (NSSTrustDomain *td, NSSItem *hash)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_FindBestUserCertificate (NSSTrustDomain *td, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** NSSTrustDomain_FindUserCertificates (NSSTrustDomain *td, NSSTime *timeOpt, NSSUsage *usageOpt, NSSPolicies *policiesOpt, NSSCertificate **rvOpt, PRUint32 rvLimit, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_FindBestUserCertificateForSSLClientAuth (NSSTrustDomain *td, NSSUTF8 *sslHostOpt, NSSDER *rootCAsOpt[], PRUint32 rootCAsMaxOpt, NSSAlgorithmAndParameters *apOpt, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** NSSTrustDomain_FindUserCertificatesForSSLClientAuth (NSSTrustDomain *td, NSSUTF8 *sslHostOpt, NSSDER *rootCAsOpt[], PRUint32 rootCAsMaxOpt, NSSAlgorithmAndParameters *apOpt, NSSPolicies *policiesOpt, NSSCertificate **rvOpt, PRUint32 rvLimit, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * NSSTrustDomain_FindBestUserCertificateForEmailSigning (NSSTrustDomain *td, NSSASCII7 *signerOpt, NSSASCII7 *recipientOpt, NSSAlgorithmAndParameters *apOpt, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** NSSTrustDomain_FindUserCertificatesForEmailSigning (NSSTrustDomain *td, NSSASCII7 *signerOpt, NSSASCII7 *recipientOpt, NSSAlgorithmAndParameters *apOpt, NSSPolicies *policiesOpt, NSSCertificate **rvOpt, PRUint32 rvLimit, NSSArena *arenaOpt)
static PRStatus collector (nssCryptokiObject *instance, void *arg)
NSS_IMPLEMENT PRStatusNSSTrustDomain_TraverseCertificates (NSSTrustDomain *td, PRStatus(*callback)(NSSCertificate *c, void *arg), void *arg)
NSS_IMPLEMENT NSSTrust * nssTrustDomain_FindTrustForCertificate (NSSTrustDomain *td, NSSCertificate *c)
NSS_IMPLEMENT NSSCRL ** nssTrustDomain_FindCRLsBySubject (NSSTrustDomain *td, NSSDER *subject)
NSS_IMPLEMENT PRStatus NSSTrustDomain_GenerateKeyPair (NSSTrustDomain *td, NSSAlgorithmAndParameters *ap, NSSPrivateKey **pvkOpt, NSSPublicKey **pbkOpt, PRBool privateKeyIsSensitive, NSSToken *destination, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSSymmetricKey * NSSTrustDomain_GenerateSymmetricKey (NSSTrustDomain *td, NSSAlgorithmAndParameters *ap, PRUint32 keysize, NSSToken *destination, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSSymmetricKey * NSSTrustDomain_GenerateSymmetricKeyFromPassword (NSSTrustDomain *td, NSSAlgorithmAndParameters *ap, NSSUTF8 *passwordOpt, NSSToken *destinationOpt, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSSymmetricKey * NSSTrustDomain_FindSymmetricKeyByAlgorithmAndKeyID (NSSTrustDomain *td, NSSOID *algorithm, NSSItem *keyID, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSCryptoContext * nssTrustDomain_CreateCryptoContext (NSSTrustDomain *td, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSCryptoContext * NSSTrustDomain_CreateCryptoContext (NSSTrustDomain *td, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSCryptoContext * NSSTrustDomain_CreateCryptoContextForAlgorithm (NSSTrustDomain *td, NSSOID *algorithm)
NSS_IMPLEMENT NSSCryptoContext * NSSTrustDomain_CreateCryptoContextForAlgorithmAndParameters (NSSTrustDomain *td, NSSAlgorithmAndParameters *ap)

Variables

const NSSError NSS_ERROR_NOT_FOUND

Define Documentation

Definition at line 58 of file trustdomain.c.


Typedef Documentation

Definition at line 62 of file trustdomain.c.


Function Documentation

static PRStatus collector ( nssCryptokiObject *  instance,
void arg 
) [static]

Definition at line 1003 of file trustdomain.c.

{
    nssPKIObjectCollection *collection = (nssPKIObjectCollection *)arg;
    return nssPKIObjectCollection_AddInstanceAsObject(collection, instance);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static NSSCertificate** get_certs_from_list ( nssList *  list) [static]

Definition at line 413 of file trustdomain.c.

{
    PRUint32 count = nssList_Count(list);
    NSSCertificate **certs = NULL;
    if (count > 0) {
       certs = nss_ZNEWARRAY(NULL, NSSCertificate *, count + 1);
       if (certs) {
           nssList_GetArray(list, (void **)certs, count);
       }
    }
    return certs;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NSS_IMPLEMENT NSSTrustDomain* NSSTrustDomain_Create ( NSSUTF8 moduleOpt,
NSSUTF8 uriOpt,
NSSUTF8 opaqueOpt,
void reserved 
)

Definition at line 65 of file trustdomain.c.

{
    NSSArena *arena;
    NSSTrustDomain *rvTD;
    arena = NSSArena_Create();
    if(!arena) {
       return (NSSTrustDomain *)NULL;
    }
    rvTD = nss_ZNEW(arena, NSSTrustDomain);
    if (!rvTD) {
       goto loser;
    }
    /* protect the token list and the token iterator */
    rvTD->tokensLock = NSSRWLock_New(100, "tokens");
    if (!rvTD->tokensLock) {
       goto loser;
    }
    nssTrustDomain_InitializeCache(rvTD, NSSTRUSTDOMAIN_DEFAULT_CACHE_SIZE);
    rvTD->arena = arena;
    rvTD->refCount = 1;
    rvTD->statusConfig = NULL;
    return rvTD;
loser:
    if (rvTD && rvTD->tokensLock) {
       NSSRWLock_Destroy(rvTD->tokensLock);
    }
    nssArena_Destroy(arena);
    return (NSSTrustDomain *)NULL;
}
NSS_IMPLEMENT NSSCryptoContext* nssTrustDomain_CreateCryptoContext ( NSSTrustDomain *  td,
NSSCallback *  uhhOpt 
)

Definition at line 1354 of file trustdomain.c.

{
    return nssCryptoContext_Create(td, uhhOpt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NSS_IMPLEMENT NSSCryptoContext* NSSTrustDomain_CreateCryptoContext ( NSSTrustDomain *  td,
NSSCallback *  uhhOpt 
)

Definition at line 1363 of file trustdomain.c.

{
    return nssTrustDomain_CreateCryptoContext(td, uhhOpt);
}
NSS_IMPLEMENT NSSCryptoContext* NSSTrustDomain_CreateCryptoContextForAlgorithm ( NSSTrustDomain *  td,
NSSOID *  algorithm 
)

Definition at line 1372 of file trustdomain.c.

NSS_IMPLEMENT NSSCryptoContext* NSSTrustDomain_CreateCryptoContextForAlgorithmAndParameters ( NSSTrustDomain *  td,
NSSAlgorithmAndParameters *  ap 
)

Definition at line 1382 of file trustdomain.c.

NSS_IMPLEMENT PRStatus NSSTrustDomain_Destroy ( NSSTrustDomain *  td)

Definition at line 110 of file trustdomain.c.

{
    PRStatus status = PR_SUCCESS;
    if (--td->refCount == 0) {
       /* Destroy each token in the list of tokens */
       if (td->tokens) {
           nssListIterator_Destroy(td->tokens);
           td->tokens = NULL;
       }
       if (td->tokenList) {
           nssList_Clear(td->tokenList, token_destructor);
           nssList_Destroy(td->tokenList);
           td->tokenList = NULL;
       }
       NSSRWLock_Destroy(td->tokensLock);
       td->tokensLock = NULL;
       status = nssTrustDomain_DestroyCache(td);
       if (status == PR_FAILURE) {
           return status;
       }
       /* Destroy the trust domain */
       nssArena_Destroy(td->arena);
    }
    return status;
}
NSS_IMPLEMENT PRStatus NSSTrustDomain_DisableToken ( NSSTrustDomain *  td,
NSSToken *  token,
NSSError  why 
)

Definition at line 230 of file trustdomain.c.

NSS_IMPLEMENT PRStatus NSSTrustDomain_EnableToken ( NSSTrustDomain *  td,
NSSToken *  token 
)

Definition at line 241 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_FindBestCertificateByEmail ( NSSTrustDomain *  td,
NSSASCII7 email,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 879 of file trustdomain.c.

{
    return 0;
}
NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_FindBestCertificateByNameComponents ( NSSTrustDomain *  td,
NSSUTF8 nameComponents,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 726 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate* nssTrustDomain_FindBestCertificateByNickname ( NSSTrustDomain *  td,
NSSUTF8 name,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 539 of file trustdomain.c.

{
    NSSCertificate **nicknameCerts;
    NSSCertificate *rvCert = NULL;
    nicknameCerts = nssTrustDomain_FindCertificatesByNickname(td, name,
                                                              NULL,
                                                              0,
                                                              NULL);
    if (nicknameCerts) {
       rvCert = nssCertificateArray_FindBestCertificate(nicknameCerts,
                                                         timeOpt,
                                                         usage,
                                                         policiesOpt);
       nssCertificateArray_Destroy(nicknameCerts);
    }
    return rvCert;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_FindBestCertificateByNickname ( NSSTrustDomain *  td,
NSSUTF8 name,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 564 of file trustdomain.c.

{
    return nssTrustDomain_FindBestCertificateByNickname(td,
                                                        name,
                                                        timeOpt,
                                                        usage,
                                                        policiesOpt);
}
NSS_IMPLEMENT NSSCertificate* nssTrustDomain_FindBestCertificateBySubject ( NSSTrustDomain *  td,
NSSDER subject,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 685 of file trustdomain.c.

{
    NSSCertificate **subjectCerts;
    NSSCertificate *rvCert = NULL;
    subjectCerts = nssTrustDomain_FindCertificatesBySubject(td, subject,
                                                            NULL,
                                                            0,
                                                            NULL);
    if (subjectCerts) {
       rvCert = nssCertificateArray_FindBestCertificate(subjectCerts,
                                                         timeOpt,
                                                         usage,
                                                         policiesOpt);
       nssCertificateArray_Destroy(subjectCerts);
    }
    return rvCert;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_FindBestCertificateBySubject ( NSSTrustDomain *  td,
NSSDER subject,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 710 of file trustdomain.c.

{
    return nssTrustDomain_FindBestCertificateBySubject(td,
                                                       subject,
                                                       timeOpt,
                                                       usage,
                                                       policiesOpt);
}
NSS_IMPLEMENT NSSToken* NSSTrustDomain_FindBestTokenForAlgorithms ( NSSTrustDomain *  td,
NSSOID *  algorithms[],
PRUint32  nAlgorithmsOpt 
)

Definition at line 316 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_FindBestUserCertificate ( NSSTrustDomain *  td,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 914 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_FindBestUserCertificateForEmailSigning ( NSSTrustDomain *  td,
NSSASCII7 signerOpt,
NSSASCII7 recipientOpt,
NSSAlgorithmAndParameters *  apOpt,
NSSPolicies *  policiesOpt 
)

Definition at line 972 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_FindBestUserCertificateForSSLClientAuth ( NSSTrustDomain *  td,
NSSUTF8 sslHostOpt,
NSSDER rootCAsOpt[],
PRUint32  rootCAsMaxOpt,
NSSAlgorithmAndParameters *  apOpt,
NSSPolicies *  policiesOpt 
)

Definition at line 941 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate* nssTrustDomain_FindCertificateByEncodedCertificate ( NSSTrustDomain *  td,
NSSBER ber 
)

Definition at line 843 of file trustdomain.c.

{
    PRStatus status;
    NSSCertificate *rvCert = NULL;
    NSSDER issuer = { 0 };
    NSSDER serial = { 0 };
    NSSArena *arena = nssArena_Create();
    if (!arena) {
       return (NSSCertificate *)NULL;
    }
    /* XXX this is not generic...  will any cert crack into issuer/serial? */
    status = nssPKIX509_GetIssuerAndSerialFromDER(ber, arena, &issuer, &serial);
    if (status != PR_SUCCESS) {
       goto finish;
    }
    rvCert = nssTrustDomain_FindCertificateByIssuerAndSerialNumber(td,
                                                                   &issuer,
                                                                   &serial);
finish:
    nssArena_Destroy(arena);
    return rvCert;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_FindCertificateByEncodedCertificate ( NSSTrustDomain *  td,
NSSBER ber 
)

Definition at line 870 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate* nssTrustDomain_FindCertificateByIssuerAndSerialNumber ( NSSTrustDomain *  td,
NSSDER issuer,
NSSDER serial 
)

Definition at line 752 of file trustdomain.c.

{
    PRStatus status;
    NSSToken *token = NULL;
    NSSSlot **slots = NULL;
    NSSSlot **slotp;
    NSSCertificate *rvCert = NULL;
    nssPKIObjectCollection *collection = NULL;
    nssUpdateLevel updateLevel;
    /* see if this search is already cached */
    rvCert = nssTrustDomain_GetCertForIssuerAndSNFromCache(td,
                                                           issuer, 
                                                           serial);
    if (rvCert) {
       return rvCert;
    }
    slots = nssTrustDomain_GetActiveSlots(td, &updateLevel);
    if (!slots) {
       goto loser;
    }
    for (slotp = slots; *slotp; slotp++) {
       token = nssSlot_GetToken(*slotp);
       if (token) {
           nssSession *session;
           nssCryptokiObject *instance;
           nssTokenSearchType tokenOnly = nssTokenSearchType_TokenOnly;
           session = nssTrustDomain_GetSessionForToken(td, token);
           if (!session) {
              nssToken_Destroy(token);
              goto loser;
           }
           instance = nssToken_FindCertificateByIssuerAndSerialNumber(
                                                                   token,
                                                                   session,
                                                                   issuer,
                                                                   serial,
                                                                   tokenOnly,
                                                                   &status);
           nssToken_Destroy(token);
           if (status != PR_SUCCESS) {
              goto loser;
           }
           if (instance) {
              if (!collection) {
                  collection = nssCertificateCollection_Create(td, NULL);
                  if (!collection) {
                     goto loser;
                  }
              }
              nssPKIObjectCollection_AddInstances(collection, 
                                                  &instance, 1);
           }
       }
    }
    if (collection) {
       (void)nssPKIObjectCollection_GetCertificates(collection, 
                                                    &rvCert, 1, NULL);
       if (!rvCert) {
           goto loser;
       }
       nssPKIObjectCollection_Destroy(collection);
    }
    nssSlotArray_Destroy(slots);
    return rvCert;
loser:
    if (collection) {
       nssPKIObjectCollection_Destroy(collection);
    }
    if (slots) {
       nssSlotArray_Destroy(slots);
    }
    return (NSSCertificate *)NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_FindCertificateByIssuerAndSerialNumber ( NSSTrustDomain *  td,
NSSDER issuer,
NSSDER serial 
)

Definition at line 831 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_FindCertificateByOCSPHash ( NSSTrustDomain *  td,
NSSItem *  hash 
)

Definition at line 904 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate** NSSTrustDomain_FindCertificatesByEmail ( NSSTrustDomain *  td,
NSSASCII7 email,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 891 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate** NSSTrustDomain_FindCertificatesByNameComponents ( NSSTrustDomain *  td,
NSSUTF8 nameComponents,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 739 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate** nssTrustDomain_FindCertificatesByNickname ( NSSTrustDomain *  td,
NSSUTF8 name,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 427 of file trustdomain.c.

{
    PRStatus status;
    PRUint32 numRemaining;
    NSSToken *token = NULL;
    NSSSlot **slots = NULL;
    NSSSlot **slotp;
    NSSCertificate **rvCerts = NULL;
    nssPKIObjectCollection *collection = NULL;
    nssUpdateLevel updateLevel;
    nssList *nameList;
    /* First, grab from the cache */
    nameList = nssList_Create(NULL, PR_FALSE);
    if (!nameList) {
       return NULL;
    }
    (void)nssTrustDomain_GetCertsForNicknameFromCache(td, name, nameList);
    rvCerts = get_certs_from_list(nameList);
    /* initialize the collection of token certificates with the set of
     * cached certs (if any).
     */
    collection = nssCertificateCollection_Create(td, rvCerts);
    nssCertificateArray_Destroy(rvCerts);
    nssList_Destroy(nameList);
    if (!collection) {
       return (NSSCertificate **)NULL;
    }
    /* obtain the current set of active slots in the trust domain */
    slots = nssTrustDomain_GetActiveSlots(td, &updateLevel);
    if (!slots) {
       goto loser;
    }
    /* iterate over the slots */
    numRemaining = maximumOpt;
    for (slotp = slots; *slotp; slotp++) {
       token = nssSlot_GetToken(*slotp);
       if (token) {
           nssSession *session;
           nssCryptokiObject **instances;
           nssTokenSearchType tokenOnly = nssTokenSearchType_TokenOnly;
           session = nssTrustDomain_GetSessionForToken(td, token);
           if (!session) {
              nssToken_Destroy(token);
              goto loser;
           }
           instances = nssToken_FindCertificatesByNickname(token,
                                                           session,
                                                           name,
                                                           tokenOnly,
                                                           numRemaining,
                                                           &status);
           nssToken_Destroy(token);
           if (status != PR_SUCCESS) {
              goto loser;
           }
           if (instances) {
              status = nssPKIObjectCollection_AddInstances(collection, 
                                                           instances, 0);
              nss_ZFreeIf(instances);
              if (status != PR_SUCCESS) {
                  goto loser;
              }
              if (maximumOpt > 0) {
                   PRUint32 count;
                   count = nssPKIObjectCollection_Count(collection);
                  numRemaining = maximumOpt - count;
                  if (numRemaining == 0) break;
              }
           }
       }
    }
    /* Grab the certs collected in the search. */
    rvCerts = nssPKIObjectCollection_GetCertificates(collection,
                                                     rvOpt, maximumOpt,
                                                     arenaOpt);
    /* clean up */
    nssPKIObjectCollection_Destroy(collection);
    nssSlotArray_Destroy(slots);
    return rvCerts;
loser:
    if (slots) {
       nssSlotArray_Destroy(slots);
    }
    if (collection) {
       nssPKIObjectCollection_Destroy(collection);
    }
    return (NSSCertificate **)NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NSS_IMPLEMENT NSSCertificate** NSSTrustDomain_FindCertificatesByNickname ( NSSTrustDomain *  td,
NSSUTF8 name,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 523 of file trustdomain.c.

{
    return nssTrustDomain_FindCertificatesByNickname(td,
                                                     name,
                                                     rvOpt,
                                                     maximumOpt,
                                                     arenaOpt);
}
NSS_IMPLEMENT NSSCertificate** nssTrustDomain_FindCertificatesBySubject ( NSSTrustDomain *  td,
NSSDER subject,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 580 of file trustdomain.c.

{
    PRStatus status;
    PRUint32 numRemaining;
    NSSToken *token = NULL;
    NSSSlot **slots = NULL;
    NSSSlot **slotp;
    NSSCertificate **rvCerts = NULL;
    nssPKIObjectCollection *collection = NULL;
    nssUpdateLevel updateLevel;
    nssList *subjectList;
    /* look in cache */
    subjectList = nssList_Create(NULL, PR_FALSE);
    if (!subjectList) {
       return NULL;
    }
    (void)nssTrustDomain_GetCertsForSubjectFromCache(td, subject, subjectList);
    rvCerts = get_certs_from_list(subjectList);
    collection = nssCertificateCollection_Create(td, rvCerts);
    nssCertificateArray_Destroy(rvCerts);
    nssList_Destroy(subjectList);
    if (!collection) {
       return (NSSCertificate **)NULL;
    }
    slots = nssTrustDomain_GetActiveSlots(td, &updateLevel);
    if (!slots) {
       goto loser;
    }
    numRemaining = maximumOpt;
    for (slotp = slots; *slotp; slotp++) {
       token = nssSlot_GetToken(*slotp);
       if (token) {
           nssSession *session;
           nssCryptokiObject **instances;
           nssTokenSearchType tokenOnly = nssTokenSearchType_TokenOnly;
           session = nssTrustDomain_GetSessionForToken(td, token);
           if (!session) {
              nssToken_Destroy(token);
              goto loser;
           }
           instances = nssToken_FindCertificatesBySubject(token,
                                                          session,
                                                          subject,
                                                          tokenOnly,
                                                          numRemaining,
                                                          &status);
           nssToken_Destroy(token);
           if (status != PR_SUCCESS) {
              goto loser;
           }
           if (instances) {
              status = nssPKIObjectCollection_AddInstances(collection, 
                                                           instances, 0);
              nss_ZFreeIf(instances);
              if (status != PR_SUCCESS) {
                  goto loser;
              }
              if (maximumOpt > 0) {
                  PRUint32 count;
                  count = nssPKIObjectCollection_Count(collection);
                  numRemaining = maximumOpt - count;
                  if (numRemaining == 0) break;
              }
           }
       }
    }
    rvCerts = nssPKIObjectCollection_GetCertificates(collection,
                                                     rvOpt, maximumOpt,
                                                     arenaOpt);
    nssPKIObjectCollection_Destroy(collection);
    nssSlotArray_Destroy(slots);
    return rvCerts;
loser:
    if (slots) {
       nssSlotArray_Destroy(slots);
    }
    if (collection) {
       nssPKIObjectCollection_Destroy(collection);
    }
    return (NSSCertificate **)NULL;
}
NSS_IMPLEMENT NSSCertificate** NSSTrustDomain_FindCertificatesBySubject ( NSSTrustDomain *  td,
NSSDER subject,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 669 of file trustdomain.c.

{
    return nssTrustDomain_FindCertificatesBySubject(td, 
                                                    subject,
                                                    rvOpt,
                                                    maximumOpt,
                                                    arenaOpt);
}
NSS_IMPLEMENT NSSCRL** nssTrustDomain_FindCRLsBySubject ( NSSTrustDomain *  td,
NSSDER subject 
)

Definition at line 1242 of file trustdomain.c.

{
    PRStatus status;
    NSSSlot **slots;
    NSSSlot **slotp;
    NSSToken *token;
    nssUpdateLevel updateLevel;
    nssPKIObjectCollection *collection;
    NSSCRL **rvCRLs = NULL;
    collection = nssCRLCollection_Create(td, NULL);
    if (!collection) {
       return (NSSCRL **)NULL;
    }
    slots = nssTrustDomain_GetActiveSlots(td, &updateLevel);
    if (!slots) {
       goto loser;
    }
    for (slotp = slots; *slotp; slotp++) {
       token = nssSlot_GetToken(*slotp);
       if (token) {
           nssSession *session;
           nssCryptokiObject **instances;
           nssTokenSearchType tokenOnly = nssTokenSearchType_TokenOnly;
           /* get a session for the token */
           session = nssTrustDomain_GetSessionForToken(td, token);
           if (!session) {
              nssToken_Destroy(token);
              goto loser;
           }
           /* perform the traversal */
           instances = nssToken_FindCRLsBySubject(token, session, subject,
                                                  tokenOnly, 0, &status);
           nssToken_Destroy(token);
           if (status != PR_SUCCESS) {
              goto loser;
           }
           /* add the found CRL's to the collection */
           status = nssPKIObjectCollection_AddInstances(collection, 
                                                        instances, 0);
           nss_ZFreeIf(instances);
           if (status != PR_SUCCESS) {
              goto loser;
           }
       }
    }
    rvCRLs = nssPKIObjectCollection_GetCRLs(collection, NULL, 0, NULL);
    nssPKIObjectCollection_Destroy(collection);
    nssSlotArray_Destroy(slots);
    return rvCRLs;
loser:
    nssPKIObjectCollection_Destroy(collection);
    nssSlotArray_Destroy(slots);
    return (NSSCRL **)NULL;
}
NSS_IMPLEMENT NSSSlot* NSSTrustDomain_FindSlotByName ( NSSTrustDomain *  td,
NSSUTF8 slotName 
)

Definition at line 262 of file trustdomain.c.

NSS_IMPLEMENT NSSSymmetricKey* NSSTrustDomain_FindSymmetricKeyByAlgorithmAndKeyID ( NSSTrustDomain *  td,
NSSOID *  algorithm,
NSSItem *  keyID,
NSSCallback *  uhhOpt 
)

Definition at line 1342 of file trustdomain.c.

NSS_IMPLEMENT NSSToken* NSSTrustDomain_FindTokenByName ( NSSTrustDomain *  td,
NSSUTF8 tokenName 
)

Definition at line 272 of file trustdomain.c.

{
    PRStatus nssrv;
    NSSUTF8 *myName;
    NSSToken *tok = NULL;
    NSSRWLock_LockRead(td->tokensLock);
    for (tok  = (NSSToken *)nssListIterator_Start(td->tokens);
         tok != (NSSToken *)NULL;
         tok  = (NSSToken *)nssListIterator_Next(td->tokens))
    {
       if (nssToken_IsPresent(tok)) {
           myName = nssToken_GetName(tok);
           if (nssUTF8_Equal(tokenName, myName, &nssrv)) break;
       }
    }
    nssListIterator_Finish(td->tokens);
    NSSRWLock_UnlockRead(td->tokensLock);
    return tok;
}
NSS_IMPLEMENT NSSToken* NSSTrustDomain_FindTokenBySlotName ( NSSTrustDomain *  td,
NSSUTF8 slotName 
)

Definition at line 296 of file trustdomain.c.

NSS_IMPLEMENT NSSToken* NSSTrustDomain_FindTokenForAlgorithm ( NSSTrustDomain *  td,
NSSOID *  algorithm 
)

Definition at line 306 of file trustdomain.c.

NSS_IMPLEMENT NSSTrust* nssTrustDomain_FindTrustForCertificate ( NSSTrustDomain *  td,
NSSCertificate *  c 
)

Definition at line 1180 of file trustdomain.c.

{
    PRStatus status;
    NSSSlot **slots;
    NSSSlot **slotp;
    NSSToken *token;
    nssCryptokiObject *to = NULL;
    nssPKIObject *pkio = NULL;
    NSSTrust *rvt = NULL;
    nssUpdateLevel updateLevel;
    slots = nssTrustDomain_GetActiveSlots(td, &updateLevel);
    if (!slots) {
       return (NSSTrust *)NULL;
    }
    for (slotp = slots; *slotp; slotp++) {
       token = nssSlot_GetToken(*slotp);
       if (token) {
           to = nssToken_FindTrustForCertificate(token, NULL, 
                                                 &c->encoding,
                                                 &c->issuer,
                                                 &c->serial,
                                             nssTokenSearchType_TokenOnly);
           if (to) {
              if (!pkio) {
                  pkio = nssPKIObject_Create(NULL, to, td, NULL, nssPKILock);
                  if (!pkio) {
                     nssToken_Destroy(token);
                     nssCryptokiObject_Destroy(to);
                     goto loser;
                  }
              } else {
                  status = nssPKIObject_AddInstance(pkio, to);
                  if (status != PR_SUCCESS) {
                     nssToken_Destroy(token);
                     nssCryptokiObject_Destroy(to);
                     goto loser;
                  }
              }
           }
           nssToken_Destroy(token);
       }
    }
    if (pkio) {
       rvt = nssTrust_Create(pkio, &c->encoding);
       if (!rvt) {
           goto loser;
       }
    }
    nssSlotArray_Destroy(slots);
    return rvt;
loser:
    nssSlotArray_Destroy(slots);
    if (pkio) {
       nssPKIObject_Destroy(pkio);
    }
    return (NSSTrust *)NULL;
}
NSS_IMPLEMENT NSSCertificate** NSSTrustDomain_FindUserCertificates ( NSSTrustDomain *  td,
NSSTime *  timeOpt,
NSSUsage *  usageOpt,
NSSPolicies *  policiesOpt,
NSSCertificate **  rvOpt,
PRUint32  rvLimit,
NSSArena *  arenaOpt 
)

Definition at line 926 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate** NSSTrustDomain_FindUserCertificatesForEmailSigning ( NSSTrustDomain *  td,
NSSASCII7 signerOpt,
NSSASCII7 recipientOpt,
NSSAlgorithmAndParameters *  apOpt,
NSSPolicies *  policiesOpt,
NSSCertificate **  rvOpt,
PRUint32  rvLimit,
NSSArena *  arenaOpt 
)

Definition at line 986 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate** NSSTrustDomain_FindUserCertificatesForSSLClientAuth ( NSSTrustDomain *  td,
NSSUTF8 sslHostOpt,
NSSDER rootCAsOpt[],
PRUint32  rootCAsMaxOpt,
NSSAlgorithmAndParameters *  apOpt,
NSSPolicies *  policiesOpt,
NSSCertificate **  rvOpt,
PRUint32  rvLimit,
NSSArena *  arenaOpt 
)

Definition at line 955 of file trustdomain.c.

NSS_IMPLEMENT PRStatus NSSTrustDomain_GenerateKeyPair ( NSSTrustDomain *  td,
NSSAlgorithmAndParameters *  ap,
NSSPrivateKey **  pvkOpt,
NSSPublicKey **  pbkOpt,
PRBool  privateKeyIsSensitive,
NSSToken *  destination,
NSSCallback *  uhhOpt 
)

Definition at line 1301 of file trustdomain.c.

NSS_IMPLEMENT NSSSymmetricKey* NSSTrustDomain_GenerateSymmetricKey ( NSSTrustDomain *  td,
NSSAlgorithmAndParameters *  ap,
PRUint32  keysize,
NSSToken *  destination,
NSSCallback *  uhhOpt 
)

Definition at line 1316 of file trustdomain.c.

NSS_IMPLEMENT NSSSymmetricKey* NSSTrustDomain_GenerateSymmetricKeyFromPassword ( NSSTrustDomain *  td,
NSSAlgorithmAndParameters *  ap,
NSSUTF8 passwordOpt,
NSSToken *  destinationOpt,
NSSCallback *  uhhOpt 
)

Definition at line 1329 of file trustdomain.c.

static NSSSlot** nssTrustDomain_GetActiveSlots ( NSSTrustDomain *  td,
nssUpdateLevel updateLevel 
) [static]

Definition at line 140 of file trustdomain.c.

{
    PRUint32 count;
    NSSSlot **slots = NULL;
    NSSToken **tp, **tokens;
    *updateLevel = 1;
    NSSRWLock_LockRead(td->tokensLock);
    count = nssList_Count(td->tokenList);
    tokens = nss_ZNEWARRAY(NULL, NSSToken *, count + 1);
    if (!tokens) {
       NSSRWLock_UnlockRead(td->tokensLock);
       return NULL;
    }
    slots = nss_ZNEWARRAY(NULL, NSSSlot *, count + 1);
    if (!slots) {
       NSSRWLock_UnlockRead(td->tokensLock);
       nss_ZFreeIf(tokens);
       return NULL;
    }
    nssList_GetArray(td->tokenList, (void **)tokens, count);
    NSSRWLock_UnlockRead(td->tokensLock);
    count = 0;
    for (tp = tokens; *tp; tp++) {
       slots[count++] = nssToken_GetSlot(*tp);
    }
    nss_ZFreeIf(tokens);
    return slots;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NSS_IMPLEMENT NSSCallback* nssTrustDomain_GetDefaultCallback ( NSSTrustDomain *  td,
PRStatus statusOpt 
)

Definition at line 197 of file trustdomain.c.

{
    if (statusOpt) {
       *statusOpt = PR_SUCCESS;
    }
    return td->defaultCallback;
}
NSS_IMPLEMENT NSSCallback* NSSTrustDomain_GetDefaultCallback ( NSSTrustDomain *  td,
PRStatus statusOpt 
)

Definition at line 209 of file trustdomain.c.

{
    return nssTrustDomain_GetDefaultCallback(td, statusOpt);
}
static nssSession* nssTrustDomain_GetSessionForToken ( NSSTrustDomain *  td,
NSSToken *  token 
) [static]

Definition at line 174 of file trustdomain.c.

Here is the call graph for this function:

Here is the caller graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_ImportCertificate ( NSSTrustDomain *  td,
NSSCertificate *  c 
)

Definition at line 346 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_ImportEncodedCertificate ( NSSTrustDomain *  td,
NSSBER ber 
)

Definition at line 367 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate** NSSTrustDomain_ImportEncodedCertificateChain ( NSSTrustDomain *  td,
NSSBER ber,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 377 of file trustdomain.c.

NSS_IMPLEMENT NSSPrivateKey* NSSTrustDomain_ImportEncodedPrivateKey ( NSSTrustDomain *  td,
NSSBER ber,
NSSItem *  passwordOpt,
NSSCallback *  uhhOpt,
NSSToken *  destination 
)

Definition at line 390 of file trustdomain.c.

NSS_IMPLEMENT NSSPublicKey* NSSTrustDomain_ImportEncodedPublicKey ( NSSTrustDomain *  td,
NSSBER ber 
)

Definition at line 403 of file trustdomain.c.

NSS_IMPLEMENT NSSCertificate* NSSTrustDomain_ImportPKIXCertificate ( NSSTrustDomain *  td,
struct NSSPKIXCertificateStr *  pc 
)

Definition at line 356 of file trustdomain.c.

NSS_IMPLEMENT PRStatus NSSTrustDomain_IsTokenEnabled ( NSSTrustDomain *  td,
NSSToken *  token,
NSSError whyOpt 
)

Definition at line 251 of file trustdomain.c.

NSS_IMPLEMENT PRStatus NSSTrustDomain_LoadModule ( NSSTrustDomain *  td,
NSSUTF8 moduleOpt,
NSSUTF8 uriOpt,
NSSUTF8 opaqueOpt,
void reserved 
)

Definition at line 218 of file trustdomain.c.

{
    return PR_FAILURE;
}
NSS_IMPLEMENT PRStatus NSSTrustDomain_Login ( NSSTrustDomain *  td,
NSSCallback *  uhhOpt 
)

Definition at line 327 of file trustdomain.c.

NSS_IMPLEMENT PRStatus NSSTrustDomain_Logout ( NSSTrustDomain *  td)

Definition at line 337 of file trustdomain.c.

NSS_IMPLEMENT PRStatus NSSTrustDomain_SetDefaultCallback ( NSSTrustDomain *  td,
NSSCallback *  newCallback,
NSSCallback **  oldCallbackOpt 
)

Definition at line 183 of file trustdomain.c.

{
    if (oldCallbackOpt) {
       *oldCallbackOpt = td->defaultCallback;
    }
    td->defaultCallback = newCallback;
    return PR_SUCCESS;
}
NSS_IMPLEMENT PRStatus* NSSTrustDomain_TraverseCertificates ( NSSTrustDomain *  td,
PRStatus(*)(NSSCertificate *c, void *arg callback,
void arg 
)

Definition at line 1010 of file trustdomain.c.

{
    PRStatus status;
    NSSToken *token = NULL;
    NSSSlot **slots = NULL;
    NSSSlot **slotp;
    nssPKIObjectCollection *collection = NULL;
    nssPKIObjectCallback pkiCallback;
    nssUpdateLevel updateLevel;
    NSSCertificate **cached = NULL;
    nssList *certList;

    certList = nssList_Create(NULL, PR_FALSE);
    if (!certList) return NULL;
    (void *)nssTrustDomain_GetCertsFromCache(td, certList);
    cached = get_certs_from_list(certList);
    collection = nssCertificateCollection_Create(td, cached);
    nssCertificateArray_Destroy(cached);
    nssList_Destroy(certList);
    if (!collection) {
       return (PRStatus *)NULL;
    }
    /* obtain the current set of active slots in the trust domain */
    slots = nssTrustDomain_GetActiveSlots(td, &updateLevel);
    if (!slots) {
       goto loser;
    }
    /* iterate over the slots */
    for (slotp = slots; *slotp; slotp++) {
       /* get the token for the slot, if present */
       token = nssSlot_GetToken(*slotp);
       if (token) {
           nssSession *session;
           nssTokenSearchType tokenOnly = nssTokenSearchType_TokenOnly;
           /* get a session for the token */
           session = nssTrustDomain_GetSessionForToken(td, token);
           if (!session) {
              nssToken_Destroy(token);
              goto loser;
           }
           /* perform the traversal */
           status = nssToken_TraverseCertificates(token,
                                                  session,
                                                  tokenOnly,
                                                  collector,
                                                  collection);
           nssToken_Destroy(token);
       }
    }

    /* Traverse the collection */
    pkiCallback.func.cert = callback;
    pkiCallback.arg = arg;
    status = nssPKIObjectCollection_Traverse(collection, &pkiCallback);
    /* clean up */
    nssPKIObjectCollection_Destroy(collection);
    nssSlotArray_Destroy(slots);
    return NULL;
loser:
    if (slots) {
       nssSlotArray_Destroy(slots);
    }
    if (collection) {
       nssPKIObjectCollection_Destroy(collection);
    }
    return NULL;
}
static void token_destructor ( void t) [static]

Definition at line 101 of file trustdomain.c.

{
    NSSToken *tok = (NSSToken *)t;
    /* in 3.4, also destroy the slot (managed separately) */
    (void)nssSlot_Destroy(tok->slot);
    nssToken_Destroy(tok);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 80 of file errorval.c.