Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsNSSCertificateDB.cpp File Reference
#include "nsNSSComponent.h"
#include "nsNSSCertificateDB.h"
#include "nsCOMPtr.h"
#include "nsNSSCertificate.h"
#include "nsNSSHelper.h"
#include "nsNSSCertHelper.h"
#include "nsNSSCertCache.h"
#include "nsCRT.h"
#include "nsICertificateDialogs.h"
#include "nsNSSCertTrust.h"
#include "nsILocalFile.h"
#include "nsPKCS12Blob.h"
#include "nsPK11TokenDB.h"
#include "nsOCSPResponder.h"
#include "nsReadableUtils.h"
#include "nsArray.h"
#include "nsNSSShutDown.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIPrompt.h"
#include "nsIProxyObjectManager.h"
#include "nsProxiedService.h"
#include "nspr.h"
#include "pk11func.h"
#include "certdb.h"
#include "cert.h"
#include "secerr.h"
#include "nssb64.h"
#include "secasn1.h"
#include "secder.h"
#include "ssl.h"
#include "ocsp.h"
#include "plbase64.h"
#include "nsNSSCleaner.h"

Go to the source code of this file.

Defines

#define DELIM   '\001'

Functions

 NSSCleanupAutoPtrClass (CERTCertificate, CERT_DestroyCertificate) NSSCleanupAutoPtrClass(CERTCertList
CERT_DestroyCertList NSSCleanupAutoPtrClass (CERTCertificateList, CERT_DestroyCertificateList) static NS_DEFINE_CID(kNSSComponentCID
SECStatus PR_CALLBACK collect_certs (void *arg, SECItem **certs, int numcerts)
static SECStatus PR_CALLBACK GetOCSPResponders (CERTCertificate *aCert, SECItem *aDBKey, void *aArg)

Variables

CERT_DestroyCertList NS_NSSCOMPONENT_CID

Define Documentation

#define DELIM   '\001'

Definition at line 1288 of file nsNSSCertificateDB.cpp.


Function Documentation

SECStatus PR_CALLBACK collect_certs ( void arg,
SECItem **  certs,
int  numcerts 
)

Definition at line 224 of file nsNSSCertificateDB.cpp.

{
  CERTDERCerts *collectArgs;
  SECItem *cert;
  SECStatus rv;

  collectArgs = (CERTDERCerts *)arg;

  collectArgs->numcerts = numcerts;
  collectArgs->rawCerts = (SECItem *) PORT_ArenaZAlloc(collectArgs->arena,
                                           sizeof(SECItem) * numcerts);
  if ( collectArgs->rawCerts == NULL )
    return(SECFailure);

  cert = collectArgs->rawCerts;

  while ( numcerts-- ) {
    rv = SECITEM_CopyItem(collectArgs->arena, cert, *certs);
    if ( rv == SECFailure )
      return(SECFailure);
    cert++;
    certs++;
  }

  return (SECSuccess);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static SECStatus PR_CALLBACK GetOCSPResponders ( CERTCertificate *  aCert,
SECItem *  aDBKey,
void aArg 
) [static]

Definition at line 1206 of file nsNSSCertificateDB.cpp.

{
  nsIMutableArray *array = NS_STATIC_CAST(nsIMutableArray*, aArg);
  PRUnichar* nn = nsnull;
  PRUnichar* url = nsnull;
  char *serviceURL = nsnull;
  char *nickname = nsnull;
  PRUint32 i, count;
  nsresult rv;

  // Are we interested in this cert //
  if (!nsOCSPResponder::IncludeCert(aCert)) {
    return SECSuccess;
  }

  // Get the AIA and nickname //
  serviceURL = CERT_GetOCSPAuthorityInfoAccessLocation(aCert);
  if (serviceURL) {
    url = ToNewUnicode(NS_ConvertUTF8toUCS2(serviceURL));
    PORT_Free(serviceURL);
  }

  nickname = aCert->nickname;
  nn = ToNewUnicode(NS_ConvertUTF8toUCS2(nickname));

  nsCOMPtr<nsIOCSPResponder> new_entry = new nsOCSPResponder(nn, url);
  nsMemory::Free(nn);
  nsMemory::Free(url);

  // Sort the items according to nickname //
  rv = array->GetLength(&count);
  for (i=0; i < count; ++i) {
    nsCOMPtr<nsIOCSPResponder> entry = do_QueryElementAt(array, i);
    if (nsOCSPResponder::CompareEntries(new_entry, entry) < 0) {
      array->InsertElementAt(new_entry, i, PR_FALSE);
      break;
    }
  }
  if (i == count) {
    array->AppendElement(new_entry, PR_FALSE);
  }
  return SECSuccess;
}

Here is the call graph for this function:

NSSCleanupAutoPtrClass ( CERTCertificate  ,
CERT_DestroyCertificate   
)

Variable Documentation

Definition at line 85 of file nsNSSCertificateDB.cpp.