Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
secoid.c File Reference
#include "secoid.h"
#include "pkcs11t.h"
#include "secmodt.h"
#include "secitem.h"
#include "secerr.h"
#include "plhash.h"
#include "nssrwlk.h"

Go to the source code of this file.

Defines

#define USGOV   0x60, 0x86, 0x48, 0x01, 0x65
#define MISSI   USGOV, 0x02, 0x01, 0x01
#define MISSI_OLD_KEA_DSS   MISSI, 0x0c
#define MISSI_OLD_DSS   MISSI, 0x02
#define MISSI_KEA_DSS   MISSI, 0x14
#define MISSI_DSS   MISSI, 0x13
#define MISSI_KEA   MISSI, 0x0a
#define MISSI_ALT_KEA   MISSI, 0x16
#define NISTALGS   USGOV, 3, 4
#define AES   NISTALGS, 1
#define SHAXXX   NISTALGS, 2
#define NETSCAPE_OID   0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42
 The Netscape OID space is allocated by Terry Hayes.
#define NETSCAPE_CERT_EXT   NETSCAPE_OID, 0x01
#define NETSCAPE_DATA_TYPE   NETSCAPE_OID, 0x02
#define NETSCAPE_DIRECTORY   NETSCAPE_OID, 0x03
#define NETSCAPE_POLICY   NETSCAPE_OID, 0x04
#define NETSCAPE_CERT_SERVER   NETSCAPE_OID, 0x05
#define NETSCAPE_ALGS   NETSCAPE_OID, 0x06 /* algorithm OIDs */
#define NETSCAPE_NAME_COMPONENTS   NETSCAPE_OID, 0x07
#define NETSCAPE_CERT_EXT_AIA   NETSCAPE_CERT_EXT, 0x10
#define NETSCAPE_CERT_SERVER_CRMF   NETSCAPE_CERT_SERVER, 0x01
#define OLD_NETSCAPE   0x60, 0x86, 0x48, 0xd8, 0x6a
#define NS_CERT_EXT   OLD_NETSCAPE, 0x01
#define NS_FILE_TYPE   OLD_NETSCAPE, 0x02
#define NS_IMAGE_TYPE   OLD_NETSCAPE, 0x03
#define RSADSI   0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d
#define PKCS   RSADSI, 0x01
#define DIGEST   RSADSI, 0x02
#define CIPHER   RSADSI, 0x03
#define PKCS1   PKCS, 0x01
#define PKCS5   PKCS, 0x05
#define PKCS7   PKCS, 0x07
#define PKCS9   PKCS, 0x09
#define PKCS12   PKCS, 0x0c
#define FORTEZZA_ALG   0x60, 0x86, 0x48, 0x01, 0x65, 0x02, 0x01, 0x01
#define ALGORITHM   0x2b, 0x0e, 0x03, 0x02
#define X500   0x55
#define X520_ATTRIBUTE_TYPE   X500, 0x04
#define X500_ALG   X500, 0x08
#define X500_ALG_ENCRYPTION   X500_ALG, 0x01
#define ID_CE_OID   X500, 0x1d
 X.509 v3 Extension OID {joint-iso-ccitt (2) ds(5) 29}.
#define RFC1274_ATTR_TYPE   0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x1
#define PKCS12_MODE_IDS   PKCS12, 0x01
#define PKCS12_ESPVK_IDS   PKCS12, 0x02
#define PKCS12_BAG_IDS   PKCS12, 0x03
#define PKCS12_CERT_BAG_IDS   PKCS12, 0x04
#define PKCS12_OIDS   PKCS12, 0x05
#define PKCS12_PBE_IDS   PKCS12_OIDS, 0x01
#define PKCS12_ENVELOPING_IDS   PKCS12_OIDS, 0x02
#define PKCS12_SIGNATURE_IDS   PKCS12_OIDS, 0x03
#define PKCS12_V2_PBE_IDS   PKCS12, 0x01
#define PKCS9_CERT_TYPES   PKCS9, 0x16
#define PKCS9_CRL_TYPES   PKCS9, 0x17
#define PKCS9_SMIME_IDS   PKCS9, 0x10
#define PKCS9_SMIME_ATTRS   PKCS9_SMIME_IDS, 2
#define PKCS9_SMIME_ALGS   PKCS9_SMIME_IDS, 3
#define PKCS12_VERSION1   PKCS12, 0x0a
#define PKCS12_V1_BAG_IDS   PKCS12_VERSION1, 1
#define ANSI_X9_ALGORITHM   0x2a, 0x86, 0x48, 0xce, 0x38, 0x4
#define ANSI_X942_ALGORITHM   0x2a, 0x86, 0x48, 0xce, 0x3e, 0x2
#define VERISIGN   0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x45
#define PKIX   0x2b, 0x06, 0x01, 0x05, 0x05, 0x07
#define PKIX_CERT_EXTENSIONS   PKIX, 1
#define PKIX_POLICY_QUALIFIERS   PKIX, 2
#define PKIX_KEY_USAGE   PKIX, 3
#define PKIX_ACCESS_DESCRIPTION   PKIX, 0x30
#define PKIX_OCSP   PKIX_ACCESS_DESCRIPTION, 1
#define PKIX_CA_ISSUERS   PKIX_ACCESS_DESCRIPTION, 2
#define PKIX_ID_PKIP   PKIX, 5
#define PKIX_ID_REGCTRL   PKIX_ID_PKIP, 1
#define PKIX_ID_REGINFO   PKIX_ID_PKIP, 2
#define MICROSOFT_OID   0x2b, 0x6, 0x1, 0x4, 0x1, 0x82, 0x37
#define CERTICOM_OID   0x2b, 0x81, 0x04
#define SECG_OID   CERTICOM_OID, 0x00
#define ANSI_X962_OID   0x2a, 0x86, 0x48, 0xce, 0x3d
#define ANSI_X962_CURVE_OID   ANSI_X962_OID, 0x03
#define ANSI_X962_GF2m_OID   ANSI_X962_CURVE_OID, 0x00
#define ANSI_X962_GFp_OID   ANSI_X962_CURVE_OID, 0x01
#define ANSI_X962_SIGNATURE_OID   ANSI_X962_OID, 0x04
#define ANSI_X962_SPECIFY_OID   ANSI_X962_SIGNATURE_OID, 0x03
#define CONST_OID   static const unsigned char
#define OI(x)   { siDEROID, (unsigned char *)x, sizeof x }
#define OD(oid, tag, desc, mech, ext)   { OI(oid), tag, desc, mech, ext }
#define FAKE_SUPPORTED_CERT_EXTENSION   UNSUPPORTED_CERT_EXTENSION

Functions

static SECStatus secoid_InitDynOidData (void)
static SECStatus secoid_HashDynamicOiddata (const SECOidData *oid)
static SECOidData * secoid_FindDynamic (const SECItem *key)
static SECOidData * secoid_FindDynamicByTag (SECOidTag tagnum)
SECOidTag SECOID_AddEntry (const SECOidData *src)
static PLHashNumber secoid_HashNumber (const void *key)
SECStatus secoid_Init (void)
SECOidData * SECOID_FindOIDByMechanism (unsigned long mechanism)
SECOidData * SECOID_FindOID (const SECItem *oid)
SECOidTag SECOID_FindOIDTag (const SECItem *oid)
SECOidData * SECOID_FindOIDByTag (SECOidTag tagnum)
PRBool SECOID_KnownCertExtenOID (SECItem *extenOid)
const char * SECOID_FindOIDTagDescription (SECOidTag tagnum)
SECStatus SECOID_Shutdown (void)

Variables

CONST_OID md2 [] = { DIGEST, 0x02 }
CONST_OID md4 [] = { DIGEST, 0x04 }
CONST_OID md5 [] = { DIGEST, 0x05 }
CONST_OID rc2cbc [] = { CIPHER, 0x02 }
CONST_OID rc4 [] = { CIPHER, 0x04 }
CONST_OID desede3cbc [] = { CIPHER, 0x07 }
CONST_OID rc5cbcpad [] = { CIPHER, 0x09 }
CONST_OID desecb [] = { ALGORITHM, 0x06 }
CONST_OID descbc [] = { ALGORITHM, 0x07 }
CONST_OID desofb [] = { ALGORITHM, 0x08 }
CONST_OID descfb [] = { ALGORITHM, 0x09 }
CONST_OID desmac [] = { ALGORITHM, 0x0a }
CONST_OID sdn702DSASignature [] = { ALGORITHM, 0x0c }
CONST_OID isoSHAWithRSASignature [] = { ALGORITHM, 0x0f }
CONST_OID desede [] = { ALGORITHM, 0x11 }
CONST_OID sha1 [] = { ALGORITHM, 0x1a }
CONST_OID bogusDSASignaturewithSHA1Digest [] = { ALGORITHM, 0x1b }
CONST_OID pkcs1RSAEncryption [] = { PKCS1, 0x01 }
CONST_OID pkcs1MD2WithRSAEncryption [] = { PKCS1, 0x02 }
CONST_OID pkcs1MD4WithRSAEncryption [] = { PKCS1, 0x03 }
CONST_OID pkcs1MD5WithRSAEncryption [] = { PKCS1, 0x04 }
CONST_OID pkcs1SHA1WithRSAEncryption [] = { PKCS1, 0x05 }
CONST_OID pkcs1SHA256WithRSAEncryption [] = { PKCS1, 11 }
CONST_OID pkcs1SHA384WithRSAEncryption [] = { PKCS1, 12 }
CONST_OID pkcs1SHA512WithRSAEncryption [] = { PKCS1, 13 }
CONST_OID pkcs5PbeWithMD2AndDEScbc [] = { PKCS5, 0x01 }
CONST_OID pkcs5PbeWithMD5AndDEScbc [] = { PKCS5, 0x03 }
CONST_OID pkcs5PbeWithSha1AndDEScbc [] = { PKCS5, 0x0a }
CONST_OID pkcs7 [] = { PKCS7 }
CONST_OID pkcs7Data [] = { PKCS7, 0x01 }
CONST_OID pkcs7SignedData [] = { PKCS7, 0x02 }
CONST_OID pkcs7EnvelopedData [] = { PKCS7, 0x03 }
CONST_OID pkcs7SignedEnvelopedData [] = { PKCS7, 0x04 }
CONST_OID pkcs7DigestedData [] = { PKCS7, 0x05 }
CONST_OID pkcs7EncryptedData [] = { PKCS7, 0x06 }
CONST_OID pkcs9EmailAddress [] = { PKCS9, 0x01 }
CONST_OID pkcs9UnstructuredName [] = { PKCS9, 0x02 }
CONST_OID pkcs9ContentType [] = { PKCS9, 0x03 }
CONST_OID pkcs9MessageDigest [] = { PKCS9, 0x04 }
CONST_OID pkcs9SigningTime [] = { PKCS9, 0x05 }
CONST_OID pkcs9CounterSignature [] = { PKCS9, 0x06 }
CONST_OID pkcs9ChallengePassword [] = { PKCS9, 0x07 }
CONST_OID pkcs9UnstructuredAddress [] = { PKCS9, 0x08 }
CONST_OID pkcs9ExtendedCertificateAttributes [] = { PKCS9, 0x09 }
CONST_OID pkcs9ExtensionRequest [] = { PKCS9, 14 }
CONST_OID pkcs9SMIMECapabilities [] = { PKCS9, 15 }
CONST_OID pkcs9FriendlyName [] = { PKCS9, 20 }
CONST_OID pkcs9LocalKeyID [] = { PKCS9, 21 }
CONST_OID pkcs9X509Certificate [] = { PKCS9_CERT_TYPES, 1 }
CONST_OID pkcs9SDSICertificate [] = { PKCS9_CERT_TYPES, 2 }
CONST_OID pkcs9X509CRL [] = { PKCS9_CRL_TYPES, 1 }
CONST_OID cmsESDH [] = { PKCS9_SMIME_ALGS, 5 }
CONST_OID cms3DESwrap [] = { PKCS9_SMIME_ALGS, 6 }
CONST_OID cmsRC2wrap [] = { PKCS9_SMIME_ALGS, 7 }
CONST_OID smimeEncryptionKeyPreference [] = { PKCS9_SMIME_ATTRS, 11 }
CONST_OID ms_smimeEncryptionKeyPreference [] = { MICROSOFT_OID, 0x10, 0x4 }
CONST_OID x520CommonName [] = { X520_ATTRIBUTE_TYPE, 3 }
CONST_OID x520SurName [] = { X520_ATTRIBUTE_TYPE, 4 }
CONST_OID x520SerialNumber [] = { X520_ATTRIBUTE_TYPE, 5 }
CONST_OID x520CountryName [] = { X520_ATTRIBUTE_TYPE, 6 }
CONST_OID x520LocalityName [] = { X520_ATTRIBUTE_TYPE, 7 }
CONST_OID x520StateOrProvinceName [] = { X520_ATTRIBUTE_TYPE, 8 }
CONST_OID x520StreetAddress [] = { X520_ATTRIBUTE_TYPE, 9 }
CONST_OID x520OrgName [] = { X520_ATTRIBUTE_TYPE, 10 }
CONST_OID x520OrgUnitName [] = { X520_ATTRIBUTE_TYPE, 11 }
CONST_OID x520Title [] = { X520_ATTRIBUTE_TYPE, 12 }
CONST_OID x520PostalAddress [] = { X520_ATTRIBUTE_TYPE, 16 }
CONST_OID x520PostalCode [] = { X520_ATTRIBUTE_TYPE, 17 }
CONST_OID x520PostOfficeBox [] = { X520_ATTRIBUTE_TYPE, 18 }
CONST_OID x520GivenName [] = { X520_ATTRIBUTE_TYPE, 42 }
CONST_OID x520Initials [] = { X520_ATTRIBUTE_TYPE, 43 }
CONST_OID x520GenerationQualifier [] = { X520_ATTRIBUTE_TYPE, 44 }
CONST_OID x520DnQualifier [] = { X520_ATTRIBUTE_TYPE, 46 }
CONST_OID x520HouseIdentifier [] = { X520_ATTRIBUTE_TYPE, 51 }
CONST_OID x520Pseudonym [] = { X520_ATTRIBUTE_TYPE, 65 }
CONST_OID nsTypeGIF [] = { NETSCAPE_DATA_TYPE, 0x01 }
CONST_OID nsTypeJPEG [] = { NETSCAPE_DATA_TYPE, 0x02 }
CONST_OID nsTypeURL [] = { NETSCAPE_DATA_TYPE, 0x03 }
CONST_OID nsTypeHTML [] = { NETSCAPE_DATA_TYPE, 0x04 }
CONST_OID nsTypeCertSeq [] = { NETSCAPE_DATA_TYPE, 0x05 }
CONST_OID missiCertKEADSSOld [] = { MISSI_OLD_KEA_DSS }
CONST_OID missiCertDSSOld [] = { MISSI_OLD_DSS }
CONST_OID missiCertKEADSS [] = { MISSI_KEA_DSS }
CONST_OID missiCertDSS [] = { MISSI_DSS }
CONST_OID missiCertKEA [] = { MISSI_KEA }
CONST_OID missiCertAltKEA [] = { MISSI_ALT_KEA }
CONST_OID x500RSAEncryption [] = { X500_ALG_ENCRYPTION, 0x01 }
CONST_OID rfc1274Uid [] = { RFC1274_ATTR_TYPE, 1 }
CONST_OID rfc1274Mail [] = { RFC1274_ATTR_TYPE, 3 }
CONST_OID rfc2247DomainComponent [] = { RFC1274_ATTR_TYPE, 25 }
CONST_OID nsCertExtNetscapeOK [] = { NS_CERT_EXT, 1 }
CONST_OID nsCertExtIssuerLogo [] = { NS_CERT_EXT, 2 }
CONST_OID nsCertExtSubjectLogo [] = { NS_CERT_EXT, 3 }
CONST_OID nsExtCertType [] = { NETSCAPE_CERT_EXT, 0x01 }
CONST_OID nsExtBaseURL [] = { NETSCAPE_CERT_EXT, 0x02 }
CONST_OID nsExtRevocationURL [] = { NETSCAPE_CERT_EXT, 0x03 }
CONST_OID nsExtCARevocationURL [] = { NETSCAPE_CERT_EXT, 0x04 }
CONST_OID nsExtCACRLURL [] = { NETSCAPE_CERT_EXT, 0x05 }
CONST_OID nsExtCACertURL [] = { NETSCAPE_CERT_EXT, 0x06 }
CONST_OID nsExtCertRenewalURL [] = { NETSCAPE_CERT_EXT, 0x07 }
CONST_OID nsExtCAPolicyURL [] = { NETSCAPE_CERT_EXT, 0x08 }
CONST_OID nsExtHomepageURL [] = { NETSCAPE_CERT_EXT, 0x09 }
CONST_OID nsExtEntityLogo [] = { NETSCAPE_CERT_EXT, 0x0a }
CONST_OID nsExtUserPicture [] = { NETSCAPE_CERT_EXT, 0x0b }
CONST_OID nsExtSSLServerName [] = { NETSCAPE_CERT_EXT, 0x0c }
CONST_OID nsExtComment [] = { NETSCAPE_CERT_EXT, 0x0d }
CONST_OID nsExtLostPasswordURL [] = { NETSCAPE_CERT_EXT, 0x0e }
CONST_OID nsExtCertRenewalTime [] = { NETSCAPE_CERT_EXT, 0x0f }
CONST_OID nsExtAIACertRenewal [] = { NETSCAPE_CERT_EXT_AIA, 0x01 }
CONST_OID nsExtCertScopeOfUse [] = { NETSCAPE_CERT_EXT, 0x11 }
CONST_OID nsKeyUsageGovtApproved [] = { NETSCAPE_POLICY, 0x01 }
CONST_OID netscapeNickname [] = { NETSCAPE_NAME_COMPONENTS, 0x01 }
CONST_OID netscapeAOLScreenname [] = { NETSCAPE_NAME_COMPONENTS, 0x02 }
CONST_OID netscapeRecoveryRequest [] = { NETSCAPE_CERT_SERVER_CRMF, 0x01 }
CONST_OID x509SubjectDirectoryAttr [] = { ID_CE_OID, 9 }
CONST_OID x509SubjectKeyID [] = { ID_CE_OID, 14 }
CONST_OID x509KeyUsage [] = { ID_CE_OID, 15 }
CONST_OID x509PrivateKeyUsagePeriod [] = { ID_CE_OID, 16 }
CONST_OID x509SubjectAltName [] = { ID_CE_OID, 17 }
CONST_OID x509IssuerAltName [] = { ID_CE_OID, 18 }
CONST_OID x509BasicConstraints [] = { ID_CE_OID, 19 }
CONST_OID x509CRLNumber [] = { ID_CE_OID, 20 }
CONST_OID x509ReasonCode [] = { ID_CE_OID, 21 }
CONST_OID x509HoldInstructionCode [] = { ID_CE_OID, 23 }
CONST_OID x509InvalidDate [] = { ID_CE_OID, 24 }
CONST_OID x509DeltaCRLIndicator [] = { ID_CE_OID, 27 }
CONST_OID x509IssuingDistributionPoint [] = { ID_CE_OID, 28 }
CONST_OID x509CertIssuer [] = { ID_CE_OID, 29 }
CONST_OID x509NameConstraints [] = { ID_CE_OID, 30 }
CONST_OID x509CRLDistPoints [] = { ID_CE_OID, 31 }
CONST_OID x509CertificatePolicies [] = { ID_CE_OID, 32 }
CONST_OID x509PolicyMappings [] = { ID_CE_OID, 33 }
CONST_OID x509AuthKeyID [] = { ID_CE_OID, 35 }
CONST_OID x509PolicyConstraints [] = { ID_CE_OID, 36 }
CONST_OID x509ExtKeyUsage [] = { ID_CE_OID, 37 }
CONST_OID x509FreshestCRL [] = { ID_CE_OID, 46 }
CONST_OID x509InhibitAnyPolicy [] = { ID_CE_OID, 54 }
CONST_OID x509AuthInfoAccess [] = { PKIX_CERT_EXTENSIONS, 1 }
CONST_OID x509SubjectInfoAccess [] = { PKIX_CERT_EXTENSIONS, 11 }
CONST_OID pkcs12 [] = { PKCS12 }
CONST_OID pkcs12ModeIDs [] = { PKCS12_MODE_IDS }
CONST_OID pkcs12ESPVKIDs [] = { PKCS12_ESPVK_IDS }
CONST_OID pkcs12BagIDs [] = { PKCS12_BAG_IDS }
CONST_OID pkcs12CertBagIDs [] = { PKCS12_CERT_BAG_IDS }
CONST_OID pkcs12OIDs [] = { PKCS12_OIDS }
CONST_OID pkcs12PBEIDs [] = { PKCS12_PBE_IDS }
CONST_OID pkcs12EnvelopingIDs [] = { PKCS12_ENVELOPING_IDS }
CONST_OID pkcs12SignatureIDs [] = { PKCS12_SIGNATURE_IDS }
CONST_OID pkcs12PKCS8KeyShrouding [] = { PKCS12_ESPVK_IDS, 0x01 }
CONST_OID pkcs12KeyBagID [] = { PKCS12_BAG_IDS, 0x01 }
CONST_OID pkcs12CertAndCRLBagID [] = { PKCS12_BAG_IDS, 0x02 }
CONST_OID pkcs12SecretBagID [] = { PKCS12_BAG_IDS, 0x03 }
CONST_OID pkcs12X509CertCRLBag [] = { PKCS12_CERT_BAG_IDS, 0x01 }
CONST_OID pkcs12SDSICertBag [] = { PKCS12_CERT_BAG_IDS, 0x02 }
CONST_OID pkcs12PBEWithSha1And128BitRC4 [] = { PKCS12_PBE_IDS, 0x01 }
CONST_OID pkcs12PBEWithSha1And40BitRC4 [] = { PKCS12_PBE_IDS, 0x02 }
CONST_OID pkcs12PBEWithSha1AndTripleDESCBC [] = { PKCS12_PBE_IDS, 0x03 }
CONST_OID pkcs12PBEWithSha1And128BitRC2CBC [] = { PKCS12_PBE_IDS, 0x04 }
CONST_OID pkcs12PBEWithSha1And40BitRC2CBC [] = { PKCS12_PBE_IDS, 0x05 }
CONST_OID pkcs12RSAEncryptionWith128BitRC4 [] = { PKCS12_ENVELOPING_IDS, 0x01 }
CONST_OID pkcs12RSAEncryptionWith40BitRC4 [] = { PKCS12_ENVELOPING_IDS, 0x02 }
CONST_OID pkcs12RSAEncryptionWithTripleDES [] = { PKCS12_ENVELOPING_IDS, 0x03 }
CONST_OID pkcs12RSASignatureWithSHA1Digest [] = { PKCS12_SIGNATURE_IDS, 0x01 }
CONST_OID pkcs12V2PBEWithSha1And128BitRC4 [] = { PKCS12_V2_PBE_IDS, 0x01 }
CONST_OID pkcs12V2PBEWithSha1And40BitRC4 [] = { PKCS12_V2_PBE_IDS, 0x02 }
CONST_OID pkcs12V2PBEWithSha1And3KeyTripleDEScbc [] = { PKCS12_V2_PBE_IDS, 0x03 }
CONST_OID pkcs12V2PBEWithSha1And2KeyTripleDEScbc [] = { PKCS12_V2_PBE_IDS, 0x04 }
CONST_OID pkcs12V2PBEWithSha1And128BitRC2cbc [] = { PKCS12_V2_PBE_IDS, 0x05 }
CONST_OID pkcs12V2PBEWithSha1And40BitRC2cbc [] = { PKCS12_V2_PBE_IDS, 0x06 }
CONST_OID pkcs12SafeContentsID [] = { PKCS12_BAG_IDS, 0x04 }
CONST_OID pkcs12PKCS8ShroudedKeyBagID [] = { PKCS12_BAG_IDS, 0x05 }
CONST_OID pkcs12V1KeyBag [] = { PKCS12_V1_BAG_IDS, 0x01 }
CONST_OID pkcs12V1PKCS8ShroudedKeyBag [] = { PKCS12_V1_BAG_IDS, 0x02 }
CONST_OID pkcs12V1CertBag [] = { PKCS12_V1_BAG_IDS, 0x03 }
CONST_OID pkcs12V1CRLBag [] = { PKCS12_V1_BAG_IDS, 0x04 }
CONST_OID pkcs12V1SecretBag [] = { PKCS12_V1_BAG_IDS, 0x05 }
CONST_OID pkcs12V1SafeContentsBag [] = { PKCS12_V1_BAG_IDS, 0x06 }
CONST_OID pkcs12KeyUsageAttr [] = { 2, 5, 29, 15 }
CONST_OID ansix9DSASignature [] = { ANSI_X9_ALGORITHM, 0x01 }
CONST_OID ansix9DSASignaturewithSHA1Digest [] = { ANSI_X9_ALGORITHM, 0x03 }
CONST_OID verisignUserNotices [] = { VERISIGN, 1, 7, 1, 1 }
CONST_OID pkixCPSPointerQualifier [] = { PKIX_POLICY_QUALIFIERS, 1 }
CONST_OID pkixUserNoticeQualifier [] = { PKIX_POLICY_QUALIFIERS, 2 }
CONST_OID pkixOCSP [] = { PKIX_OCSP }
CONST_OID pkixOCSPBasicResponse [] = { PKIX_OCSP, 1 }
CONST_OID pkixOCSPNonce [] = { PKIX_OCSP, 2 }
CONST_OID pkixOCSPCRL [] = { PKIX_OCSP, 3 }
CONST_OID pkixOCSPResponse [] = { PKIX_OCSP, 4 }
CONST_OID pkixOCSPNoCheck [] = { PKIX_OCSP, 5 }
CONST_OID pkixOCSPArchiveCutoff [] = { PKIX_OCSP, 6 }
CONST_OID pkixOCSPServiceLocator [] = { PKIX_OCSP, 7 }
CONST_OID pkixCAIssuers [] = { PKIX_CA_ISSUERS }
CONST_OID pkixRegCtrlRegToken [] = { PKIX_ID_REGCTRL, 1}
CONST_OID pkixRegCtrlAuthenticator [] = { PKIX_ID_REGCTRL, 2}
CONST_OID pkixRegCtrlPKIPubInfo [] = { PKIX_ID_REGCTRL, 3}
CONST_OID pkixRegCtrlPKIArchOptions [] = { PKIX_ID_REGCTRL, 4}
CONST_OID pkixRegCtrlOldCertID [] = { PKIX_ID_REGCTRL, 5}
CONST_OID pkixRegCtrlProtEncKey [] = { PKIX_ID_REGCTRL, 6}
CONST_OID pkixRegInfoUTF8Pairs [] = { PKIX_ID_REGINFO, 1}
CONST_OID pkixRegInfoCertReq [] = { PKIX_ID_REGINFO, 2}
CONST_OID pkixExtendedKeyUsageServerAuth [] = { PKIX_KEY_USAGE, 1 }
CONST_OID pkixExtendedKeyUsageClientAuth [] = { PKIX_KEY_USAGE, 2 }
CONST_OID pkixExtendedKeyUsageCodeSign [] = { PKIX_KEY_USAGE, 3 }
CONST_OID pkixExtendedKeyUsageEMailProtect [] = { PKIX_KEY_USAGE, 4 }
CONST_OID pkixExtendedKeyUsageTimeStamp [] = { PKIX_KEY_USAGE, 8 }
CONST_OID pkixOCSPResponderExtendedKeyUsage [] = { PKIX_KEY_USAGE, 9 }
CONST_OID netscapeSMimeKEA [] = { NETSCAPE_ALGS, 0x01 }
CONST_OID skipjackCBC [] = { FORTEZZA_ALG, 0x04 }
CONST_OID dhPublicKey [] = { ANSI_X942_ALGORITHM, 0x1 }
CONST_OID aes128_ECB [] = { AES, 1 }
CONST_OID aes128_CBC [] = { AES, 2 }
CONST_OID aes128_KEY_WRAP [] = { AES, 5 }
CONST_OID aes192_ECB [] = { AES, 21 }
CONST_OID aes192_CBC [] = { AES, 22 }
CONST_OID aes192_KEY_WRAP [] = { AES, 25 }
CONST_OID aes256_ECB [] = { AES, 41 }
CONST_OID aes256_CBC [] = { AES, 42 }
CONST_OID aes256_KEY_WRAP [] = { AES, 45 }
CONST_OID sha256 [] = { SHAXXX, 1 }
CONST_OID sha384 [] = { SHAXXX, 2 }
CONST_OID sha512 [] = { SHAXXX, 3 }
CONST_OID ansix962ECPublicKey [] = { ANSI_X962_OID, 0x02, 0x01 }
CONST_OID ansix962SignaturewithSHA1Digest [] = { ANSI_X962_SIGNATURE_OID, 0x01 }
CONST_OID ansix962SignatureRecommended [] = { ANSI_X962_SIGNATURE_OID, 0x02 }
CONST_OID ansix962SignatureSpecified [] = { ANSI_X962_SPECIFY_OID }
CONST_OID ansix962SignaturewithSHA224Digest [] = { ANSI_X962_SPECIFY_OID, 0x01 }
CONST_OID ansix962SignaturewithSHA256Digest [] = { ANSI_X962_SPECIFY_OID, 0x02 }
CONST_OID ansix962SignaturewithSHA384Digest [] = { ANSI_X962_SPECIFY_OID, 0x03 }
CONST_OID ansix962SignaturewithSHA512Digest [] = { ANSI_X962_SPECIFY_OID, 0x04 }
CONST_OID ansiX962prime192v1 [] = { ANSI_X962_GFp_OID, 0x01 }
CONST_OID ansiX962prime192v2 [] = { ANSI_X962_GFp_OID, 0x02 }
CONST_OID ansiX962prime192v3 [] = { ANSI_X962_GFp_OID, 0x03 }
CONST_OID ansiX962prime239v1 [] = { ANSI_X962_GFp_OID, 0x04 }
CONST_OID ansiX962prime239v2 [] = { ANSI_X962_GFp_OID, 0x05 }
CONST_OID ansiX962prime239v3 [] = { ANSI_X962_GFp_OID, 0x06 }
CONST_OID ansiX962prime256v1 [] = { ANSI_X962_GFp_OID, 0x07 }
CONST_OID secgECsecp112r1 [] = { SECG_OID, 0x06 }
CONST_OID secgECsecp112r2 [] = { SECG_OID, 0x07 }
CONST_OID secgECsecp128r1 [] = { SECG_OID, 0x1c }
CONST_OID secgECsecp128r2 [] = { SECG_OID, 0x1d }
CONST_OID secgECsecp160k1 [] = { SECG_OID, 0x09 }
CONST_OID secgECsecp160r1 [] = { SECG_OID, 0x08 }
CONST_OID secgECsecp160r2 [] = { SECG_OID, 0x1e }
CONST_OID secgECsecp192k1 [] = { SECG_OID, 0x1f }
CONST_OID secgECsecp224k1 [] = { SECG_OID, 0x20 }
CONST_OID secgECsecp224r1 [] = { SECG_OID, 0x21 }
CONST_OID secgECsecp256k1 [] = { SECG_OID, 0x0a }
CONST_OID secgECsecp384r1 [] = { SECG_OID, 0x22 }
CONST_OID secgECsecp521r1 [] = { SECG_OID, 0x23 }
CONST_OID ansiX962c2pnb163v1 [] = { ANSI_X962_GF2m_OID, 0x01 }
CONST_OID ansiX962c2pnb163v2 [] = { ANSI_X962_GF2m_OID, 0x02 }
CONST_OID ansiX962c2pnb163v3 [] = { ANSI_X962_GF2m_OID, 0x03 }
CONST_OID ansiX962c2pnb176v1 [] = { ANSI_X962_GF2m_OID, 0x04 }
CONST_OID ansiX962c2tnb191v1 [] = { ANSI_X962_GF2m_OID, 0x05 }
CONST_OID ansiX962c2tnb191v2 [] = { ANSI_X962_GF2m_OID, 0x06 }
CONST_OID ansiX962c2tnb191v3 [] = { ANSI_X962_GF2m_OID, 0x07 }
CONST_OID ansiX962c2onb191v4 [] = { ANSI_X962_GF2m_OID, 0x08 }
CONST_OID ansiX962c2onb191v5 [] = { ANSI_X962_GF2m_OID, 0x09 }
CONST_OID ansiX962c2pnb208w1 [] = { ANSI_X962_GF2m_OID, 0x0a }
CONST_OID ansiX962c2tnb239v1 [] = { ANSI_X962_GF2m_OID, 0x0b }
CONST_OID ansiX962c2tnb239v2 [] = { ANSI_X962_GF2m_OID, 0x0c }
CONST_OID ansiX962c2tnb239v3 [] = { ANSI_X962_GF2m_OID, 0x0d }
CONST_OID ansiX962c2onb239v4 [] = { ANSI_X962_GF2m_OID, 0x0e }
CONST_OID ansiX962c2onb239v5 [] = { ANSI_X962_GF2m_OID, 0x0f }
CONST_OID ansiX962c2pnb272w1 [] = { ANSI_X962_GF2m_OID, 0x10 }
CONST_OID ansiX962c2pnb304w1 [] = { ANSI_X962_GF2m_OID, 0x11 }
CONST_OID ansiX962c2tnb359v1 [] = { ANSI_X962_GF2m_OID, 0x12 }
CONST_OID ansiX962c2pnb368w1 [] = { ANSI_X962_GF2m_OID, 0x13 }
CONST_OID ansiX962c2tnb431r1 [] = { ANSI_X962_GF2m_OID, 0x14 }
CONST_OID secgECsect113r1 [] = {SECG_OID, 0x04 }
CONST_OID secgECsect113r2 [] = {SECG_OID, 0x05 }
CONST_OID secgECsect131r1 [] = {SECG_OID, 0x16 }
CONST_OID secgECsect131r2 [] = {SECG_OID, 0x17 }
CONST_OID secgECsect163k1 [] = {SECG_OID, 0x01 }
CONST_OID secgECsect163r1 [] = {SECG_OID, 0x02 }
CONST_OID secgECsect163r2 [] = {SECG_OID, 0x0f }
CONST_OID secgECsect193r1 [] = {SECG_OID, 0x18 }
CONST_OID secgECsect193r2 [] = {SECG_OID, 0x19 }
CONST_OID secgECsect233k1 [] = {SECG_OID, 0x1a }
CONST_OID secgECsect233r1 [] = {SECG_OID, 0x1b }
CONST_OID secgECsect239k1 [] = {SECG_OID, 0x03 }
CONST_OID secgECsect283k1 [] = {SECG_OID, 0x10 }
CONST_OID secgECsect283r1 [] = {SECG_OID, 0x11 }
CONST_OID secgECsect409k1 [] = {SECG_OID, 0x24 }
CONST_OID secgECsect409r1 [] = {SECG_OID, 0x25 }
CONST_OID secgECsect571k1 [] = {SECG_OID, 0x26 }
CONST_OID secgECsect571r1 [] = {SECG_OID, 0x27 }
static const SECOidData oids []
static NSSRWLock * dynOidLock
static PLArenaPooldynOidPool
static PLHashTabledynOidHash
static SECOidData ** dynOidTable
static int dynOidEntriesAllocated
static int dynOidEntriesUsed
static PLHashTableoidhash = NULL
static PLHashTableoidmechhash = NULL

Define Documentation

#define AES   NISTALGS, 1

Definition at line 57 of file secoid.c.

#define ALGORITHM   0x2b, 0x0e, 0x03, 0x02

Definition at line 102 of file secoid.c.

#define ANSI_X942_ALGORITHM   0x2a, 0x86, 0x48, 0xce, 0x3e, 0x2

Definition at line 142 of file secoid.c.

Definition at line 166 of file secoid.c.

Definition at line 167 of file secoid.c.

Definition at line 168 of file secoid.c.

#define ANSI_X962_OID   0x2a, 0x86, 0x48, 0xce, 0x3d

Definition at line 165 of file secoid.c.

Definition at line 169 of file secoid.c.

Definition at line 170 of file secoid.c.

#define ANSI_X9_ALGORITHM   0x2a, 0x86, 0x48, 0xce, 0x38, 0x4

Definition at line 136 of file secoid.c.

#define CERTICOM_OID   0x2b, 0x81, 0x04

Definition at line 162 of file secoid.c.

#define CIPHER   RSADSI, 0x03

Definition at line 90 of file secoid.c.

#define CONST_OID   static const unsigned char

Definition at line 172 of file secoid.c.

#define DIGEST   RSADSI, 0x02

Definition at line 89 of file secoid.c.

Definition at line 555 of file secoid.c.

#define FORTEZZA_ALG   0x60, 0x86, 0x48, 0x01, 0x65, 0x02, 0x01, 0x01

Definition at line 99 of file secoid.c.

#define ID_CE_OID   X500, 0x1d

X.509 v3 Extension OID {joint-iso-ccitt (2) ds(5) 29}.

Definition at line 111 of file secoid.c.

#define MICROSOFT_OID   0x2b, 0x6, 0x1, 0x4, 0x1, 0x82, 0x37

Definition at line 160 of file secoid.c.

#define MISSI   USGOV, 0x02, 0x01, 0x01

Definition at line 48 of file secoid.c.

#define MISSI_ALT_KEA   MISSI, 0x16

Definition at line 54 of file secoid.c.

#define MISSI_DSS   MISSI, 0x13

Definition at line 52 of file secoid.c.

#define MISSI_KEA   MISSI, 0x0a

Definition at line 53 of file secoid.c.

#define MISSI_KEA_DSS   MISSI, 0x14

Definition at line 51 of file secoid.c.

#define MISSI_OLD_DSS   MISSI, 0x02

Definition at line 50 of file secoid.c.

Definition at line 49 of file secoid.c.

#define NETSCAPE_ALGS   NETSCAPE_OID, 0x06 /* algorithm OIDs */

Definition at line 74 of file secoid.c.

Definition at line 68 of file secoid.c.

Definition at line 77 of file secoid.c.

Definition at line 73 of file secoid.c.

Definition at line 78 of file secoid.c.

Definition at line 69 of file secoid.c.

Definition at line 71 of file secoid.c.

Definition at line 75 of file secoid.c.

#define NETSCAPE_OID   0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42

The Netscape OID space is allocated by Terry Hayes.

If you need a piece of the space, contact him at thaye.nosp@m.s@ne.nosp@m.tscap.nosp@m.e.co.nosp@m.m.

Definition at line 67 of file secoid.c.

Definition at line 72 of file secoid.c.

#define NISTALGS   USGOV, 3, 4

Definition at line 56 of file secoid.c.

Definition at line 82 of file secoid.c.

Definition at line 83 of file secoid.c.

Definition at line 84 of file secoid.c.

#define OD (   oid,
  tag,
  desc,
  mech,
  ext 
)    { OI(oid), tag, desc, mech, ext }

Definition at line 547 of file secoid.c.

#define OI (   x)    { siDEROID, (unsigned char *)x, sizeof x }

Definition at line 545 of file secoid.c.

#define OLD_NETSCAPE   0x60, 0x86, 0x48, 0xd8, 0x6a

Definition at line 81 of file secoid.c.

#define PKCS   RSADSI, 0x01

Definition at line 88 of file secoid.c.

#define PKCS1   PKCS, 0x01

Definition at line 91 of file secoid.c.

#define PKCS12   PKCS, 0x0c

Definition at line 95 of file secoid.c.

Definition at line 119 of file secoid.c.

Definition at line 120 of file secoid.c.

Definition at line 123 of file secoid.c.

Definition at line 118 of file secoid.c.

Definition at line 117 of file secoid.c.

#define PKCS12_OIDS   PKCS12, 0x05

Definition at line 121 of file secoid.c.

Definition at line 122 of file secoid.c.

Definition at line 124 of file secoid.c.

Definition at line 132 of file secoid.c.

Definition at line 125 of file secoid.c.

Definition at line 131 of file secoid.c.

#define PKCS5   PKCS, 0x05

Definition at line 92 of file secoid.c.

#define PKCS7   PKCS, 0x07

Definition at line 93 of file secoid.c.

#define PKCS9   PKCS, 0x09

Definition at line 94 of file secoid.c.

Definition at line 126 of file secoid.c.

Definition at line 127 of file secoid.c.

Definition at line 130 of file secoid.c.

Definition at line 129 of file secoid.c.

Definition at line 128 of file secoid.c.

#define PKIX   0x2b, 0x06, 0x01, 0x05, 0x05, 0x07

Definition at line 146 of file secoid.c.

Definition at line 150 of file secoid.c.

Definition at line 152 of file secoid.c.

Definition at line 147 of file secoid.c.

Definition at line 154 of file secoid.c.

Definition at line 155 of file secoid.c.

Definition at line 156 of file secoid.c.

Definition at line 149 of file secoid.c.

Definition at line 151 of file secoid.c.

Definition at line 148 of file secoid.c.

#define RFC1274_ATTR_TYPE   0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x1

Definition at line 113 of file secoid.c.

#define RSADSI   0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d

Definition at line 87 of file secoid.c.

Definition at line 163 of file secoid.c.

Definition at line 58 of file secoid.c.

#define USGOV   0x60, 0x86, 0x48, 0x01, 0x65

Definition at line 47 of file secoid.c.

#define VERISIGN   0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x45

Definition at line 144 of file secoid.c.

#define X500   0x55

Definition at line 103 of file secoid.c.

#define X500_ALG   X500, 0x08

Definition at line 105 of file secoid.c.

Definition at line 106 of file secoid.c.

Definition at line 104 of file secoid.c.


Function Documentation

SECOidTag SECOID_AddEntry ( const SECOidData *  src)

Definition at line 1635 of file secoid.c.

{
    SECOidData * dst;
    SECOidData **table;
    SECOidTag    ret         = SEC_OID_UNKNOWN;
    SECStatus    rv;
    int          tableEntries;
    int          used;

    if (!src || !src->oid.data || !src->oid.len || \
        !src->desc || !strlen(src->desc)) {
       PORT_SetError(SEC_ERROR_INVALID_ARGS);
       return ret;
    }
    if (src->supportedExtension != INVALID_CERT_EXTENSION     &&
       src->supportedExtension != UNSUPPORTED_CERT_EXTENSION &&
       src->supportedExtension != SUPPORTED_CERT_EXTENSION     ) {
       PORT_SetError(SEC_ERROR_INVALID_ARGS);
       return ret;
    }

    if (!dynOidPool && secoid_InitDynOidData() != SECSuccess) {
       /* Caller has set error code. */
       return ret;
    }

    NSSRWLock_LockWrite(dynOidLock);

    /* We've just acquired the write lock, and now we call FindOIDTag
    ** which will acquire and release the read lock.  NSSRWLock has been
    ** designed to allow this very case without deadlock.  This approach 
    ** makes the test for the presence of the OID, and the subsequent 
    ** addition of the OID to the table a single atomic write operation.
    */
    ret = SECOID_FindOIDTag(&src->oid);
    if (ret != SEC_OID_UNKNOWN) {
       /* we could return an error here, but I chose not to do that.
       ** This way, if we add an OID to the shared library's built in
       ** list of OIDs in some future release, and that OID is the same
       ** as some OID that a program has been adding, the program will
       ** not suddenly stop working.
       */
       goto done;
    }

    table        = dynOidTable;
    tableEntries = dynOidEntriesAllocated;
    used         = dynOidEntriesUsed;

    if (used + 1 > tableEntries) {
       SECOidData **newTable;
       int          newTableEntries = tableEntries + 16;

       newTable = (SECOidData **)PORT_Realloc(table, 
                                   newTableEntries * sizeof(SECOidData *));
       if (newTable == NULL) {
           goto done;
       }
       dynOidTable            = table        = newTable;
       dynOidEntriesAllocated = tableEntries = newTableEntries;
    }

    /* copy oid structure */
    dst = PORT_ArenaNew(dynOidPool, SECOidData);
    if (!dst) {
       goto done;
    }
    rv  = SECITEM_CopyItem(dynOidPool, &dst->oid, &src->oid);
    if (rv != SECSuccess) {
       goto done;
    }
    dst->desc = PORT_ArenaStrdup(dynOidPool, src->desc);
    if (!dst->desc) {
       goto done;
    }
    dst->offset             = (SECOidTag)(used + SEC_OID_TOTAL);
    dst->mechanism          = src->mechanism;
    dst->supportedExtension = src->supportedExtension;

    rv = secoid_HashDynamicOiddata(dst);
    if ( rv == SECSuccess ) {
       table[used++] = dst;
       dynOidEntriesUsed = used;
       ret = dst->offset;
    }
done:
    NSSRWLock_UnlockWrite(dynOidLock);
    return ret;
}

Here is the caller graph for this function:

static SECOidData* secoid_FindDynamic ( const SECItem *  key) [static]

Definition at line 1588 of file secoid.c.

{
    SECOidData *ret = NULL;

    if (dynOidHash) {
       NSSRWLock_LockRead(dynOidLock);
       if (dynOidHash) { /* must check it again with lock held. */
           ret = (SECOidData *)PL_HashTableLookup(dynOidHash, key);
       }
       NSSRWLock_UnlockRead(dynOidLock);
    }
    if (ret == NULL) {
       PORT_SetError(SEC_ERROR_UNRECOGNIZED_OID);
    }
    return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static SECOidData* secoid_FindDynamicByTag ( SECOidTag  tagnum) [static]

Definition at line 1606 of file secoid.c.

{
    SECOidData *data = NULL;
    int tagNumDiff;

    if (tagnum < SEC_OID_TOTAL) {
       PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
       return NULL;
    }
    tagNumDiff = tagnum - SEC_OID_TOTAL;

    if (dynOidTable) {
       NSSRWLock_LockRead(dynOidLock);
       if (dynOidTable != NULL && /* must check it again with lock held. */
           tagNumDiff < dynOidEntriesUsed) {
           data = dynOidTable[tagNumDiff];
       }
       NSSRWLock_UnlockRead(dynOidLock);
    }
    if (data == NULL) {
       PORT_SetError(SEC_ERROR_UNRECOGNIZED_OID);
    }
    return data;
}

Here is the call graph for this function:

Here is the caller graph for this function:

SECOidData* SECOID_FindOID ( const SECItem *  oid)

Definition at line 1807 of file secoid.c.

{
    SECOidData *ret;

    PR_ASSERT(oidhash != NULL);
    
    ret = PL_HashTableLookupConst ( oidhash, oid );
    if ( ret == NULL ) {
       ret  = secoid_FindDynamic(oid);
       if (ret == NULL) {
           PORT_SetError(SEC_ERROR_UNRECOGNIZED_OID);
       }
    }

    return(ret);
}

Here is the caller graph for this function:

SECOidData* SECOID_FindOIDByMechanism ( unsigned long  mechanism)

Definition at line 1792 of file secoid.c.

{
    SECOidData *ret;

    PR_ASSERT(oidhash != NULL);

    ret = PL_HashTableLookupConst ( oidmechhash, (void *)mechanism);
    if ( ret == NULL ) {
        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
    }

    return (ret);
}

Here is the caller graph for this function:

SECOidData* SECOID_FindOIDByTag ( SECOidTag  tagnum)

Definition at line 1838 of file secoid.c.

{

    if (tagnum >= SEC_OID_TOTAL) {
       return secoid_FindDynamicByTag(tagnum);
    }

    PORT_Assert((unsigned int)tagnum < (sizeof(oids) / sizeof(SECOidData)));
    return (SECOidData *)(&oids[tagnum]);
}

Here is the caller graph for this function:

SECOidTag SECOID_FindOIDTag ( const SECItem *  oid)

Definition at line 1825 of file secoid.c.

{
    SECOidData *oiddata;

    oiddata = SECOID_FindOID (oid);
    if (oiddata == NULL)
       return SEC_OID_UNKNOWN;

    return oiddata->offset;
}

Definition at line 1862 of file secoid.c.

{
  const SECOidData *oidData = SECOID_FindOIDByTag(tagnum);
  return oidData ? oidData->desc : 0;
}

Here is the caller graph for this function:

static SECStatus secoid_HashDynamicOiddata ( const SECOidData *  oid) [static]

Definition at line 1565 of file secoid.c.

{
    PLHashEntry *entry;

    if (!dynOidHash) {
        dynOidHash = PL_NewHashTable(0, SECITEM_Hash, SECITEM_HashCompare,
                     PL_CompareValues, NULL, NULL);
       if ( !dynOidHash ) {
           return SECFailure;
       }
    }

    entry = PL_HashTableAdd( dynOidHash, &oid->oid, (void *)oid );
    return entry ? SECSuccess : SECFailure;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PLHashNumber secoid_HashNumber ( const void key) [static]

Definition at line 1731 of file secoid.c.

{
    return (PLHashNumber) key;
}

Here is the caller graph for this function:

Definition at line 1738 of file secoid.c.

{
    PLHashEntry *entry;
    const SECOidData *oid;
    int i;

    if (!dynOidPool && secoid_InitDynOidData() != SECSuccess) {
       return SECFailure;
    }

    if (oidhash) {
       return SECSuccess;
    }
    
    oidhash = PL_NewHashTable(0, SECITEM_Hash, SECITEM_HashCompare,
                     PL_CompareValues, NULL, NULL);
    oidmechhash = PL_NewHashTable(0, secoid_HashNumber, PL_CompareValues,
                     PL_CompareValues, NULL, NULL);

    if ( !oidhash || !oidmechhash) {
       PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
       PORT_Assert(0); /*This function should never fail. */
       return(SECFailure);
    }

    for ( i = 0; i < ( sizeof(oids) / sizeof(SECOidData) ); i++ ) {
       oid = &oids[i];

       PORT_Assert ( oid->offset == i );

       entry = PL_HashTableAdd( oidhash, &oid->oid, (void *)oid );
       if ( entry == NULL ) {
           PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
            PORT_Assert(0); /*This function should never fail. */
           return(SECFailure);
       }

       if ( oid->mechanism != CKM_INVALID_MECHANISM ) {
           entry = PL_HashTableAdd( oidmechhash, 
                                   (void *)oid->mechanism, (void *)oid );
           if ( entry == NULL ) {
               PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
                PORT_Assert(0); /* This function should never fail. */
              return(SECFailure);
           }
       }
    }

    PORT_Assert (i == SEC_OID_TOTAL);

    return(SECSuccess);
}
static SECStatus secoid_InitDynOidData ( void  ) [static]

Definition at line 1538 of file secoid.c.

{
    SECStatus   rv = SECSuccess;
    NSSRWLock * lock;

    /* This function will create the lock if it doesn't exist,
    ** and will return the address of the lock, whether it was 
    ** previously created, or was created by the function.
    */
    lock = nssRWLock_AtomicCreate(&dynOidLock, 1, "dynamic OID data");
    if (!lock) {
       return SECFailure; /* Error code should already be set. */
    }
    PORT_Assert(lock == dynOidLock);
    NSSRWLock_LockWrite(lock);
    if (!dynOidPool) {
       dynOidPool = PORT_NewArena(2048);
       if (!dynOidPool) {
           rv = SECFailure /* Error code should already be set. */;
       }
    }
    NSSRWLock_UnlockWrite(lock);
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool SECOID_KnownCertExtenOID ( SECItem *  extenOid)

Definition at line 1849 of file secoid.c.

{
    SECOidData * oidData;

    oidData = SECOID_FindOID (extenOid);
    if (oidData == (SECOidData *)NULL)
       return (PR_FALSE);
    return ((oidData->supportedExtension == SUPPORTED_CERT_EXTENSION) ?
            PR_TRUE : PR_FALSE);
}

Here is the caller graph for this function:

Definition at line 1872 of file secoid.c.

{
    if (oidhash) {
       PL_HashTableDestroy(oidhash);
       oidhash = NULL;
    }
    if (oidmechhash) {
       PL_HashTableDestroy(oidmechhash);
       oidmechhash = NULL;
    }
    /* Have to handle the case where the lock was created, but
    ** the pool wasn't. 
    ** I'm not going to attempt to create the lock, just to protect
    ** the destruction of data that probably isn't initialized anyway.
    */
    if (dynOidLock) {
       NSSRWLock_LockWrite(dynOidLock);
       if (dynOidHash) {
           PL_HashTableDestroy(dynOidHash);
           dynOidHash = NULL;
       }
       if (dynOidPool) {
           PORT_FreeArena(dynOidPool, PR_FALSE);
           dynOidPool = NULL;
       }
       if (dynOidTable) {
           PORT_Free(dynOidTable);
           dynOidTable = NULL;
       }
       dynOidEntriesAllocated = 0;
       dynOidEntriesUsed = 0;

       NSSRWLock_UnlockWrite(dynOidLock);
       NSSRWLock_Destroy(dynOidLock);
       dynOidLock = NULL;
    } else {
       /* Since dynOidLock doesn't exist, then all the data it protects
       ** should be uninitialized.  We'll check that (in DEBUG builds),
       ** and then make sure it is so, in case NSS is reinitialized.
       */
       PORT_Assert(!dynOidHash && !dynOidPool && !dynOidTable && \
                   !dynOidEntriesAllocated && !dynOidEntriesUsed);
       dynOidHash = NULL;
       dynOidPool = NULL;
       dynOidTable = NULL;
       dynOidEntriesAllocated = 0;
       dynOidEntriesUsed = 0;
    }
    return SECSuccess;
}

Variable Documentation

CONST_OID aes128_CBC[] = { AES, 2 }

Definition at line 440 of file secoid.c.

CONST_OID aes128_ECB[] = { AES, 1 }

Definition at line 439 of file secoid.c.

Definition at line 445 of file secoid.c.

CONST_OID aes192_CBC[] = { AES, 22 }

Definition at line 448 of file secoid.c.

CONST_OID aes192_ECB[] = { AES, 21 }

Definition at line 447 of file secoid.c.

Definition at line 453 of file secoid.c.

CONST_OID aes256_CBC[] = { AES, 42 }

Definition at line 456 of file secoid.c.

CONST_OID aes256_ECB[] = { AES, 41 }

Definition at line 455 of file secoid.c.

Definition at line 461 of file secoid.c.

Definition at line 511 of file secoid.c.

Definition at line 512 of file secoid.c.

Definition at line 517 of file secoid.c.

Definition at line 518 of file secoid.c.

Definition at line 504 of file secoid.c.

Definition at line 505 of file secoid.c.

Definition at line 506 of file secoid.c.

Definition at line 507 of file secoid.c.

Definition at line 513 of file secoid.c.

Definition at line 519 of file secoid.c.

Definition at line 520 of file secoid.c.

Definition at line 522 of file secoid.c.

Definition at line 508 of file secoid.c.

Definition at line 509 of file secoid.c.

Definition at line 510 of file secoid.c.

Definition at line 514 of file secoid.c.

Definition at line 515 of file secoid.c.

Definition at line 516 of file secoid.c.

Definition at line 521 of file secoid.c.

Definition at line 523 of file secoid.c.

Definition at line 467 of file secoid.c.

Definition at line 480 of file secoid.c.

Definition at line 481 of file secoid.c.

Definition at line 482 of file secoid.c.

Definition at line 483 of file secoid.c.

Definition at line 484 of file secoid.c.

Definition at line 485 of file secoid.c.

Definition at line 486 of file secoid.c.

Definition at line 469 of file secoid.c.

Definition at line 470 of file secoid.c.

Definition at line 468 of file secoid.c.

Definition at line 471 of file secoid.c.

Definition at line 472 of file secoid.c.

Definition at line 473 of file secoid.c.

Definition at line 474 of file secoid.c.

Definition at line 395 of file secoid.c.

Definition at line 396 of file secoid.c.

Definition at line 192 of file secoid.c.

Definition at line 235 of file secoid.c.

Definition at line 234 of file secoid.c.

Definition at line 236 of file secoid.c.

CONST_OID descbc[] = { ALGORITHM, 0x07 }

Definition at line 184 of file secoid.c.

CONST_OID descfb[] = { ALGORITHM, 0x09 }

Definition at line 186 of file secoid.c.

CONST_OID desecb[] = { ALGORITHM, 0x06 }

Definition at line 183 of file secoid.c.

CONST_OID desede[] = { ALGORITHM, 0x11 }

Definition at line 190 of file secoid.c.

CONST_OID desede3cbc[] = { CIPHER, 0x07 }

Definition at line 180 of file secoid.c.

CONST_OID desmac[] = { ALGORITHM, 0x0a }

Definition at line 187 of file secoid.c.

CONST_OID desofb[] = { ALGORITHM, 0x08 }

Definition at line 185 of file secoid.c.

Definition at line 437 of file secoid.c.

Definition at line 1529 of file secoid.c.

Definition at line 1530 of file secoid.c.

Definition at line 1527 of file secoid.c.

NSSRWLock* dynOidLock [static]

Definition at line 1525 of file secoid.c.

Definition at line 1526 of file secoid.c.

SECOidData** dynOidTable [static]

Definition at line 1528 of file secoid.c.

Definition at line 189 of file secoid.c.

CONST_OID md2[] = { DIGEST, 0x02 }

Definition at line 174 of file secoid.c.

CONST_OID md4[] = { DIGEST, 0x04 }

Definition at line 175 of file secoid.c.

CONST_OID md5[] = { DIGEST, 0x05 }

Definition at line 176 of file secoid.c.

Definition at line 273 of file secoid.c.

Definition at line 271 of file secoid.c.

Definition at line 269 of file secoid.c.

Definition at line 272 of file secoid.c.

Definition at line 270 of file secoid.c.

Definition at line 268 of file secoid.c.

Definition at line 240 of file secoid.c.

Definition at line 312 of file secoid.c.

Definition at line 311 of file secoid.c.

Definition at line 315 of file secoid.c.

Definition at line 433 of file secoid.c.

Definition at line 283 of file secoid.c.

Definition at line 282 of file secoid.c.

Definition at line 284 of file secoid.c.

Definition at line 303 of file secoid.c.

Definition at line 286 of file secoid.c.

Definition at line 290 of file secoid.c.

Definition at line 289 of file secoid.c.

Definition at line 292 of file secoid.c.

Definition at line 288 of file secoid.c.

Definition at line 301 of file secoid.c.

Definition at line 291 of file secoid.c.

Definition at line 304 of file secoid.c.

Definition at line 285 of file secoid.c.

Definition at line 297 of file secoid.c.

Definition at line 294 of file secoid.c.

Definition at line 293 of file secoid.c.

Definition at line 300 of file secoid.c.

Definition at line 287 of file secoid.c.

Definition at line 296 of file secoid.c.

Definition at line 295 of file secoid.c.

Definition at line 308 of file secoid.c.

Definition at line 266 of file secoid.c.

Definition at line 262 of file secoid.c.

Definition at line 265 of file secoid.c.

Definition at line 263 of file secoid.c.

Definition at line 264 of file secoid.c.

PLHashTable* oidhash = NULL [static]

Definition at line 1727 of file secoid.c.

Definition at line 1728 of file secoid.c.

const SECOidData oids[] [static]

Definition at line 561 of file secoid.c.

Definition at line 347 of file secoid.c.

Definition at line 350 of file secoid.c.

Definition at line 358 of file secoid.c.

Definition at line 351 of file secoid.c.

Definition at line 354 of file secoid.c.

Definition at line 349 of file secoid.c.

Definition at line 357 of file secoid.c.

CONST_OID pkcs12KeyUsageAttr[] = { 2, 5, 29, 15 }

Definition at line 393 of file secoid.c.

Definition at line 348 of file secoid.c.

Definition at line 352 of file secoid.c.

Definition at line 353 of file secoid.c.

Definition at line 365 of file secoid.c.

Definition at line 362 of file secoid.c.

Definition at line 366 of file secoid.c.

Definition at line 363 of file secoid.c.

Definition at line 364 of file secoid.c.

Definition at line 356 of file secoid.c.

Definition at line 381 of file secoid.c.

Definition at line 367 of file secoid.c.

Definition at line 368 of file secoid.c.

Definition at line 369 of file secoid.c.

Definition at line 370 of file secoid.c.

Definition at line 380 of file secoid.c.

Definition at line 361 of file secoid.c.

Definition at line 359 of file secoid.c.

Definition at line 355 of file secoid.c.

Definition at line 385 of file secoid.c.

Definition at line 386 of file secoid.c.

Definition at line 383 of file secoid.c.

Definition at line 384 of file secoid.c.

Definition at line 388 of file secoid.c.

Definition at line 387 of file secoid.c.

Definition at line 377 of file secoid.c.

Definition at line 373 of file secoid.c.

Definition at line 376 of file secoid.c.

Definition at line 375 of file secoid.c.

Definition at line 378 of file secoid.c.

Definition at line 374 of file secoid.c.

Definition at line 360 of file secoid.c.

Definition at line 195 of file secoid.c.

Definition at line 196 of file secoid.c.

Definition at line 197 of file secoid.c.

Definition at line 194 of file secoid.c.

Definition at line 198 of file secoid.c.

Definition at line 199 of file secoid.c.

Definition at line 200 of file secoid.c.

Definition at line 201 of file secoid.c.

Definition at line 203 of file secoid.c.

Definition at line 204 of file secoid.c.

Definition at line 205 of file secoid.c.

Definition at line 207 of file secoid.c.

CONST_OID pkcs7Data[] = { PKCS7, 0x01 }

Definition at line 208 of file secoid.c.

Definition at line 212 of file secoid.c.

Definition at line 213 of file secoid.c.

Definition at line 210 of file secoid.c.

Definition at line 209 of file secoid.c.

Definition at line 211 of file secoid.c.

Definition at line 221 of file secoid.c.

Definition at line 217 of file secoid.c.

Definition at line 220 of file secoid.c.

Definition at line 215 of file secoid.c.

Definition at line 223 of file secoid.c.

Definition at line 224 of file secoid.c.

Definition at line 226 of file secoid.c.

Definition at line 227 of file secoid.c.

Definition at line 218 of file secoid.c.

Definition at line 230 of file secoid.c.

Definition at line 219 of file secoid.c.

Definition at line 225 of file secoid.c.

Definition at line 222 of file secoid.c.

Definition at line 216 of file secoid.c.

Definition at line 229 of file secoid.c.

Definition at line 231 of file secoid.c.

Definition at line 414 of file secoid.c.

Definition at line 402 of file secoid.c.

Definition at line 426 of file secoid.c.

Definition at line 427 of file secoid.c.

Definition at line 428 of file secoid.c.

Definition at line 425 of file secoid.c.

Definition at line 429 of file secoid.c.

Definition at line 405 of file secoid.c.

Definition at line 411 of file secoid.c.

Definition at line 406 of file secoid.c.

Definition at line 408 of file secoid.c.

Definition at line 410 of file secoid.c.

Definition at line 407 of file secoid.c.

Definition at line 430 of file secoid.c.

Definition at line 409 of file secoid.c.

Definition at line 412 of file secoid.c.

Definition at line 417 of file secoid.c.

Definition at line 420 of file secoid.c.

Definition at line 419 of file secoid.c.

Definition at line 418 of file secoid.c.

Definition at line 421 of file secoid.c.

Definition at line 416 of file secoid.c.

Definition at line 423 of file secoid.c.

Definition at line 422 of file secoid.c.

Definition at line 403 of file secoid.c.

CONST_OID rc2cbc[] = { CIPHER, 0x02 }

Definition at line 178 of file secoid.c.

CONST_OID rc4[] = { CIPHER, 0x04 }

Definition at line 179 of file secoid.c.

CONST_OID rc5cbcpad[] = { CIPHER, 0x09 }

Definition at line 181 of file secoid.c.

Definition at line 278 of file secoid.c.

Definition at line 277 of file secoid.c.

Definition at line 279 of file secoid.c.

Definition at line 188 of file secoid.c.

Definition at line 489 of file secoid.c.

Definition at line 490 of file secoid.c.

Definition at line 491 of file secoid.c.

Definition at line 492 of file secoid.c.

Definition at line 493 of file secoid.c.

Definition at line 494 of file secoid.c.

Definition at line 495 of file secoid.c.

Definition at line 496 of file secoid.c.

Definition at line 497 of file secoid.c.

Definition at line 498 of file secoid.c.

Definition at line 499 of file secoid.c.

Definition at line 500 of file secoid.c.

Definition at line 501 of file secoid.c.

Definition at line 526 of file secoid.c.

Definition at line 527 of file secoid.c.

Definition at line 528 of file secoid.c.

Definition at line 529 of file secoid.c.

Definition at line 530 of file secoid.c.

Definition at line 531 of file secoid.c.

Definition at line 532 of file secoid.c.

Definition at line 533 of file secoid.c.

Definition at line 534 of file secoid.c.

Definition at line 535 of file secoid.c.

Definition at line 536 of file secoid.c.

Definition at line 537 of file secoid.c.

Definition at line 538 of file secoid.c.

Definition at line 539 of file secoid.c.

Definition at line 540 of file secoid.c.

Definition at line 541 of file secoid.c.

Definition at line 542 of file secoid.c.

Definition at line 543 of file secoid.c.

CONST_OID sha1[] = { ALGORITHM, 0x1a }

Definition at line 191 of file secoid.c.

CONST_OID sha256[] = { SHAXXX, 1 }

Definition at line 463 of file secoid.c.

CONST_OID sha384[] = { SHAXXX, 2 }

Definition at line 464 of file secoid.c.

CONST_OID sha512[] = { SHAXXX, 3 }

Definition at line 465 of file secoid.c.

Definition at line 436 of file secoid.c.

Definition at line 239 of file secoid.c.

CONST_OID verisignUserNotices[] = { VERISIGN, 1, 7, 1, 1 }

Definition at line 399 of file secoid.c.

Definition at line 274 of file secoid.c.

Definition at line 343 of file secoid.c.

Definition at line 337 of file secoid.c.

Definition at line 325 of file secoid.c.

Definition at line 335 of file secoid.c.

Definition at line 332 of file secoid.c.

Definition at line 334 of file secoid.c.

Definition at line 326 of file secoid.c.

Definition at line 330 of file secoid.c.

Definition at line 339 of file secoid.c.

Definition at line 340 of file secoid.c.

Definition at line 328 of file secoid.c.

Definition at line 341 of file secoid.c.

Definition at line 329 of file secoid.c.

Definition at line 324 of file secoid.c.

Definition at line 331 of file secoid.c.

Definition at line 321 of file secoid.c.

Definition at line 333 of file secoid.c.

Definition at line 338 of file secoid.c.

Definition at line 336 of file secoid.c.

Definition at line 322 of file secoid.c.

Definition at line 327 of file secoid.c.

Definition at line 323 of file secoid.c.

Definition at line 319 of file secoid.c.

Definition at line 344 of file secoid.c.

Definition at line 320 of file secoid.c.

Definition at line 242 of file secoid.c.

Definition at line 245 of file secoid.c.

Definition at line 258 of file secoid.c.

Definition at line 257 of file secoid.c.

Definition at line 255 of file secoid.c.

Definition at line 259 of file secoid.c.

Definition at line 256 of file secoid.c.

Definition at line 246 of file secoid.c.

Definition at line 249 of file secoid.c.

Definition at line 250 of file secoid.c.

Definition at line 252 of file secoid.c.

Definition at line 253 of file secoid.c.

Definition at line 254 of file secoid.c.

Definition at line 260 of file secoid.c.

Definition at line 244 of file secoid.c.

Definition at line 247 of file secoid.c.

Definition at line 248 of file secoid.c.

Definition at line 243 of file secoid.c.

Definition at line 251 of file secoid.c.