Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
instance.c File Reference
#include "ckdbm.h"

Go to the source code of this file.

Functions

static CK_RV nss_dbm_mdInstance_Initialize (NSSCKMDInstance *mdInstance, NSSCKFWInstance *fwInstance, NSSUTF8 *configurationData)
static CK_ULONG nss_dbm_mdInstance_GetNSlots (NSSCKMDInstance *mdInstance, NSSCKFWInstance *fwInstance, CK_RV *pError)
static CK_VERSION nss_dbm_mdInstance_GetCryptokiVersion (NSSCKMDInstance *mdInstance, NSSCKFWInstance *fwInstance)
static NSSUTF8nss_dbm_mdInstance_GetManufacturerID (NSSCKMDInstance *mdInstance, NSSCKFWInstance *fwInstance, CK_RV *pError)
static NSSUTF8nss_dbm_mdInstance_GetLibraryDescription (NSSCKMDInstance *mdInstance, NSSCKFWInstance *fwInstance, CK_RV *pError)
static CK_VERSION nss_dbm_mdInstance_GetLibraryVersion (NSSCKMDInstance *mdInstance, NSSCKFWInstance *fwInstance)
static CK_BBOOL nss_dbm_mdInstance_ModuleHandlesSessionObjects (NSSCKMDInstance *mdInstance, NSSCKFWInstance *fwInstance)
static CK_RV nss_dbm_mdInstance_GetSlots (NSSCKMDInstance *mdInstance, NSSCKFWInstance *fwInstance, NSSCKMDSlot *slots[])

Variables

NSS_IMPLEMENT_DATA NSSCKMDInstance nss_dbm_mdInstance

Function Documentation

static CK_VERSION nss_dbm_mdInstance_GetCryptokiVersion ( NSSCKMDInstance *  mdInstance,
NSSCKFWInstance *  fwInstance 
) [static]

Definition at line 108 of file instance.c.

{
  static CK_VERSION rv = { 2, 1 };
  return rv;
}
static NSSUTF8* nss_dbm_mdInstance_GetLibraryDescription ( NSSCKMDInstance *  mdInstance,
NSSCKFWInstance *  fwInstance,
CK_RV pError 
) [static]

Definition at line 130 of file instance.c.

{
  return "Berkeley Database Module";
}
static CK_VERSION nss_dbm_mdInstance_GetLibraryVersion ( NSSCKMDInstance *  mdInstance,
NSSCKFWInstance *  fwInstance 
) [static]

Definition at line 141 of file instance.c.

{
  static CK_VERSION rv = { 1, 0 }; /* My own version number */
  return rv;
}
static NSSUTF8* nss_dbm_mdInstance_GetManufacturerID ( NSSCKMDInstance *  mdInstance,
NSSCKFWInstance *  fwInstance,
CK_RV pError 
) [static]

Definition at line 119 of file instance.c.

{
  return "Mozilla Foundation";
}
static CK_ULONG nss_dbm_mdInstance_GetNSlots ( NSSCKMDInstance *  mdInstance,
NSSCKFWInstance *  fwInstance,
CK_RV pError 
) [static]

Definition at line 96 of file instance.c.

{
  nss_dbm_instance_t *instance = (nss_dbm_instance_t *)mdInstance->etc;
  return instance->nSlots;
}
static CK_RV nss_dbm_mdInstance_GetSlots ( NSSCKMDInstance *  mdInstance,
NSSCKFWInstance *  fwInstance,
NSSCKMDSlot *  slots[] 
) [static]

Definition at line 162 of file instance.c.

{
  nss_dbm_instance_t *instance = (nss_dbm_instance_t *)mdInstance->etc;
  CK_ULONG i;
  CK_RV rv = CKR_OK;

  for( i = 0; i < instance->nSlots; i++ ) {
    slots[i] = nss_dbm_mdSlot_factory(instance, instance->filenames[i], 
                                      instance->flags[i], &rv);
    if( (NSSCKMDSlot *)NULL == slots[i] ) {
      return rv;
    }
  }

  return rv;
}

Here is the call graph for this function:

static CK_RV nss_dbm_mdInstance_Initialize ( NSSCKMDInstance *  mdInstance,
NSSCKFWInstance *  fwInstance,
NSSUTF8 configurationData 
) [static]

Definition at line 45 of file instance.c.

{
  CK_RV rv = CKR_OK;
  NSSArena *arena;
  nss_dbm_instance_t *instance;

  arena = NSSCKFWInstance_GetArena(fwInstance, &rv);
  if( ((NSSArena *)NULL == arena) && (CKR_OK != rv) ) {
    return rv;
  }

  instance = nss_ZNEW(arena, nss_dbm_instance_t);
  if( (nss_dbm_instance_t *)NULL == instance ) {
    return CKR_HOST_MEMORY;
  }

  instance->arena = arena;

  /*
   * This should parse the configuration data for information on
   * number and locations of databases, modes (e.g. readonly), etc.
   * But for now, we'll have one slot with a creatable read-write
   * database called "cert8.db."
   */

  instance->nSlots = 1;
  instance->filenames = nss_ZNEWARRAY(arena, char *, instance->nSlots);
  if( (char **)NULL == instance->filenames ) {
    return CKR_HOST_MEMORY;
  }

  instance->flags = nss_ZNEWARRAY(arena, int, instance->nSlots);
  if( (int *)NULL == instance->flags ) {
    return CKR_HOST_MEMORY;
  }

  instance->filenames[0] = "cert8.db";
  instance->flags[0] = O_RDWR|O_CREAT;

  mdInstance->etc = (void *)instance;
  return CKR_OK;
}

Here is the call graph for this function:

static CK_BBOOL nss_dbm_mdInstance_ModuleHandlesSessionObjects ( NSSCKMDInstance *  mdInstance,
NSSCKFWInstance *  fwInstance 
) [static]

Definition at line 152 of file instance.c.

{
  return CK_TRUE;
}

Variable Documentation