Back to index

lightning-sunbird  0.9+nobinonly
Defines | Typedefs | Functions
nss.h File Reference
#include "seccomon.h"

Go to the source code of this file.

Defines

#define NSS_VERSION   "3.11.4"
#define NSS_VMAJOR   3
#define NSS_VMINOR   11
#define NSS_VPATCH   4
#define NSS_BETA   PR_FALSE
#define NSS_INIT_READONLY   0x1
#define NSS_INIT_NOCERTDB   0x2
#define NSS_INIT_NOMODDB   0x4
#define NSS_INIT_FORCEOPEN   0x8
#define NSS_INIT_NOROOTINIT   0x10
#define NSS_INIT_OPTIMIZESPACE   0x20
#define NSS_INIT_PK11THREADSAFE   0x40
#define NSS_INIT_PK11RELOAD   0x80
#define NSS_INIT_NOPK11FINALIZE   0x100
#define NSS_INIT_RESERVED   0x200
#define NSS_INIT_COOPERATE
#define SECMOD_DB   "secmod.db"

Typedefs

typedef SECStatus(* NSS_ShutdownFunc )(void *appData, void *nssData)

Functions

PRBool NSS_VersionCheck (const char *importedVersion)
SECStatus NSS_Init (const char *configdir)
PRBool NSS_IsInitialized (void)
SECStatus NSS_InitReadWrite (const char *configdir)
SECStatus NSS_Initialize (const char *configdir, const char *certPrefix, const char *keyPrefix, const char *secmodName, PRUint32 flags)
SECStatus NSS_NoDB_Init (const char *configdir)
SECStatus NSS_RegisterShutdown (NSS_ShutdownFunc sFunc, void *appData)
SECStatus NSS_UnregisterShutdown (NSS_ShutdownFunc sFunc, void *appData)
SECStatus NSS_Shutdown (void)
void PK11_ConfigurePKCS11 (const char *man, const char *libdes, const char *tokdes, const char *ptokdes, const char *slotdes, const char *pslotdes, const char *fslotdes, const char *fpslotdes, int minPwd, int pwRequired)
void nss_DumpCertificateCacheInfo (void)

Define Documentation

Definition at line 67 of file nss.h.

Value:
NSS_INIT_PK11THREADSAFE | \
        NSS_INIT_PK11RELOAD | \
        NSS_INIT_NOPK11FINALIZE | \
        NSS_INIT_RESERVED

Definition at line 174 of file nss.h.

Definition at line 166 of file nss.h.

Definition at line 164 of file nss.h.

Definition at line 165 of file nss.h.

Definition at line 171 of file nss.h.

Definition at line 167 of file nss.h.

Definition at line 168 of file nss.h.

Definition at line 170 of file nss.h.

Definition at line 169 of file nss.h.

Definition at line 163 of file nss.h.

Definition at line 172 of file nss.h.

#define NSS_VERSION   "3.11.4"

Definition at line 62 of file nss.h.

#define NSS_VMAJOR   3

Definition at line 64 of file nss.h.

#define NSS_VMINOR   11

Definition at line 65 of file nss.h.

#define NSS_VPATCH   4

Definition at line 66 of file nss.h.

#define SECMOD_DB   "secmod.db"

Definition at line 182 of file nss.h.


Typedef Documentation

typedef SECStatus(* NSS_ShutdownFunc)(void *appData, void *nssData)

Definition at line 206 of file nss.h.


Function Documentation

Definition at line 1262 of file pki3hack.c.

{
    NSSTrustDomain *td;
    NSSCryptoContext *cc;
    td = STAN_GetDefaultTrustDomain();
    cc = STAN_GetDefaultCryptoContext();
    printf("\n\nCertificates in the cache:\n");
    nssTrustDomain_DumpCacheInfo(td, cert_dump_iter, NULL);
    printf("\n\nCertificates in the temporary store:\n");
    if (cc->certStore) {
       nssCertificateStore_DumpStoreInfo(cc->certStore, cert_dump_iter, NULL);
    }
}

Here is the call graph for this function:

SECStatus NSS_Init ( const char *  configdir)

Definition at line 534 of file nssinit.c.

Here is the call graph for this function:

SECStatus NSS_Initialize ( const char *  configdir,
const char *  certPrefix,
const char *  keyPrefix,
const char *  secmodName,
PRUint32  flags 
)

Definition at line 596 of file nssinit.c.

{
    return nss_Init(configdir, certPrefix, keyPrefix, secmodName, 
       ((flags & NSS_INIT_READONLY) == NSS_INIT_READONLY),
       ((flags & NSS_INIT_NOCERTDB) == NSS_INIT_NOCERTDB),
       ((flags & NSS_INIT_NOMODDB) == NSS_INIT_NOMODDB),
       ((flags & NSS_INIT_FORCEOPEN) == NSS_INIT_FORCEOPEN),
       ((flags & NSS_INIT_NOROOTINIT) == NSS_INIT_NOROOTINIT),
       ((flags & NSS_INIT_OPTIMIZESPACE) == NSS_INIT_OPTIMIZESPACE),
        ((flags & NSS_INIT_PK11THREADSAFE) == NSS_INIT_PK11THREADSAFE),
        ((flags & NSS_INIT_PK11RELOAD) == NSS_INIT_PK11RELOAD),
        ((flags & NSS_INIT_NOPK11FINALIZE) == NSS_INIT_NOPK11FINALIZE));
}

Here is the call graph for this function:

SECStatus NSS_InitReadWrite ( const char *  configdir)

Definition at line 541 of file nssinit.c.

Here is the call graph for this function:

Definition at line 828 of file nssinit.c.

{
    return nss_IsInitted;
}
SECStatus NSS_NoDB_Init ( const char *  configdir)

Definition at line 615 of file nssinit.c.

Here is the call graph for this function:

Definition at line 791 of file nssinit.c.

{
    SECStatus shutdownRV = SECSuccess;
    SECStatus rv;
    PRStatus status;

    if (!nss_IsInitted) {
       PORT_SetError(SEC_ERROR_NOT_INITIALIZED);
       return SECFailure;
    }

    rv = nss_ShutdownShutdownList();
    if (rv != SECSuccess) {
       shutdownRV = SECFailure;
    }
    cert_DestroyLocks();
    ShutdownCRLCache();
    OCSP_ShutdownCache();
    SECOID_Shutdown();
    status = STAN_Shutdown();
    cert_DestroySubjectKeyIDHashTable();
    rv = SECMOD_Shutdown();
    if (rv != SECSuccess) {
       shutdownRV = SECFailure;
    }
    pk11sdr_Shutdown();
    if (status == PR_FAILURE) {
       if (NSS_GetError() == NSS_ERROR_BUSY) {
           PORT_SetError(SEC_ERROR_BUSY);
       }
       shutdownRV = SECFailure;
    }
    nss_IsInitted = PR_FALSE;
    return shutdownRV;
}

Here is the call graph for this function:

Definition at line 713 of file nssinit.c.

Here is the call graph for this function:

PRBool NSS_VersionCheck ( const char *  importedVersion)

Definition at line 838 of file nssinit.c.

{
    /*
     * This is the secret handshake algorithm.
     *
     * This release has a simple version compatibility
     * check algorithm.  This release is not backward
     * compatible with previous major releases.  It is
     * not compatible with future major, minor, or
     * patch releases.
     */
    int vmajor = 0, vminor = 0, vpatch = 0;
    const char *ptr = importedVersion;
    volatile char c; /* force a reference that won't get optimized away */

    c = __nss_base_rcsid[0] + __nss_base_sccsid[0]; 

    while (isdigit(*ptr)) {
        vmajor = 10 * vmajor + *ptr - '0';
        ptr++;
    }
    if (*ptr == '.') {
        ptr++;
        while (isdigit(*ptr)) {
            vminor = 10 * vminor + *ptr - '0';
            ptr++;
        }
        if (*ptr == '.') {
            ptr++;
            while (isdigit(*ptr)) {
                vpatch = 10 * vpatch + *ptr - '0';
                ptr++;
            }
        }
    }

    if (vmajor != NSS_VMAJOR) {
        return PR_FALSE;
    }
    if (vmajor == NSS_VMAJOR && vminor > NSS_VMINOR) {
        return PR_FALSE;
    }
    if (vmajor == NSS_VMAJOR && vminor == NSS_VMINOR && vpatch > NSS_VPATCH) {
        return PR_FALSE;
    }
    /* Check dependent libraries */
    if (PR_VersionCheck(PR_VERSION) == PR_FALSE) {
        return PR_FALSE;
    }
    return PR_TRUE;
}
void PK11_ConfigurePKCS11 ( const char *  man,
const char *  libdes,
const char *  tokdes,
const char *  ptokdes,
const char *  slotdes,
const char *  pslotdes,
const char *  fslotdes,
const char *  fpslotdes,
int  minPwd,
int  pwRequired 
)

Definition at line 139 of file nssinit.c.

{
   char *strings = NULL;
   char *newStrings;

   /* make sure the internationalization was done correctly... */
   strings = PR_smprintf("");
   if (strings == NULL) return;

    if (man) {
        newStrings = PR_smprintf("%s manufacturerID='%s'",strings,man);
       PR_smprintf_free(strings);
       strings = newStrings;
    }
   if (strings == NULL) return;

    if (libdes) {
        newStrings = PR_smprintf("%s libraryDescription='%s'",strings,libdes);
       PR_smprintf_free(strings);
       strings = newStrings;
       if (pk11_config_name != NULL) {
           PORT_Free(pk11_config_name);
       }
       pk11_config_name = PORT_Strdup(libdes);
    }
   if (strings == NULL) return;

    if (tokdes) {
        newStrings = PR_smprintf("%s cryptoTokenDescription='%s'",strings,
                                                        tokdes);
       PR_smprintf_free(strings);
       strings = newStrings;
    }
   if (strings == NULL) return;

    if (ptokdes) {
        newStrings = PR_smprintf("%s dbTokenDescription='%s'",strings,ptokdes);
       PR_smprintf_free(strings);
       strings = newStrings;
    }
   if (strings == NULL) return;

    if (slotdes) {
        newStrings = PR_smprintf("%s cryptoSlotDescription='%s'",strings,
                                                        slotdes);
       PR_smprintf_free(strings);
       strings = newStrings;
    }
   if (strings == NULL) return;

    if (pslotdes) {
        newStrings = PR_smprintf("%s dbSlotDescription='%s'",strings,pslotdes);
       PR_smprintf_free(strings);
       strings = newStrings;
    }
   if (strings == NULL) return;

    if (fslotdes) {
        newStrings = PR_smprintf("%s FIPSSlotDescription='%s'",
                                                 strings,fslotdes);
       PR_smprintf_free(strings);
       strings = newStrings;
    }
   if (strings == NULL) return;

    if (fpslotdes) {
        newStrings = PR_smprintf("%s FIPSTokenDescription='%s'",
                                                 strings,fpslotdes);
       PR_smprintf_free(strings);
       strings = newStrings;
    }
   if (strings == NULL) return;

    newStrings = PR_smprintf("%s minPS=%d", strings, minPwd);
    PR_smprintf_free(strings);
    strings = newStrings;
   if (strings == NULL) return;

    if (pk11_config_strings != NULL) {
       PR_smprintf_free(pk11_config_strings);
    }
    pk11_config_strings = strings;
    pk11_password_required = pwRequired;

    return;
}

Here is the call graph for this function: