#include <security_asn1/secerr.h>
#include <security_asn1/secport.h>
+#if USE_CDSA_CRYPTO
+#include <Security/cssmapple.h>
+#else
#include <Security/oidsalg.h>
#include <CommonCrypto/CommonCryptor.h>
-
+#endif
#include <pthread.h>
/* MISSI Mosaic Object ID space */
#define OI(x) { sizeof x, (uint8_t *)x }
#ifndef SECOID_NO_STRINGS
+#if USE_CDSA_CRYPTO
+#define OD(oid,tag,desc,mech,ext) { OI(oid), tag, desc, mech, ext }
+#else
#define OD(oid,tag,desc,mech,ext) { OI(oid), tag, desc, ext }
+#endif
#else
#define OD(oid,tag,desc,mech,ext) { OI(oid), tag, 0, mech, ext }
#endif
}
for ( ix = 0; ix < ( sizeof(oids) / sizeof(SECOidData) ); ix++ ) {
- oid = &oids[ix];
+ oid = &oids[ix];
+
+ PORT_Assert ( oid->offset == ix );
- PORT_Assert ( oid->offset == ix );
+ 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);
+ }
- 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 USE_CDSA_CRYPTO
+ if ( oid->cssmAlgorithm.algorithm.Length /*CSSM_ALGID_NONE*/ ) {
+ entry = PL_HashTableAdd( oidmechhash,
+ (void *)&(oid->cssmAlgorithm), (void *)oid );
+ if ( entry == NULL ) {
+ PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
+ PORT_Assert(0); /* This function should never fail. */
+ return(SECFailure);
+ }
+ }
+#endif
}
PORT_Assert (ix == SEC_OID_TOTAL);