Back to index

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

Go to the source code of this file.

Functions

SECStatus jar_moz_encode (SEC_PKCS7ContentInfo *cinfo, SEC_PKCS7EncoderOutputCallback outputfn, void *outputarg, PK11SymKey *bulkkey, SECKEYGetPasswordKey pwfn, void *pwfnarg)
SECStatus jar_moz_verify (SEC_PKCS7ContentInfo *cinfo, SECCertUsage certusage, SECItem *detached_digest, HASH_HashType digest_type, PRBool keepcerts)
CERTCertificate * jar_moz_nickname (CERTCertDBHandle *certdb, char *nickname)
SECStatus jar_moz_perm (CERTCertificate *cert, char *nickname, CERTCertTrust *trust)
CERTCertificate * jar_moz_certkey (CERTCertDBHandle *certdb, CERTIssuerAndSN *seckey)
CERTCertificate * jar_moz_issuer (CERTCertificate *cert)
CERTCertificate * jar_moz_dup (CERTCertificate *cert)

Function Documentation

CERTCertificate* jar_moz_certkey ( CERTCertDBHandle *  certdb,
CERTIssuerAndSN *  seckey 
)

Definition at line 424 of file jarevil.c.

  {
  CERTCertificate *cert;
  ALLOC_OR_DEFINE(struct EVIL_certkey, certkey_data, NULL);

  certkey_data->error  = PORT_GetError();
  certkey_data->certdb = certdb;
  certkey_data->seckey = seckey;

  /* Synchronously invoke the callback function on the mozilla thread. */
#ifdef MOZILLA_CLIENT_OLD
  if (mozilla_event_queue)
    ET_moz_CallFunction (jar_moz_certkey_fn, certkey_data);
  else
    jar_moz_certkey_fn (certkey_data);
#else
  jar_moz_certkey_fn (certkey_data);
#endif

  PORT_SetError (certkey_data->error);
  cert = certkey_data->cert;

  /* Free the data passed to the callback function... */
  FREE_IF_ALLOC_IS_USED(certkey_data);
  return cert;
  }
CERTCertificate* jar_moz_dup ( CERTCertificate *  cert)

Definition at line 551 of file jarevil.c.

  {
  CERTCertificate *dup_cert;
  ALLOC_OR_DEFINE(struct EVIL_dup, dup_data, NULL);

  dup_data->error = PORT_GetError();
  dup_data->cert  = cert;

  /* Synchronously invoke the callback function on the mozilla thread. */
#ifdef MOZILLA_CLIENT_OLD
  if (mozilla_event_queue)
    ET_moz_CallFunction (jar_moz_dup_fn, dup_data);
  else
    jar_moz_dup_fn (dup_data);
#else
  jar_moz_dup_fn (dup_data);
#endif

  PORT_SetError (dup_data->error);
  dup_cert = dup_data->return_cert;

  /* Free the data passed to the callback function... */
  FREE_IF_ALLOC_IS_USED(dup_data);
  return dup_cert;
  }
SECStatus jar_moz_encode ( SEC_PKCS7ContentInfo *  cinfo,
SEC_PKCS7EncoderOutputCallback  outputfn,
void outputarg,
PK11SymKey *  bulkkey,
SECKEYGetPasswordKey  pwfn,
void pwfnarg 
)

Definition at line 139 of file jarevil.c.

  {
  SECStatus ret;
  ALLOC_OR_DEFINE(struct EVIL_encode, encode_data, SECFailure);

  encode_data->error     = PORT_GetError();
  encode_data->cinfo     = cinfo;
  encode_data->outputfn  = outputfn;
  encode_data->outputarg = outputarg;
  encode_data->bulkkey   = bulkkey;
  encode_data->pwfn      = pwfn;
  encode_data->pwfnarg   = pwfnarg;

  /* Synchronously invoke the callback function on the mozilla thread. */
#ifdef MOZILLA_CLIENT_OLD
  if (mozilla_event_queue)
    ET_moz_CallFunction (jar_moz_encode_fn, encode_data);
  else
    jar_moz_encode_fn (encode_data);
#else
  jar_moz_encode_fn (encode_data);
#endif

  PORT_SetError (encode_data->error);
  ret = encode_data->status;

  /* Free the data passed to the callback function... */
  FREE_IF_ALLOC_IS_USED(encode_data);
  return ret;
  }
CERTCertificate* jar_moz_issuer ( CERTCertificate *  cert)

Definition at line 489 of file jarevil.c.

  {
  CERTCertificate *issuer_cert;
  ALLOC_OR_DEFINE(struct EVIL_issuer, issuer_data, NULL);

  issuer_data->error = PORT_GetError();
  issuer_data->cert  = cert;

  /* Synchronously invoke the callback function on the mozilla thread. */
#ifdef MOZILLA_CLIENT_OLD
  if (mozilla_event_queue)
    ET_moz_CallFunction (jar_moz_issuer_fn, issuer_data);
  else
    jar_moz_issuer_fn (issuer_data);
#else
  jar_moz_issuer_fn (issuer_data);
#endif

  PORT_SetError (issuer_data->error);
  issuer_cert = issuer_data->issuer;

  /* Free the data passed to the callback function... */
  FREE_IF_ALLOC_IS_USED(issuer_data);
  return issuer_cert;
  }
CERTCertificate* jar_moz_nickname ( CERTCertDBHandle *  certdb,
char *  nickname 
)

Definition at line 293 of file jarevil.c.

  {
  CERTCertificate *cert;
  ALLOC_OR_DEFINE(struct EVIL_nickname, nickname_data, NULL );

  nickname_data->error    = PORT_GetError();
  nickname_data->certdb   = certdb;
  nickname_data->nickname = nickname;

  /* Synchronously invoke the callback function on the mozilla thread. */
#ifdef MOZILLA_CLIENT_OLD
  if (mozilla_event_queue)
    ET_moz_CallFunction (jar_moz_nickname_fn, nickname_data);
  else
    jar_moz_nickname_fn (nickname_data);
#else
  jar_moz_nickname_fn (nickname_data);
#endif

  PORT_SetError (nickname_data->error);
  cert = nickname_data->cert;

  /* Free the data passed to the callback function... */
  FREE_IF_ALLOC_IS_USED(nickname_data);
  return cert;
  }
SECStatus jar_moz_perm ( CERTCertificate *  cert,
char *  nickname,
CERTCertTrust *  trust 
)

Definition at line 359 of file jarevil.c.

  {
  SECStatus ret;
  ALLOC_OR_DEFINE(struct EVIL_perm, perm_data, SECFailure);

  perm_data->error    = PORT_GetError();
  perm_data->cert     = cert;
  perm_data->nickname = nickname;
  perm_data->trust    = trust;

  /* Synchronously invoke the callback function on the mozilla thread. */
#ifdef MOZILLA_CLIENT_OLD
  if (mozilla_event_queue)
    ET_moz_CallFunction (jar_moz_perm_fn, perm_data);
  else
    jar_moz_perm_fn (perm_data);
#else
  jar_moz_perm_fn (perm_data);
#endif

  PORT_SetError (perm_data->error);
  ret = perm_data->status;

  /* Free the data passed to the callback function... */
  FREE_IF_ALLOC_IS_USED(perm_data);
  return ret;
  }
SECStatus jar_moz_verify ( SEC_PKCS7ContentInfo *  cinfo,
SECCertUsage  certusage,
SECItem *  detached_digest,
HASH_HashType  digest_type,
PRBool  keepcerts 
)

Definition at line 220 of file jarevil.c.

  {
  SECStatus ret;
  ALLOC_OR_DEFINE(struct EVIL_verify, verify_data, SECFailure);

  verify_data->error           = PORT_GetError();
  verify_data->cinfo           = cinfo;
  verify_data->certusage       = certusage;
  verify_data->detached_digest = detached_digest;
  verify_data->digest_type     = digest_type;
  verify_data->keepcerts       = keepcerts;

  /* Synchronously invoke the callback function on the mozilla thread. */
#ifdef MOZILLA_CLIENT_OLD
  if (mozilla_event_queue)
    ET_moz_CallFunction (jar_moz_verify_fn, verify_data);
  else
    jar_moz_verify_fn (verify_data);
#else
  jar_moz_verify_fn (verify_data);
#endif

  PORT_SetError (verify_data->error);
  ret = verify_data->status;

  /* Free the data passed to the callback function... */
  FREE_IF_ALLOC_IS_USED(verify_data);
  return ret;
  }