Back to index

lightning-sunbird  0.9+nobinonly
Functions
dev3hack.h File Reference
#include "cert.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

PR_BEGIN_EXTERN_C NSS_EXTERN
NSSToken * 
nssToken_CreateFromPK11SlotInfo (NSSTrustDomain *td, PK11SlotInfo *nss3slot)
NSS_EXTERN void nssToken_UpdateName (NSSToken *)
NSS_EXTERN PRStatus nssToken_Refresh (NSSToken *)
NSSTrustDomain * nssToken_GetTrustDomain (NSSToken *token)
void PK11Slot_SetNSSToken (PK11SlotInfo *sl, NSSToken *nsst)
NSSToken * PK11Slot_GetNSSToken (PK11SlotInfo *sl)

Function Documentation

PR_BEGIN_EXTERN_C NSS_EXTERN NSSToken* nssToken_CreateFromPK11SlotInfo ( NSSTrustDomain *  td,
PK11SlotInfo *  nss3slot 
)

Definition at line 161 of file dev3hack.c.

{
    NSSToken *rvToken;
    NSSArena *arena;
    arena = nssArena_Create();
    if (!arena) {
       return NULL;
    }
    rvToken = nss_ZNEW(arena, NSSToken);
    if (!rvToken) {
       nssArena_Destroy(arena);
       return NULL;
    }
    rvToken->base.refCount = 1;
    rvToken->base.lock = PZ_NewLock(nssILockOther);
    rvToken->base.arena = arena;
    rvToken->pk11slot = nss3slot;
    rvToken->epv = nss3slot->functionList;
    rvToken->defaultSession = nssSession_ImportNSS3Session(td->arena,
                                                       nss3slot->session,
                                                       nss3slot->sessionLock,
                                                       nss3slot->defRWSession);
    /* The above test was used in 3.4, for this cache have it always on */
    if (!PK11_IsInternal(nss3slot) && PK11_IsHW(nss3slot)) {
       rvToken->cache = nssTokenObjectCache_Create(rvToken, 
                                                   PR_TRUE, PR_TRUE, PR_TRUE);
       if (!rvToken->cache) {
           nssArena_Destroy(arena);
           return (NSSToken *)NULL;
       }
    }
    rvToken->trustDomain = td;
    /* Grab the token name from the PKCS#11 fixed-length buffer */
    rvToken->base.name = nssUTF8_Duplicate(nss3slot->token_name,td->arena);
    rvToken->slot = nssSlot_CreateFromPK11SlotInfo(td, nss3slot);
    rvToken->slot->token = rvToken;
    rvToken->defaultSession->slot = rvToken->slot;
    return rvToken;
}
NSSTrustDomain* nssToken_GetTrustDomain ( NSSToken *  token)

Definition at line 292 of file dev3hack.c.

{
    return token->trustDomain;
}

Definition at line 229 of file dev3hack.c.

{
    PK11SlotInfo *nss3slot;

    if (!token) {
       return PR_SUCCESS;
    }
    nss3slot = token->pk11slot;
    token->defaultSession = nssSession_ImportNSS3Session(token->slot->base.arena,
                                                       nss3slot->session,
                                                       nss3slot->sessionLock,
                                                       nss3slot->defRWSession);
    return PR_SUCCESS;
}

Definition at line 202 of file dev3hack.c.

{
    if (!token) {
       return;
    }
    token->base.name = nssUTF8_Duplicate(token->pk11slot->token_name,token->base.arena);
}
NSSToken* PK11Slot_GetNSSToken ( PK11SlotInfo *  sl)

Definition at line 2248 of file pk11slot.c.

{
    return sl->nssToken;
}

Here is the caller graph for this function:

void PK11Slot_SetNSSToken ( PK11SlotInfo *  sl,
NSSToken *  nsst 
)

Definition at line 2242 of file pk11slot.c.

{
    sl->nssToken = nsst;
}

Here is the caller graph for this function: