Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
loader.c File Reference
#include "loader.h"
#include "prmem.h"
#include "prerror.h"
#include "prinit.h"
#include "prenv.h"
#include "prio.h"
#include "prprf.h"
#include <stdio.h>
#include "prsystem.h"

Go to the source code of this file.

Defines

#define LSB(x)   ((x)&0xff)
#define MSB(x)   ((x)>>8)

Functions

static const char * getLibName (void)
static PRLibrarybl_LoadFreeblLibInSoftokenDir (const char *softokenPath, const char *name)
static PRLibrarybl_LoadLibrary (const char *name)
static PRStatus freebl_LoadDSO (void)
static PRStatus freebl_RunLoaderOnce (void)
RSAPrivateKey * RSA_NewKey (int keySizeInBits, SECItem *publicExponent)
SECStatus RSA_PublicKeyOp (RSAPublicKey *key, unsigned char *output, const unsigned char *input)
SECStatus RSA_PrivateKeyOp (RSAPrivateKey *key, unsigned char *output, const unsigned char *input)
SECStatus RSA_PrivateKeyOpDoubleChecked (RSAPrivateKey *key, unsigned char *output, const unsigned char *input)
SECStatus RSA_PrivateKeyCheck (RSAPrivateKey *key)
SECStatus DSA_NewKey (const PQGParams *params, DSAPrivateKey **privKey)
SECStatus DSA_SignDigest (DSAPrivateKey *key, SECItem *signature, const SECItem *digest)
SECStatus DSA_VerifyDigest (DSAPublicKey *key, const SECItem *signature, const SECItem *digest)
SECStatus DSA_NewKeyFromSeed (const PQGParams *params, const unsigned char *seed, DSAPrivateKey **privKey)
SECStatus DSA_SignDigestWithSeed (DSAPrivateKey *key, SECItem *signature, const SECItem *digest, const unsigned char *seed)
SECStatus DH_GenParam (int primeLen, DHParams **params)
SECStatus DH_NewKey (DHParams *params, DHPrivateKey **privKey)
SECStatus DH_Derive (SECItem *publicValue, SECItem *prime, SECItem *privateValue, SECItem *derivedSecret, unsigned int maxOutBytes)
SECStatus KEA_Derive (SECItem *prime, SECItem *public1, SECItem *public2, SECItem *private1, SECItem *private2, SECItem *derivedSecret)
PRBool KEA_Verify (SECItem *Y, SECItem *prime, SECItem *subPrime)
RC4Context * RC4_CreateContext (const unsigned char *key, int len)
void RC4_DestroyContext (RC4Context *cx, PRBool freeit)
SECStatus RC4_Encrypt (RC4Context *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
SECStatus RC4_Decrypt (RC4Context *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
RC2Context * RC2_CreateContext (const unsigned char *key, unsigned int len, const unsigned char *iv, int mode, unsigned effectiveKeyLen)
void RC2_DestroyContext (RC2Context *cx, PRBool freeit)
SECStatus RC2_Encrypt (RC2Context *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
SECStatus RC2_Decrypt (RC2Context *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
RC5Context * RC5_CreateContext (const SECItem *key, unsigned int rounds, unsigned int wordSize, const unsigned char *iv, int mode)
void RC5_DestroyContext (RC5Context *cx, PRBool freeit)
SECStatus RC5_Encrypt (RC5Context *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
SECStatus RC5_Decrypt (RC5Context *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
DESContext * DES_CreateContext (const unsigned char *key, const unsigned char *iv, int mode, PRBool encrypt)
void DES_DestroyContext (DESContext *cx, PRBool freeit)
SECStatus DES_Encrypt (DESContext *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
SECStatus DES_Decrypt (DESContext *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
AESContext * AES_CreateContext (const unsigned char *key, const unsigned char *iv, int mode, int encrypt, unsigned int keylen, unsigned int blocklen)
void AES_DestroyContext (AESContext *cx, PRBool freeit)
SECStatus AES_Encrypt (AESContext *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
SECStatus AES_Decrypt (AESContext *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
SECStatus MD5_Hash (unsigned char *dest, const char *src)
SECStatus MD5_HashBuf (unsigned char *dest, const unsigned char *src, uint32 src_length)
MD5ContextMD5_NewContext (void)
void MD5_DestroyContext (MD5Context *cx, PRBool freeit)
void MD5_Begin (MD5Context *cx)
void MD5_Update (MD5Context *cx, const unsigned char *input, unsigned int inputLen)
void MD5_End (MD5Context *cx, unsigned char *digest, unsigned int *digestLen, unsigned int maxDigestLen)
unsigned int MD5_FlattenSize (MD5Context *cx)
SECStatus MD5_Flatten (MD5Context *cx, unsigned char *space)
MD5ContextMD5_Resurrect (unsigned char *space, void *arg)
void MD5_TraceState (MD5Context *cx)
SECStatus MD2_Hash (unsigned char *dest, const char *src)
MD2Context * MD2_NewContext (void)
void MD2_DestroyContext (MD2Context *cx, PRBool freeit)
void MD2_Begin (MD2Context *cx)
void MD2_Update (MD2Context *cx, const unsigned char *input, unsigned int inputLen)
void MD2_End (MD2Context *cx, unsigned char *digest, unsigned int *digestLen, unsigned int maxDigestLen)
unsigned int MD2_FlattenSize (MD2Context *cx)
SECStatus MD2_Flatten (MD2Context *cx, unsigned char *space)
MD2Context * MD2_Resurrect (unsigned char *space, void *arg)
SECStatus SHA1_Hash (unsigned char *dest, const char *src)
SECStatus SHA1_HashBuf (unsigned char *dest, const unsigned char *src, uint32 src_length)
SHA1Context * SHA1_NewContext (void)
void SHA1_DestroyContext (SHA1Context *cx, PRBool freeit)
void SHA1_Begin (SHA1Context *cx)
void SHA1_Update (SHA1Context *cx, const unsigned char *input, unsigned int inputLen)
void SHA1_End (SHA1Context *cx, unsigned char *digest, unsigned int *digestLen, unsigned int maxDigestLen)
void SHA1_TraceState (SHA1Context *cx)
unsigned int SHA1_FlattenSize (SHA1Context *cx)
SECStatus SHA1_Flatten (SHA1Context *cx, unsigned char *space)
SHA1Context * SHA1_Resurrect (unsigned char *space, void *arg)
SECStatus RNG_RNGInit (void)
SECStatus RNG_RandomUpdate (const void *data, size_t bytes)
SECStatus RNG_GenerateGlobalRandomBytes (void *dest, size_t len)
void RNG_RNGShutdown (void)
SECStatus PQG_ParamGen (unsigned int j, PQGParams **pParams, PQGVerify **pVfy)
SECStatus PQG_ParamGenSeedLen (unsigned int j, unsigned int seedBytes, PQGParams **pParams, PQGVerify **pVfy)
SECStatus PQG_VerifyParams (const PQGParams *params, const PQGVerify *vfy, SECStatus *result)
void BL_Cleanup (void)
void BL_Unload (void)
SECStatus SHA256_Hash (unsigned char *dest, const char *src)
SECStatus SHA256_HashBuf (unsigned char *dest, const unsigned char *src, uint32 src_length)
SHA256Context * SHA256_NewContext (void)
void SHA256_DestroyContext (SHA256Context *cx, PRBool freeit)
void SHA256_Begin (SHA256Context *cx)
void SHA256_Update (SHA256Context *cx, const unsigned char *input, unsigned int inputLen)
void SHA256_End (SHA256Context *cx, unsigned char *digest, unsigned int *digestLen, unsigned int maxDigestLen)
void SHA256_TraceState (SHA256Context *cx)
unsigned int SHA256_FlattenSize (SHA256Context *cx)
SECStatus SHA256_Flatten (SHA256Context *cx, unsigned char *space)
SHA256Context * SHA256_Resurrect (unsigned char *space, void *arg)
SECStatus SHA512_Hash (unsigned char *dest, const char *src)
SECStatus SHA512_HashBuf (unsigned char *dest, const unsigned char *src, uint32 src_length)
SHA512Context * SHA512_NewContext (void)
void SHA512_DestroyContext (SHA512Context *cx, PRBool freeit)
void SHA512_Begin (SHA512Context *cx)
void SHA512_Update (SHA512Context *cx, const unsigned char *input, unsigned int inputLen)
void SHA512_End (SHA512Context *cx, unsigned char *digest, unsigned int *digestLen, unsigned int maxDigestLen)
void SHA512_TraceState (SHA512Context *cx)
unsigned int SHA512_FlattenSize (SHA512Context *cx)
SECStatus SHA512_Flatten (SHA512Context *cx, unsigned char *space)
SHA512Context * SHA512_Resurrect (unsigned char *space, void *arg)
SECStatus SHA384_Hash (unsigned char *dest, const char *src)
SECStatus SHA384_HashBuf (unsigned char *dest, const unsigned char *src, uint32 src_length)
SHA384Context * SHA384_NewContext (void)
void SHA384_DestroyContext (SHA384Context *cx, PRBool freeit)
void SHA384_Begin (SHA384Context *cx)
void SHA384_Update (SHA384Context *cx, const unsigned char *input, unsigned int inputLen)
void SHA384_End (SHA384Context *cx, unsigned char *digest, unsigned int *digestLen, unsigned int maxDigestLen)
void SHA384_TraceState (SHA384Context *cx)
unsigned int SHA384_FlattenSize (SHA384Context *cx)
SECStatus SHA384_Flatten (SHA384Context *cx, unsigned char *space)
SHA384Context * SHA384_Resurrect (unsigned char *space, void *arg)
AESKeyWrapContext * AESKeyWrap_CreateContext (const unsigned char *key, const unsigned char *iv, int encrypt, unsigned int keylen)
void AESKeyWrap_DestroyContext (AESKeyWrapContext *cx, PRBool freeit)
SECStatus AESKeyWrap_Encrypt (AESKeyWrapContext *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
SECStatus AESKeyWrap_Decrypt (AESKeyWrapContext *cx, unsigned char *output, unsigned int *outputLen, unsigned int maxOutputLen, const unsigned char *input, unsigned int inputLen)
PRBool BLAPI_SHVerify (const char *name, PRFuncPtr addr)
PRBool BLAPI_VerifySelf (const char *name)
SECStatus EC_NewKey (ECParams *params, ECPrivateKey **privKey)
SECStatus EC_NewKeyFromSeed (ECParams *params, ECPrivateKey **privKey, const unsigned char *seed, int seedlen)
SECStatus EC_ValidatePublicKey (ECParams *params, SECItem *publicValue)
SECStatus ECDH_Derive (SECItem *publicValue, ECParams *params, SECItem *privateValue, PRBool withCofactor, SECItem *derivedSecret)
SECStatus ECDSA_SignDigest (ECPrivateKey *key, SECItem *signature, const SECItem *digest)
SECStatus ECDSA_VerifyDigest (ECPublicKey *key, const SECItem *signature, const SECItem *digest)
SECStatus ECDSA_SignDigestWithSeed (ECPrivateKey *key, SECItem *signature, const SECItem *digest, const unsigned char *seed, const int seedlen)
AESContext * AES_AllocateContext (void)
AESKeyWrapContext * AESKeyWrap_AllocateContext (void)
DESContext * DES_AllocateContext (void)
RC2Context * RC2_AllocateContext (void)
RC4Context * RC4_AllocateContext (void)
SECStatus AES_InitContext (AESContext *cx, const unsigned char *key, unsigned int keylen, const unsigned char *iv, int mode, unsigned int encrypt, unsigned int blocklen)
SECStatus AESKeyWrap_InitContext (AESKeyWrapContext *cx, const unsigned char *key, unsigned int keylen, const unsigned char *iv, int mode, unsigned int encrypt, unsigned int blocklen)
SECStatus DES_InitContext (DESContext *cx, const unsigned char *key, unsigned int keylen, const unsigned char *iv, int mode, unsigned int encrypt, unsigned int xtra)
SECStatus RC2_InitContext (RC2Context *cx, const unsigned char *key, unsigned int keylen, const unsigned char *iv, int mode, unsigned int effectiveKeyLen, unsigned int xtra)
SECStatus RC4_InitContext (RC4Context *cx, const unsigned char *key, unsigned int keylen, const unsigned char *x1, int x2, unsigned int x3, unsigned int x4)
void MD2_Clone (MD2Context *dest, MD2Context *src)
void MD5_Clone (MD5Context *dest, MD5Context *src)
void SHA1_Clone (SHA1Context *dest, SHA1Context *src)
void SHA256_Clone (SHA256Context *dest, SHA256Context *src)
void SHA384_Clone (SHA384Context *dest, SHA384Context *src)
void SHA512_Clone (SHA512Context *dest, SHA512Context *src)
SECStatus TLS_PRF (const SECItem *secret, const char *label, SECItem *seed, SECItem *result, PRBool isFIPS)
const SECHashObject * HASH_GetRawHashObject (HASH_HashType hashType)
void HMAC_Destroy (HMACContext *cx, PRBool freeit)
HMACContext * HMAC_Create (const SECHashObject *hashObj, const unsigned char *secret, unsigned int secret_len, PRBool isFIPS)
SECStatus HMAC_Init (HMACContext *cx, const SECHashObject *hashObj, const unsigned char *secret, unsigned int secret_len, PRBool isFIPS)
void HMAC_Begin (HMACContext *cx)
void HMAC_Update (HMACContext *cx, const unsigned char *data, unsigned int data_len)
SECStatus HMAC_Finish (HMACContext *cx, unsigned char *result, unsigned int *result_len, unsigned int max_result_len)
HMACContext * HMAC_Clone (HMACContext *cx)
void RNG_SystemInfoForRNG (void)
SECStatus FIPS186Change_GenerateX (unsigned char *XKEY, const unsigned char *XSEEDj, unsigned char *x_j)
SECStatus FIPS186Change_ReduceModQForDSA (const unsigned char *w, const unsigned char *q, unsigned char *xj)

Variables

static const char * default_name = "."SHLIB_SUFFIX
const char * softoken = "."SHLIB_SUFFIX
static PRLibraryblLib
static const FREEBLVector * vector
static const char * libraryName = NULL
static const PRCallOnceType pristineCallOnce
static PRCallOnceType loadFreeBLOnce

Define Documentation

#define LSB (   x)    ((x)&0xff)

Definition at line 283 of file loader.c.

#define MSB (   x)    ((x)>>8)

Definition at line 284 of file loader.c.


Function Documentation

AESContext* AES_AllocateContext ( void  )

Definition at line 1414 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_AES_AllocateContext)();
}
AESContext* AES_CreateContext ( const unsigned char *  key,
const unsigned char *  iv,
int  mode,
int  encrypt,
unsigned int  keylen,
unsigned int  blocklen 
)

Definition at line 630 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_AES_CreateContext)(key, iv, mode, encrypt, keylen, 
                                   blocklen);
}
SECStatus AES_Decrypt ( AESContext *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 660 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_AES_Decrypt)(cx, output, outputLen, maxOutputLen, 
                             input, inputLen);
}
void AES_DestroyContext ( AESContext *  cx,
PRBool  freeit 
)

Definition at line 641 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_AES_DestroyContext)(cx, freeit);
}
SECStatus AES_Encrypt ( AESContext *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 649 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_AES_Encrypt)(cx, output, outputLen, maxOutputLen, 
                             input, inputLen);
}
SECStatus AES_InitContext ( AESContext *  cx,
const unsigned char *  key,
unsigned int  keylen,
const unsigned char *  iv,
int  mode,
unsigned int  encrypt,
unsigned int  blocklen 
)

Definition at line 1454 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_AES_InitContext)(cx, key, keylen, iv, mode, encrypt, 
                                 blocklen);
}
AESKeyWrapContext* AESKeyWrap_AllocateContext ( void  )

Definition at line 1422 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_AESKeyWrap_AllocateContext)();
}

Here is the call graph for this function:

AESKeyWrapContext* AESKeyWrap_CreateContext ( const unsigned char *  key,
const unsigned char *  iv,
int  encrypt,
unsigned int  keylen 
)

Definition at line 1287 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return vector->p_AESKeyWrap_CreateContext(key, iv, encrypt, keylen);
}

Here is the call graph for this function:

SECStatus AESKeyWrap_Decrypt ( AESKeyWrapContext *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 1314 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return vector->p_AESKeyWrap_Decrypt(cx, output, outputLen, maxOutputLen,
                                    input, inputLen);
}

Here is the call graph for this function:

void AESKeyWrap_DestroyContext ( AESKeyWrapContext *  cx,
PRBool  freeit 
)

Definition at line 1296 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  vector->p_AESKeyWrap_DestroyContext(cx, freeit);
}

Here is the call graph for this function:

SECStatus AESKeyWrap_Encrypt ( AESKeyWrapContext *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 1304 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return vector->p_AESKeyWrap_Encrypt(cx, output, outputLen, maxOutputLen,
                                      input, inputLen);
}

Here is the call graph for this function:

SECStatus AESKeyWrap_InitContext ( AESKeyWrapContext *  cx,
const unsigned char *  key,
unsigned int  keylen,
const unsigned char *  iv,
int  mode,
unsigned int  encrypt,
unsigned int  blocklen 
)

Definition at line 1465 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_AESKeyWrap_InitContext)(cx, key, keylen, iv, mode, 
                                       encrypt, blocklen);
}

Here is the call graph for this function:

Definition at line 982 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_BL_Cleanup)();
}
static PRLibrary* bl_LoadFreeblLibInSoftokenDir ( const char *  softokenPath,
const char *  name 
) [static]

Definition at line 203 of file loader.c.

{
    PRLibrary *dlh = NULL;
    char *fullName = NULL;
    char* c;
    PRLibSpec libSpec;

    /* Remove "libsoftokn" from the pathname and add the freebl libname */
    c = strrchr(softokenPath, PR_GetDirectorySeparator());
    if (c) {
        size_t softoknPathSize = 1 + c - softokenPath;
        fullName = (char*) PORT_Alloc(strlen(name) + softoknPathSize + 1);
        if (fullName) {
            memcpy(fullName, softokenPath, softoknPathSize);
            strcpy(fullName + softoknPathSize, name); 
#ifdef DEBUG_LOADER
            PR_fprintf(PR_STDOUT, "\nAttempting to load fully-qualified %s\n", 
                       fullName);
#endif
            libSpec.type = PR_LibSpec_Pathname;
            libSpec.value.pathname = fullName;
            dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL);
            PORT_Free(fullName);
        }
    }
    return dlh;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRLibrary* bl_LoadLibrary ( const char *  name) [static]

Definition at line 232 of file loader.c.

{
    PRLibrary *lib = NULL;
    PRFuncPtr fn_addr;
    char* softokenPath = NULL;
    PRLibSpec libSpec;

    /* Get the pathname for the loaded libsoftokn, i.e. /usr/lib/libsoftokn3.so
     * PR_GetLibraryFilePathname works with either the base library name or a
     * function pointer, depending on the platform. We can't query an exported
     * symbol such as NSC_GetFunctionList, because on some platforms we can't
     * find symbols in loaded implicit dependencies such as libsoftokn.
     * But we can just get the address of this function !
     */
    fn_addr = (PRFuncPtr) &bl_LoadLibrary;
    softokenPath = PR_GetLibraryFilePathname(softoken, fn_addr);

    if (softokenPath) {
        lib = bl_LoadFreeblLibInSoftokenDir(softokenPath, name);
#ifdef XP_UNIX
        if (!lib) {
            /*
             * If softokenPath is a symbolic link, resolve the symbolic
             * link and try again.
             */
            char* originalSoftokenPath = bl_GetOriginalPathname(softokenPath);
            if (originalSoftokenPath) {
                PR_Free(softokenPath);
                softokenPath = originalSoftokenPath;
                lib = bl_LoadFreeblLibInSoftokenDir(softokenPath, name);
            }
        }
#endif
        PR_Free(softokenPath);
    }
    if (!lib) {
#ifdef DEBUG_LOADER
        PR_fprintf(PR_STDOUT, "\nAttempting to load %s\n", name);
#endif
        libSpec.type = PR_LibSpec_Pathname;
        libSpec.value.pathname = name;
        lib = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL);
    }
    if (NULL == lib) {
#ifdef DEBUG_LOADER
        PR_fprintf(PR_STDOUT, "\nLoading failed : %s.\n", name);
#endif
    }
    return lib;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 990 of file loader.c.

{
  /* This function is not thread-safe, but doesn't need to be, because it is
   * only called from functions that are also defined as not thread-safe,
   * namely C_Finalize in softoken, and the SSL bypass shutdown callback called
   * from NSS_Shutdown. */
  char *disableUnload = NULL;
  vector = NULL;
  /* If an SSL socket is configured with SSL_BYPASS_PKCS11, but the application
   * never does a handshake on it, BL_Unload will be called even though freebl
   * was never loaded. So, don't assert blLib. */
  if (blLib) {
      disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
      if (!disableUnload) {
          PRStatus status = PR_UnloadLibrary(blLib);
          PORT_Assert(PR_SUCCESS == status);
      }
      blLib = NULL;
  }
  loadFreeBLOnce = pristineCallOnce;
}
PRBool BLAPI_SHVerify ( const char *  name,
PRFuncPtr  addr 
)

Definition at line 1325 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return PR_FALSE;
  return vector->p_BLAPI_SHVerify(name, addr);
}
PRBool BLAPI_VerifySelf ( const char *  name)

Definition at line 1339 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return PR_FALSE;
  return vector->p_BLAPI_VerifySelf(libraryName);
}
DESContext* DES_AllocateContext ( void  )

Definition at line 1430 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_DES_AllocateContext)();
}

Here is the call graph for this function:

DESContext* DES_CreateContext ( const unsigned char *  key,
const unsigned char *  iv,
int  mode,
PRBool  encrypt 
)

Definition at line 591 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_DES_CreateContext)(key, iv, mode, encrypt);
}

Here is the call graph for this function:

SECStatus DES_Decrypt ( DESContext *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 619 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_DES_Decrypt)(cx, output, outputLen, maxOutputLen, input, 
                                inputLen);
}

Here is the call graph for this function:

void DES_DestroyContext ( DESContext *  cx,
PRBool  freeit 
)

Definition at line 600 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_DES_DestroyContext)(cx, freeit);
}

Here is the call graph for this function:

SECStatus DES_Encrypt ( DESContext *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 608 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_DES_Encrypt)(cx, output, outputLen, maxOutputLen, input, 
                                inputLen);
}

Here is the call graph for this function:

SECStatus DES_InitContext ( DESContext *  cx,
const unsigned char *  key,
unsigned int  keylen,
const unsigned char *  iv,
int  mode,
unsigned int  encrypt,
unsigned int  xtra 
)

Definition at line 1476 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_DES_InitContext)(cx, key, keylen, iv, mode, encrypt, xtra);
}

Here is the call graph for this function:

SECStatus DH_Derive ( SECItem *  publicValue,
SECItem *  prime,
SECItem *  privateValue,
SECItem *  derivedSecret,
unsigned int  maxOutBytes 
)

Definition at line 447 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_DH_Derive)( publicValue, prime, privateValue, 
                            derivedSecret, maxOutBytes);
}

Here is the call graph for this function:

SECStatus DH_GenParam ( int  primeLen,
DHParams **  params 
)

Definition at line 431 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_DH_GenParam)(primeLen, params);
}

Here is the call graph for this function:

SECStatus DH_NewKey ( DHParams *  params,
DHPrivateKey **  privKey 
)

Definition at line 439 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_DH_NewKey)( params, privKey);
}

Here is the call graph for this function:

SECStatus DSA_NewKey ( const PQGParams *  params,
DSAPrivateKey **  privKey 
)

Definition at line 388 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_DSA_NewKey)(params, privKey);
}

Here is the call graph for this function:

SECStatus DSA_NewKeyFromSeed ( const PQGParams *  params,
const unsigned char *  seed,
DSAPrivateKey **  privKey 
)

Definition at line 413 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_DSA_NewKeyFromSeed)(params,  seed, privKey);
}

Here is the call graph for this function:

SECStatus DSA_SignDigest ( DSAPrivateKey *  key,
SECItem *  signature,
const SECItem *  digest 
)

Definition at line 396 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_DSA_SignDigest)( key,  signature,  digest);
}

Here is the call graph for this function:

SECStatus DSA_SignDigestWithSeed ( DSAPrivateKey *  key,
SECItem *  signature,
const SECItem *  digest,
const unsigned char *  seed 
)

Definition at line 422 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_DSA_SignDigestWithSeed)( key, signature, digest, seed);
}

Here is the call graph for this function:

SECStatus DSA_VerifyDigest ( DSAPublicKey *  key,
const SECItem *  signature,
const SECItem *  digest 
)

Definition at line 404 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_DSA_VerifyDigest)( key,  signature,  digest);
}

Here is the call graph for this function:

SECStatus EC_NewKey ( ECParams *  params,
ECPrivateKey **  privKey 
)

Definition at line 1349 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_EC_NewKey)( params, privKey );
}

Here is the call graph for this function:

SECStatus EC_NewKeyFromSeed ( ECParams *  params,
ECPrivateKey **  privKey,
const unsigned char *  seed,
int  seedlen 
)

Definition at line 1357 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_EC_NewKeyFromSeed)( params, privKey, seed, seedlen );
}

Here is the call graph for this function:

SECStatus EC_ValidatePublicKey ( ECParams *  params,
SECItem *  publicValue 
)

Definition at line 1366 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_EC_ValidatePublicKey)( params, publicValue );
}

Here is the call graph for this function:

SECStatus ECDH_Derive ( SECItem *  publicValue,
ECParams *  params,
SECItem *  privateValue,
PRBool  withCofactor,
SECItem *  derivedSecret 
)

Definition at line 1374 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_ECDH_Derive)( publicValue, params, privateValue,
                                  withCofactor, derivedSecret );
}

Here is the call graph for this function:

SECStatus ECDSA_SignDigest ( ECPrivateKey *  key,
SECItem *  signature,
const SECItem *  digest 
)

Definition at line 1384 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_ECDSA_SignDigest)( key, signature, digest );
}

Here is the call graph for this function:

SECStatus ECDSA_SignDigestWithSeed ( ECPrivateKey *  key,
SECItem *  signature,
const SECItem *  digest,
const unsigned char *  seed,
const int  seedlen 
)

Definition at line 1402 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_ECDSA_SignDigestWithSeed)( key, signature, digest, 
      seed, seedlen );
}

Here is the call graph for this function:

SECStatus ECDSA_VerifyDigest ( ECPublicKey *  key,
const SECItem *  signature,
const SECItem *  digest 
)

Definition at line 1393 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_ECDSA_VerifyDigest)( key, signature, digest );
}

Here is the call graph for this function:

SECStatus FIPS186Change_GenerateX ( unsigned char *  XKEY,
const unsigned char *  XSEEDj,
unsigned char *  x_j 
)

Definition at line 1641 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_FIPS186Change_GenerateX)(XKEY, XSEEDj, x_j);
}
SECStatus FIPS186Change_ReduceModQForDSA ( const unsigned char *  w,
const unsigned char *  q,
unsigned char *  xj 
)

Definition at line 1650 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_FIPS186Change_ReduceModQForDSA)(w, q, xj);
}
static PRStatus freebl_LoadDSO ( void  ) [static]

Definition at line 292 of file loader.c.

{
  PRLibrary *  handle;
  const char * name = getLibName();

  if (!name) {
    PR_SetError(PR_LOAD_LIBRARY_ERROR, 0);
    return PR_FAILURE;
  }

  handle = bl_LoadLibrary(name);
  if (handle) {
    PRFuncPtr address = PR_FindFunctionSymbol(handle, "FREEBL_GetVector");
    PRStatus status;
    if (address) {
      FREEBLGetVectorFn  * getVector = (FREEBLGetVectorFn *)address;
      const FREEBLVector * dsoVector = getVector();
      if (dsoVector) {
       unsigned short dsoVersion = dsoVector->version;
       unsigned short  myVersion = FREEBL_VERSION;
       if (MSB(dsoVersion) == MSB(myVersion) && 
           LSB(dsoVersion) >= LSB(myVersion) &&
           dsoVector->length >= sizeof(FREEBLVector)) {
          vector = dsoVector;
         libraryName = name;
         blLib = handle;
         return PR_SUCCESS;
       }
      }
    }
    status = PR_UnloadLibrary(handle);
    PORT_Assert(PR_SUCCESS == status);
  }
  return PR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRStatus freebl_RunLoaderOnce ( void  ) [static]

Definition at line 332 of file loader.c.

{
  PRStatus status;

  status = PR_CallOnce(&loadFreeBLOnce, &freebl_LoadDSO);
  return status;
}

Here is the call graph for this function:

static const char* getLibName ( void  ) [static]

Definition at line 129 of file loader.c.

{ return default_name; }

Here is the caller graph for this function:

const SECHashObject* HASH_GetRawHashObject ( HASH_HashType  hashType)

Definition at line 1564 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_HASH_GetRawHashObject)(hashType);
}
void HMAC_Begin ( HMACContext *  cx)

Definition at line 1599 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_HMAC_Begin)(cx);
}

Here is the call graph for this function:

HMACContext* HMAC_Clone ( HMACContext *  cx)

Definition at line 1624 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_HMAC_Clone)(cx);
}

Here is the call graph for this function:

HMACContext* HMAC_Create ( const SECHashObject *  hashObj,
const unsigned char *  secret,
unsigned int  secret_len,
PRBool  isFIPS 
)

Definition at line 1581 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_HMAC_Create)(hashObj, secret, secret_len, isFIPS);
}

Here is the call graph for this function:

void HMAC_Destroy ( HMACContext *  cx,
PRBool  freeit 
)

Definition at line 1573 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_HMAC_Destroy)(cx, freeit);
}

Here is the call graph for this function:

SECStatus HMAC_Finish ( HMACContext *  cx,
unsigned char *  result,
unsigned int result_len,
unsigned int  max_result_len 
)

Definition at line 1615 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_HMAC_Finish)(cx, result, result_len, max_result_len);
}

Here is the call graph for this function:

SECStatus HMAC_Init ( HMACContext *  cx,
const SECHashObject *  hashObj,
const unsigned char *  secret,
unsigned int  secret_len,
PRBool  isFIPS 
)

Definition at line 1590 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_HMAC_Init)(cx, hashObj, secret, secret_len, isFIPS);
}

Here is the call graph for this function:

void HMAC_Update ( HMACContext *  cx,
const unsigned char *  data,
unsigned int  data_len 
)

Definition at line 1607 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_HMAC_Update)(cx, data, data_len);
}

Here is the call graph for this function:

SECStatus KEA_Derive ( SECItem *  prime,
SECItem *  public1,
SECItem *  public2,
SECItem *  private1,
SECItem *  private2,
SECItem *  derivedSecret 
)

Definition at line 457 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_KEA_Derive)(prime, public1, public2, 
                               private1, private2, derivedSecret);
}

Here is the call graph for this function:

PRBool KEA_Verify ( SECItem *  Y,
SECItem *  prime,
SECItem *  subPrime 
)

Definition at line 467 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return PR_FALSE;
  return (vector->p_KEA_Verify)(Y, prime, subPrime);
}

Here is the call graph for this function:

void MD2_Begin ( MD2Context *  cx)

Definition at line 784 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_MD2_Begin)(cx);
}
void MD2_Clone ( MD2Context *  dest,
MD2Context *  src 
)

Definition at line 1507 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_MD2_Clone)(dest, src);
}
void MD2_DestroyContext ( MD2Context *  cx,
PRBool  freeit 
)

Definition at line 776 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_MD2_DestroyContext)(cx, freeit);
}
void MD2_End ( MD2Context *  cx,
unsigned char *  digest,
unsigned int digestLen,
unsigned int  maxDigestLen 
)

Definition at line 800 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_MD2_End)(cx, digest, digestLen, maxDigestLen);
}
SECStatus MD2_Flatten ( MD2Context *  cx,
unsigned char *  space 
)

Definition at line 817 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_MD2_Flatten)(cx, space);
}
unsigned int MD2_FlattenSize ( MD2Context *  cx)

Definition at line 809 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return 0;
  return (vector->p_MD2_FlattenSize)(cx);
}
SECStatus MD2_Hash ( unsigned char *  dest,
const char *  src 
)

Definition at line 760 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_MD2_Hash)(dest, src);
}
MD2Context* MD2_NewContext ( void  )

Definition at line 768 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_MD2_NewContext)();
}
MD2Context* MD2_Resurrect ( unsigned char *  space,
void arg 
)

Definition at line 825 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_MD2_Resurrect)(space, arg);
}
void MD2_Update ( MD2Context *  cx,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 792 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_MD2_Update)(cx, input, inputLen);
}

Definition at line 703 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_MD5_Begin)(cx);
}
void MD5_Clone ( MD5Context dest,
MD5Context src 
)

Definition at line 1515 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_MD5_Clone)(dest, src);
}
void MD5_DestroyContext ( MD5Context cx,
PRBool  freeit 
)

Definition at line 695 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_MD5_DestroyContext)(cx, freeit);
}
void MD5_End ( MD5Context cx,
unsigned char *  digest,
unsigned int digestLen,
unsigned int  maxDigestLen 
)

Definition at line 719 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_MD5_End)(cx, digest, digestLen, maxDigestLen);
}
SECStatus MD5_Flatten ( MD5Context cx,
unsigned char *  space 
)

Definition at line 736 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_MD5_Flatten)(cx, space);
}
unsigned int MD5_FlattenSize ( MD5Context cx)

Definition at line 728 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return 0;
  return (vector->p_MD5_FlattenSize)(cx);
}
SECStatus MD5_Hash ( unsigned char *  dest,
const char *  src 
)

Definition at line 671 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_MD5_Hash)(dest, src);
}
SECStatus MD5_HashBuf ( unsigned char *  dest,
const unsigned char *  src,
uint32  src_length 
)

Definition at line 679 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_MD5_HashBuf)(dest, src, src_length);
}

Definition at line 687 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_MD5_NewContext)();
}
MD5Context* MD5_Resurrect ( unsigned char *  space,
void arg 
)

Definition at line 744 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_MD5_Resurrect)(space, arg);
}

Definition at line 752 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_MD5_TraceState)(cx);
}
void MD5_Update ( MD5Context cx,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 711 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_MD5_Update)(cx, input, inputLen);
}
SECStatus PQG_ParamGen ( unsigned int  j,
PQGParams **  pParams,
PQGVerify **  pVfy 
)

Definition at line 956 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_PQG_ParamGen)(j, pParams, pVfy); 
}
SECStatus PQG_ParamGenSeedLen ( unsigned int  j,
unsigned int  seedBytes,
PQGParams **  pParams,
PQGVerify **  pVfy 
)

Definition at line 964 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_PQG_ParamGenSeedLen)(j, seedBytes, pParams, pVfy);
}
SECStatus PQG_VerifyParams ( const PQGParams *  params,
const PQGVerify *  vfy,
SECStatus result 
)

Definition at line 973 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_PQG_VerifyParams)(params, vfy, result);
}
RC2Context* RC2_AllocateContext ( void  )

Definition at line 1438 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_RC2_AllocateContext)();
}

Here is the call graph for this function:

RC2Context* RC2_CreateContext ( const unsigned char *  key,
unsigned int  len,
const unsigned char *  iv,
int  mode,
unsigned  effectiveKeyLen 
)

Definition at line 513 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_RC2_CreateContext)(key, len, iv, mode, effectiveKeyLen);
}

Here is the call graph for this function:

SECStatus RC2_Decrypt ( RC2Context *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 541 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RC2_Decrypt)(cx, output, outputLen, maxOutputLen, input, 
                                inputLen);
}

Here is the call graph for this function:

void RC2_DestroyContext ( RC2Context *  cx,
PRBool  freeit 
)

Definition at line 522 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_RC2_DestroyContext)(cx, freeit);
}

Here is the call graph for this function:

SECStatus RC2_Encrypt ( RC2Context *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 530 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RC2_Encrypt)(cx, output, outputLen, maxOutputLen, input, 
                                inputLen);
}

Here is the call graph for this function:

SECStatus RC2_InitContext ( RC2Context *  cx,
const unsigned char *  key,
unsigned int  keylen,
const unsigned char *  iv,
int  mode,
unsigned int  effectiveKeyLen,
unsigned int  xtra 
)

Definition at line 1486 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RC2_InitContext)(cx, key, keylen, iv, mode, 
                                 effectiveKeyLen, xtra);
}

Here is the call graph for this function:

RC4Context* RC4_AllocateContext ( void  )

Definition at line 1446 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_RC4_AllocateContext)();
}

Here is the call graph for this function:

RC4Context* RC4_CreateContext ( const unsigned char *  key,
int  len 
)

Definition at line 475 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_RC4_CreateContext)(key, len);
}

Here is the call graph for this function:

SECStatus RC4_Decrypt ( RC4Context *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 502 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RC4_Decrypt)(cx, output, outputLen, maxOutputLen, input, 
                                inputLen);
}

Here is the call graph for this function:

void RC4_DestroyContext ( RC4Context *  cx,
PRBool  freeit 
)

Definition at line 483 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_RC4_DestroyContext)(cx, freeit);
}

Here is the call graph for this function:

SECStatus RC4_Encrypt ( RC4Context *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 491 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RC4_Encrypt)(cx, output, outputLen, maxOutputLen, input, 
                                inputLen);
}

Here is the call graph for this function:

SECStatus RC4_InitContext ( RC4Context *  cx,
const unsigned char *  key,
unsigned int  keylen,
const unsigned char *  x1,
int  x2,
unsigned int  x3,
unsigned int  x4 
)

Definition at line 1497 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RC4_InitContext)(cx, key, keylen, x1, x2, x3, x4);
}

Here is the call graph for this function:

RC5Context* RC5_CreateContext ( const SECItem *  key,
unsigned int  rounds,
unsigned int  wordSize,
const unsigned char *  iv,
int  mode 
)

Definition at line 552 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_RC5_CreateContext)(key, rounds, wordSize, iv, mode);
}

Here is the call graph for this function:

SECStatus RC5_Decrypt ( RC5Context *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 580 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RC5_Decrypt)(cx, output, outputLen, maxOutputLen, input, 
                                inputLen);
}

Here is the call graph for this function:

void RC5_DestroyContext ( RC5Context *  cx,
PRBool  freeit 
)

Definition at line 561 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_RC5_DestroyContext)(cx, freeit);
}

Here is the call graph for this function:

SECStatus RC5_Encrypt ( RC5Context *  cx,
unsigned char *  output,
unsigned int outputLen,
unsigned int  maxOutputLen,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 569 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RC5_Encrypt)(cx, output, outputLen, maxOutputLen, input, 
                             inputLen);
}

Here is the call graph for this function:

SECStatus RNG_GenerateGlobalRandomBytes ( void dest,
size_t  len 
)

Definition at line 940 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RNG_GenerateGlobalRandomBytes)(dest, len);
}
SECStatus RNG_RandomUpdate ( const void data,
size_t  bytes 
)

Definition at line 932 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RNG_RandomUpdate)(data, bytes);
}

Definition at line 924 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RNG_RNGInit)();
}

Definition at line 948 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_RNG_RNGShutdown)();
}

Definition at line 1632 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_RNG_SystemInfoForRNG)();

}
RSAPrivateKey* RSA_NewKey ( int  keySizeInBits,
SECItem *  publicExponent 
)

Definition at line 342 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_RSA_NewKey)(keySizeInBits, publicExponent);
}
SECStatus RSA_PrivateKeyCheck ( RSAPrivateKey *  key)

Definition at line 380 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RSA_PrivateKeyCheck)(key);
}
SECStatus RSA_PrivateKeyOp ( RSAPrivateKey *  key,
unsigned char *  output,
const unsigned char *  input 
)

Definition at line 360 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RSA_PrivateKeyOp)(key, output, input);
}
SECStatus RSA_PrivateKeyOpDoubleChecked ( RSAPrivateKey *  key,
unsigned char *  output,
const unsigned char *  input 
)

Definition at line 370 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RSA_PrivateKeyOpDoubleChecked)(key, output, input);
}
SECStatus RSA_PublicKeyOp ( RSAPublicKey *  key,
unsigned char *  output,
const unsigned char *  input 
)

Definition at line 350 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_RSA_PublicKeyOp)(key, output, input);
}
void SHA1_Begin ( SHA1Context *  cx)

Definition at line 866 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA1_Begin)(cx);
}
void SHA1_Clone ( SHA1Context *  dest,
SHA1Context *  src 
)

Definition at line 1523 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_SHA1_Clone)(dest, src);
}
void SHA1_DestroyContext ( SHA1Context *  cx,
PRBool  freeit 
)

Definition at line 858 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA1_DestroyContext)(cx, freeit);
}
void SHA1_End ( SHA1Context *  cx,
unsigned char *  digest,
unsigned int digestLen,
unsigned int  maxDigestLen 
)

Definition at line 883 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA1_End)(cx, digest, digestLen, maxDigestLen);
}
SECStatus SHA1_Flatten ( SHA1Context *  cx,
unsigned char *  space 
)

Definition at line 908 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA1_Flatten)(cx, space);
}
unsigned int SHA1_FlattenSize ( SHA1Context *  cx)

Definition at line 900 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return 0;
  return (vector->p_SHA1_FlattenSize)(cx);
}
SECStatus SHA1_Hash ( unsigned char *  dest,
const char *  src 
)

Definition at line 834 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA1_Hash)(dest, src);
}
SECStatus SHA1_HashBuf ( unsigned char *  dest,
const unsigned char *  src,
uint32  src_length 
)

Definition at line 842 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA1_HashBuf)(dest, src, src_length);
}
SHA1Context* SHA1_NewContext ( void  )

Definition at line 850 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_SHA1_NewContext)();
}
SHA1Context* SHA1_Resurrect ( unsigned char *  space,
void arg 
)

Definition at line 916 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_SHA1_Resurrect)(space, arg);
}
void SHA1_TraceState ( SHA1Context *  cx)

Definition at line 892 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA1_TraceState)(cx);
}
void SHA1_Update ( SHA1Context *  cx,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 874 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA1_Update)(cx, input, inputLen);
}
void SHA256_Begin ( SHA256Context *  cx)

Definition at line 1047 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA256_Begin)(cx);
}
void SHA256_Clone ( SHA256Context *  dest,
SHA256Context *  src 
)

Definition at line 1531 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_SHA256_Clone)(dest, src);
}
void SHA256_DestroyContext ( SHA256Context *  cx,
PRBool  freeit 
)

Definition at line 1039 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA256_DestroyContext)(cx, freeit);
}
void SHA256_End ( SHA256Context *  cx,
unsigned char *  digest,
unsigned int digestLen,
unsigned int  maxDigestLen 
)

Definition at line 1064 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA256_End)(cx, digest, digestLen, maxDigestLen);
}
SECStatus SHA256_Flatten ( SHA256Context *  cx,
unsigned char *  space 
)

Definition at line 1089 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA256_Flatten)(cx, space);
}
unsigned int SHA256_FlattenSize ( SHA256Context *  cx)

Definition at line 1081 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return 0;
  return (vector->p_SHA256_FlattenSize)(cx);
}
SECStatus SHA256_Hash ( unsigned char *  dest,
const char *  src 
)

Definition at line 1015 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA256_Hash)(dest, src);
}
SECStatus SHA256_HashBuf ( unsigned char *  dest,
const unsigned char *  src,
uint32  src_length 
)

Definition at line 1023 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA256_HashBuf)(dest, src, src_length);
}
SHA256Context* SHA256_NewContext ( void  )

Definition at line 1031 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_SHA256_NewContext)();
}
SHA256Context* SHA256_Resurrect ( unsigned char *  space,
void arg 
)

Definition at line 1097 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_SHA256_Resurrect)(space, arg);
}
void SHA256_TraceState ( SHA256Context *  cx)

Definition at line 1073 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA256_TraceState)(cx);
}
void SHA256_Update ( SHA256Context *  cx,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 1055 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA256_Update)(cx, input, inputLen);
}
void SHA384_Begin ( SHA384Context *  cx)

Definition at line 1228 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA384_Begin)(cx);
}
void SHA384_Clone ( SHA384Context *  dest,
SHA384Context *  src 
)

Definition at line 1539 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_SHA384_Clone)(dest, src);
}
void SHA384_DestroyContext ( SHA384Context *  cx,
PRBool  freeit 
)

Definition at line 1220 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA384_DestroyContext)(cx, freeit);
}
void SHA384_End ( SHA384Context *  cx,
unsigned char *  digest,
unsigned int digestLen,
unsigned int  maxDigestLen 
)

Definition at line 1245 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA384_End)(cx, digest, digestLen, maxDigestLen);
}
SECStatus SHA384_Flatten ( SHA384Context *  cx,
unsigned char *  space 
)

Definition at line 1270 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA384_Flatten)(cx, space);
}
unsigned int SHA384_FlattenSize ( SHA384Context *  cx)

Definition at line 1262 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return 0;
  return (vector->p_SHA384_FlattenSize)(cx);
}
SECStatus SHA384_Hash ( unsigned char *  dest,
const char *  src 
)

Definition at line 1196 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA384_Hash)(dest, src);
}
SECStatus SHA384_HashBuf ( unsigned char *  dest,
const unsigned char *  src,
uint32  src_length 
)

Definition at line 1204 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA384_HashBuf)(dest, src, src_length);
}
SHA384Context* SHA384_NewContext ( void  )

Definition at line 1212 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_SHA384_NewContext)();
}
SHA384Context* SHA384_Resurrect ( unsigned char *  space,
void arg 
)

Definition at line 1278 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_SHA384_Resurrect)(space, arg);
}
void SHA384_TraceState ( SHA384Context *  cx)

Definition at line 1254 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA384_TraceState)(cx);
}
void SHA384_Update ( SHA384Context *  cx,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 1236 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA384_Update)(cx, input, inputLen);
}
void SHA512_Begin ( SHA512Context *  cx)

Definition at line 1137 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA512_Begin)(cx);
}
void SHA512_Clone ( SHA512Context *  dest,
SHA512Context *  src 
)

Definition at line 1547 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return;
  (vector->p_SHA512_Clone)(dest, src);
}
void SHA512_DestroyContext ( SHA512Context *  cx,
PRBool  freeit 
)

Definition at line 1129 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA512_DestroyContext)(cx, freeit);
}
void SHA512_End ( SHA512Context *  cx,
unsigned char *  digest,
unsigned int digestLen,
unsigned int  maxDigestLen 
)

Definition at line 1154 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA512_End)(cx, digest, digestLen, maxDigestLen);
}
SECStatus SHA512_Flatten ( SHA512Context *  cx,
unsigned char *  space 
)

Definition at line 1179 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA512_Flatten)(cx, space);
}
unsigned int SHA512_FlattenSize ( SHA512Context *  cx)

Definition at line 1171 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return 0;
  return (vector->p_SHA512_FlattenSize)(cx);
}
SECStatus SHA512_Hash ( unsigned char *  dest,
const char *  src 
)

Definition at line 1105 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA512_Hash)(dest, src);
}
SECStatus SHA512_HashBuf ( unsigned char *  dest,
const unsigned char *  src,
uint32  src_length 
)

Definition at line 1113 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_SHA512_HashBuf)(dest, src, src_length);
}
SHA512Context* SHA512_NewContext ( void  )

Definition at line 1121 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_SHA512_NewContext)();
}
SHA512Context* SHA512_Resurrect ( unsigned char *  space,
void arg 
)

Definition at line 1187 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return NULL;
  return (vector->p_SHA512_Resurrect)(space, arg);
}
void SHA512_TraceState ( SHA512Context *  cx)

Definition at line 1163 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA512_TraceState)(cx);
}
void SHA512_Update ( SHA512Context *  cx,
const unsigned char *  input,
unsigned int  inputLen 
)

Definition at line 1145 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return ;
  (vector->p_SHA512_Update)(cx, input, inputLen);
}
SECStatus TLS_PRF ( const SECItem *  secret,
const char *  label,
SECItem *  seed,
SECItem *  result,
PRBool  isFIPS 
)

Definition at line 1555 of file loader.c.

{
  if (!vector && PR_SUCCESS != freebl_RunLoaderOnce())
      return SECFailure;
  return (vector->p_TLS_PRF)(secret, label, seed, result, isFIPS);
}

Variable Documentation

PRLibrary* blLib [static]

Definition at line 196 of file loader.c.

const char* default_name = "."SHLIB_SUFFIX [static]

Definition at line 48 of file loader.c.

const char* libraryName = NULL [static]

Definition at line 287 of file loader.c.

Definition at line 329 of file loader.c.

Definition at line 328 of file loader.c.

const char* softoken = "."SHLIB_SUFFIX

Definition at line 194 of file loader.c.

const FREEBLVector* vector [static]

Definition at line 286 of file loader.c.