--- /dev/null
+/* crypto/objects/objects.h */\r
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\r
+ * All rights reserved.\r
+ *\r
+ * This package is an SSL implementation written\r
+ * by Eric Young (eay@cryptsoft.com).\r
+ * The implementation was written so as to conform with Netscapes SSL.\r
+ * \r
+ * This library is free for commercial and non-commercial use as long as\r
+ * the following conditions are aheared to. The following conditions\r
+ * apply to all code found in this distribution, be it the RC4, RSA,\r
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation\r
+ * included with this distribution is covered by the same copyright terms\r
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).\r
+ * \r
+ * Copyright remains Eric Young's, and as such any Copyright notices in\r
+ * the code are not to be removed.\r
+ * If this package is used in a product, Eric Young should be given attribution\r
+ * as the author of the parts of the library used.\r
+ * This can be in the form of a textual message at program startup or\r
+ * in documentation (online or textual) provided with the package.\r
+ * \r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the copyright\r
+ * notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the distribution.\r
+ * 3. All advertising materials mentioning features or use of this software\r
+ * must display the following acknowledgement:\r
+ * "This product includes cryptographic software written by\r
+ * Eric Young (eay@cryptsoft.com)"\r
+ * The word 'cryptographic' can be left out if the rouines from the library\r
+ * being used are not cryptographic related :-).\r
+ * 4. If you include any Windows specific code (or a derivative thereof) from \r
+ * the apps directory (application code) you must include an acknowledgement:\r
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"\r
+ * \r
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\r
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+ * SUCH DAMAGE.\r
+ * \r
+ * The licence and distribution terms for any publically available version or\r
+ * derivative of this code cannot be changed. i.e. this code cannot simply be\r
+ * copied and put under another distribution licence\r
+ * [including the GNU Public Licence.]\r
+ */\r
+\r
+#ifndef HEADER_OBJECTS_H\r
+#define HEADER_OBJECTS_H\r
+\r
+#define USE_OBJ_MAC\r
+\r
+#ifdef USE_OBJ_MAC\r
+#include <openssl/obj_mac.h>\r
+#else\r
+#define SN_undef "UNDEF"\r
+#define LN_undef "undefined"\r
+#define NID_undef 0\r
+#define OBJ_undef 0L\r
+\r
+#define SN_Algorithm "Algorithm"\r
+#define LN_algorithm "algorithm"\r
+#define NID_algorithm 38\r
+#define OBJ_algorithm 1L,3L,14L,3L,2L\r
+\r
+#define LN_rsadsi "rsadsi"\r
+#define NID_rsadsi 1\r
+#define OBJ_rsadsi 1L,2L,840L,113549L\r
+\r
+#define LN_pkcs "pkcs"\r
+#define NID_pkcs 2\r
+#define OBJ_pkcs OBJ_rsadsi,1L\r
+\r
+#define SN_md2 "MD2"\r
+#define LN_md2 "md2"\r
+#define NID_md2 3\r
+#define OBJ_md2 OBJ_rsadsi,2L,2L\r
+\r
+#define SN_md5 "MD5"\r
+#define LN_md5 "md5"\r
+#define NID_md5 4\r
+#define OBJ_md5 OBJ_rsadsi,2L,5L\r
+\r
+#define SN_rc4 "RC4"\r
+#define LN_rc4 "rc4"\r
+#define NID_rc4 5\r
+#define OBJ_rc4 OBJ_rsadsi,3L,4L\r
+\r
+#define LN_rsaEncryption "rsaEncryption"\r
+#define NID_rsaEncryption 6\r
+#define OBJ_rsaEncryption OBJ_pkcs,1L,1L\r
+\r
+#define SN_md2WithRSAEncryption "RSA-MD2"\r
+#define LN_md2WithRSAEncryption "md2WithRSAEncryption"\r
+#define NID_md2WithRSAEncryption 7\r
+#define OBJ_md2WithRSAEncryption OBJ_pkcs,1L,2L\r
+\r
+#define SN_md5WithRSAEncryption "RSA-MD5"\r
+#define LN_md5WithRSAEncryption "md5WithRSAEncryption"\r
+#define NID_md5WithRSAEncryption 8\r
+#define OBJ_md5WithRSAEncryption OBJ_pkcs,1L,4L\r
+\r
+#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES"\r
+#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC"\r
+#define NID_pbeWithMD2AndDES_CBC 9\r
+#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs,5L,1L\r
+\r
+#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES"\r
+#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC"\r
+#define NID_pbeWithMD5AndDES_CBC 10\r
+#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs,5L,3L\r
+\r
+#define LN_X500 "X500"\r
+#define NID_X500 11\r
+#define OBJ_X500 2L,5L\r
+\r
+#define LN_X509 "X509"\r
+#define NID_X509 12\r
+#define OBJ_X509 OBJ_X500,4L\r
+\r
+#define SN_commonName "CN"\r
+#define LN_commonName "commonName"\r
+#define NID_commonName 13\r
+#define OBJ_commonName OBJ_X509,3L\r
+\r
+#define SN_countryName "C"\r
+#define LN_countryName "countryName"\r
+#define NID_countryName 14\r
+#define OBJ_countryName OBJ_X509,6L\r
+\r
+#define SN_localityName "L"\r
+#define LN_localityName "localityName"\r
+#define NID_localityName 15\r
+#define OBJ_localityName OBJ_X509,7L\r
+\r
+/* Postal Address? PA */\r
+\r
+/* should be "ST" (rfc1327) but MS uses 'S' */\r
+#define SN_stateOrProvinceName "ST"\r
+#define LN_stateOrProvinceName "stateOrProvinceName"\r
+#define NID_stateOrProvinceName 16\r
+#define OBJ_stateOrProvinceName OBJ_X509,8L\r
+\r
+#define SN_organizationName "O"\r
+#define LN_organizationName "organizationName"\r
+#define NID_organizationName 17\r
+#define OBJ_organizationName OBJ_X509,10L\r
+\r
+#define SN_organizationalUnitName "OU"\r
+#define LN_organizationalUnitName "organizationalUnitName"\r
+#define NID_organizationalUnitName 18\r
+#define OBJ_organizationalUnitName OBJ_X509,11L\r
+\r
+#define SN_rsa "RSA"\r
+#define LN_rsa "rsa"\r
+#define NID_rsa 19\r
+#define OBJ_rsa OBJ_X500,8L,1L,1L\r
+\r
+#define LN_pkcs7 "pkcs7"\r
+#define NID_pkcs7 20\r
+#define OBJ_pkcs7 OBJ_pkcs,7L\r
+\r
+#define LN_pkcs7_data "pkcs7-data"\r
+#define NID_pkcs7_data 21\r
+#define OBJ_pkcs7_data OBJ_pkcs7,1L\r
+\r
+#define LN_pkcs7_signed "pkcs7-signedData"\r
+#define NID_pkcs7_signed 22\r
+#define OBJ_pkcs7_signed OBJ_pkcs7,2L\r
+\r
+#define LN_pkcs7_enveloped "pkcs7-envelopedData"\r
+#define NID_pkcs7_enveloped 23\r
+#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L\r
+\r
+#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData"\r
+#define NID_pkcs7_signedAndEnveloped 24\r
+#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L\r
+\r
+#define LN_pkcs7_digest "pkcs7-digestData"\r
+#define NID_pkcs7_digest 25\r
+#define OBJ_pkcs7_digest OBJ_pkcs7,5L\r
+\r
+#define LN_pkcs7_encrypted "pkcs7-encryptedData"\r
+#define NID_pkcs7_encrypted 26\r
+#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L\r
+\r
+#define LN_pkcs3 "pkcs3"\r
+#define NID_pkcs3 27\r
+#define OBJ_pkcs3 OBJ_pkcs,3L\r
+\r
+#define LN_dhKeyAgreement "dhKeyAgreement"\r
+#define NID_dhKeyAgreement 28\r
+#define OBJ_dhKeyAgreement OBJ_pkcs3,1L\r
+\r
+#define SN_des_ecb "DES-ECB"\r
+#define LN_des_ecb "des-ecb"\r
+#define NID_des_ecb 29\r
+#define OBJ_des_ecb OBJ_algorithm,6L\r
+\r
+#define SN_des_cfb64 "DES-CFB"\r
+#define LN_des_cfb64 "des-cfb"\r
+#define NID_des_cfb64 30\r
+/* IV + num */\r
+#define OBJ_des_cfb64 OBJ_algorithm,9L\r
+\r
+#define SN_des_cbc "DES-CBC"\r
+#define LN_des_cbc "des-cbc"\r
+#define NID_des_cbc 31\r
+/* IV */\r
+#define OBJ_des_cbc OBJ_algorithm,7L\r
+\r
+#define SN_des_ede "DES-EDE"\r
+#define LN_des_ede "des-ede"\r
+#define NID_des_ede 32\r
+/* ?? */\r
+#define OBJ_des_ede OBJ_algorithm,17L\r
+\r
+#define SN_des_ede3 "DES-EDE3"\r
+#define LN_des_ede3 "des-ede3"\r
+#define NID_des_ede3 33\r
+\r
+#define SN_idea_cbc "IDEA-CBC"\r
+#define LN_idea_cbc "idea-cbc"\r
+#define NID_idea_cbc 34\r
+#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L\r
+\r
+#define SN_idea_cfb64 "IDEA-CFB"\r
+#define LN_idea_cfb64 "idea-cfb"\r
+#define NID_idea_cfb64 35\r
+\r
+#define SN_idea_ecb "IDEA-ECB"\r
+#define LN_idea_ecb "idea-ecb"\r
+#define NID_idea_ecb 36\r
+\r
+#define SN_rc2_cbc "RC2-CBC"\r
+#define LN_rc2_cbc "rc2-cbc"\r
+#define NID_rc2_cbc 37\r
+#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L\r
+\r
+#define SN_rc2_ecb "RC2-ECB"\r
+#define LN_rc2_ecb "rc2-ecb"\r
+#define NID_rc2_ecb 38\r
+\r
+#define SN_rc2_cfb64 "RC2-CFB"\r
+#define LN_rc2_cfb64 "rc2-cfb"\r
+#define NID_rc2_cfb64 39\r
+\r
+#define SN_rc2_ofb64 "RC2-OFB"\r
+#define LN_rc2_ofb64 "rc2-ofb"\r
+#define NID_rc2_ofb64 40\r
+\r
+#define SN_sha "SHA"\r
+#define LN_sha "sha"\r
+#define NID_sha 41\r
+#define OBJ_sha OBJ_algorithm,18L\r
+\r
+#define SN_shaWithRSAEncryption "RSA-SHA"\r
+#define LN_shaWithRSAEncryption "shaWithRSAEncryption"\r
+#define NID_shaWithRSAEncryption 42\r
+#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L\r
+\r
+#define SN_des_ede_cbc "DES-EDE-CBC"\r
+#define LN_des_ede_cbc "des-ede-cbc"\r
+#define NID_des_ede_cbc 43\r
+\r
+#define SN_des_ede3_cbc "DES-EDE3-CBC"\r
+#define LN_des_ede3_cbc "des-ede3-cbc"\r
+#define NID_des_ede3_cbc 44\r
+#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L\r
+\r
+#define SN_des_ofb64 "DES-OFB"\r
+#define LN_des_ofb64 "des-ofb"\r
+#define NID_des_ofb64 45\r
+#define OBJ_des_ofb64 OBJ_algorithm,8L\r
+\r
+#define SN_idea_ofb64 "IDEA-OFB"\r
+#define LN_idea_ofb64 "idea-ofb"\r
+#define NID_idea_ofb64 46\r
+\r
+#define LN_pkcs9 "pkcs9"\r
+#define NID_pkcs9 47\r
+#define OBJ_pkcs9 OBJ_pkcs,9L\r
+\r
+#define SN_pkcs9_emailAddress "Email"\r
+#define LN_pkcs9_emailAddress "emailAddress"\r
+#define NID_pkcs9_emailAddress 48\r
+#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L\r
+\r
+#define LN_pkcs9_unstructuredName "unstructuredName"\r
+#define NID_pkcs9_unstructuredName 49\r
+#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L\r
+\r
+#define LN_pkcs9_contentType "contentType"\r
+#define NID_pkcs9_contentType 50\r
+#define OBJ_pkcs9_contentType OBJ_pkcs9,3L\r
+\r
+#define LN_pkcs9_messageDigest "messageDigest"\r
+#define NID_pkcs9_messageDigest 51\r
+#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L\r
+\r
+#define LN_pkcs9_signingTime "signingTime"\r
+#define NID_pkcs9_signingTime 52\r
+#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L\r
+\r
+#define LN_pkcs9_countersignature "countersignature"\r
+#define NID_pkcs9_countersignature 53\r
+#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L\r
+\r
+#define LN_pkcs9_challengePassword "challengePassword"\r
+#define NID_pkcs9_challengePassword 54\r
+#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L\r
+\r
+#define LN_pkcs9_unstructuredAddress "unstructuredAddress"\r
+#define NID_pkcs9_unstructuredAddress 55\r
+#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L\r
+\r
+#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes"\r
+#define NID_pkcs9_extCertAttributes 56\r
+#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L\r
+\r
+#define SN_netscape "Netscape"\r
+#define LN_netscape "Netscape Communications Corp."\r
+#define NID_netscape 57\r
+#define OBJ_netscape 2L,16L,840L,1L,113730L\r
+\r
+#define SN_netscape_cert_extension "nsCertExt"\r
+#define LN_netscape_cert_extension "Netscape Certificate Extension"\r
+#define NID_netscape_cert_extension 58\r
+#define OBJ_netscape_cert_extension OBJ_netscape,1L\r
+\r
+#define SN_netscape_data_type "nsDataType"\r
+#define LN_netscape_data_type "Netscape Data Type"\r
+#define NID_netscape_data_type 59\r
+#define OBJ_netscape_data_type OBJ_netscape,2L\r
+\r
+#define SN_des_ede_cfb64 "DES-EDE-CFB"\r
+#define LN_des_ede_cfb64 "des-ede-cfb"\r
+#define NID_des_ede_cfb64 60\r
+\r
+#define SN_des_ede3_cfb64 "DES-EDE3-CFB"\r
+#define LN_des_ede3_cfb64 "des-ede3-cfb"\r
+#define NID_des_ede3_cfb64 61\r
+\r
+#define SN_des_ede_ofb64 "DES-EDE-OFB"\r
+#define LN_des_ede_ofb64 "des-ede-ofb"\r
+#define NID_des_ede_ofb64 62\r
+\r
+#define SN_des_ede3_ofb64 "DES-EDE3-OFB"\r
+#define LN_des_ede3_ofb64 "des-ede3-ofb"\r
+#define NID_des_ede3_ofb64 63\r
+\r
+/* I'm not sure about the object ID */\r
+#define SN_sha1 "SHA1"\r
+#define LN_sha1 "sha1"\r
+#define NID_sha1 64\r
+#define OBJ_sha1 OBJ_algorithm,26L\r
+/* 28 Jun 1996 - eay */\r
+/* #define OBJ_sha1 1L,3L,14L,2L,26L,05L <- wrong */\r
+\r
+#define SN_sha1WithRSAEncryption "RSA-SHA1"\r
+#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption"\r
+#define NID_sha1WithRSAEncryption 65\r
+#define OBJ_sha1WithRSAEncryption OBJ_pkcs,1L,5L\r
+\r
+#define SN_dsaWithSHA "DSA-SHA"\r
+#define LN_dsaWithSHA "dsaWithSHA"\r
+#define NID_dsaWithSHA 66\r
+#define OBJ_dsaWithSHA OBJ_algorithm,13L\r
+\r
+#define SN_dsa_2 "DSA-old"\r
+#define LN_dsa_2 "dsaEncryption-old"\r
+#define NID_dsa_2 67\r
+#define OBJ_dsa_2 OBJ_algorithm,12L\r
+\r
+/* proposed by microsoft to RSA */\r
+#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64"\r
+#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC"\r
+#define NID_pbeWithSHA1AndRC2_CBC 68\r
+#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs,5L,11L \r
+\r
+/* proposed by microsoft to RSA as pbeWithSHA1AndRC4: it is now\r
+ * defined explicitly in PKCS#5 v2.0 as id-PBKDF2 which is something\r
+ * completely different.\r
+ */\r
+#define LN_id_pbkdf2 "PBKDF2"\r
+#define NID_id_pbkdf2 69\r
+#define OBJ_id_pbkdf2 OBJ_pkcs,5L,12L \r
+\r
+#define SN_dsaWithSHA1_2 "DSA-SHA1-old"\r
+#define LN_dsaWithSHA1_2 "dsaWithSHA1-old"\r
+#define NID_dsaWithSHA1_2 70\r
+/* Got this one from 'sdn706r20.pdf' which is actually an NSA document :-) */\r
+#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L\r
+\r
+#define SN_netscape_cert_type "nsCertType"\r
+#define LN_netscape_cert_type "Netscape Cert Type"\r
+#define NID_netscape_cert_type 71\r
+#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L\r
+\r
+#define SN_netscape_base_url "nsBaseUrl"\r
+#define LN_netscape_base_url "Netscape Base Url"\r
+#define NID_netscape_base_url 72\r
+#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L\r
+\r
+#define SN_netscape_revocation_url "nsRevocationUrl"\r
+#define LN_netscape_revocation_url "Netscape Revocation Url"\r
+#define NID_netscape_revocation_url 73\r
+#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L\r
+\r
+#define SN_netscape_ca_revocation_url "nsCaRevocationUrl"\r
+#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url"\r
+#define NID_netscape_ca_revocation_url 74\r
+#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L\r
+\r
+#define SN_netscape_renewal_url "nsRenewalUrl"\r
+#define LN_netscape_renewal_url "Netscape Renewal Url"\r
+#define NID_netscape_renewal_url 75\r
+#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L\r
+\r
+#define SN_netscape_ca_policy_url "nsCaPolicyUrl"\r
+#define LN_netscape_ca_policy_url "Netscape CA Policy Url"\r
+#define NID_netscape_ca_policy_url 76\r
+#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L\r
+\r
+#define SN_netscape_ssl_server_name "nsSslServerName"\r
+#define LN_netscape_ssl_server_name "Netscape SSL Server Name"\r
+#define NID_netscape_ssl_server_name 77\r
+#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L\r
+\r
+#define SN_netscape_comment "nsComment"\r
+#define LN_netscape_comment "Netscape Comment"\r
+#define NID_netscape_comment 78\r
+#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L\r
+\r
+#define SN_netscape_cert_sequence "nsCertSequence"\r
+#define LN_netscape_cert_sequence "Netscape Certificate Sequence"\r
+#define NID_netscape_cert_sequence 79\r
+#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L\r
+\r
+#define SN_desx_cbc "DESX-CBC"\r
+#define LN_desx_cbc "desx-cbc"\r
+#define NID_desx_cbc 80\r
+\r
+#define SN_id_ce "id-ce"\r
+#define NID_id_ce 81\r
+#define OBJ_id_ce 2L,5L,29L\r
+\r
+#define SN_subject_key_identifier "subjectKeyIdentifier"\r
+#define LN_subject_key_identifier "X509v3 Subject Key Identifier"\r
+#define NID_subject_key_identifier 82\r
+#define OBJ_subject_key_identifier OBJ_id_ce,14L\r
+\r
+#define SN_key_usage "keyUsage"\r
+#define LN_key_usage "X509v3 Key Usage"\r
+#define NID_key_usage 83\r
+#define OBJ_key_usage OBJ_id_ce,15L\r
+\r
+#define SN_private_key_usage_period "privateKeyUsagePeriod"\r
+#define LN_private_key_usage_period "X509v3 Private Key Usage Period"\r
+#define NID_private_key_usage_period 84\r
+#define OBJ_private_key_usage_period OBJ_id_ce,16L\r
+\r
+#define SN_subject_alt_name "subjectAltName"\r
+#define LN_subject_alt_name "X509v3 Subject Alternative Name"\r
+#define NID_subject_alt_name 85\r
+#define OBJ_subject_alt_name OBJ_id_ce,17L\r
+\r
+#define SN_issuer_alt_name "issuerAltName"\r
+#define LN_issuer_alt_name "X509v3 Issuer Alternative Name"\r
+#define NID_issuer_alt_name 86\r
+#define OBJ_issuer_alt_name OBJ_id_ce,18L\r
+\r
+#define SN_basic_constraints "basicConstraints"\r
+#define LN_basic_constraints "X509v3 Basic Constraints"\r
+#define NID_basic_constraints 87\r
+#define OBJ_basic_constraints OBJ_id_ce,19L\r
+\r
+#define SN_crl_number "crlNumber"\r
+#define LN_crl_number "X509v3 CRL Number"\r
+#define NID_crl_number 88\r
+#define OBJ_crl_number OBJ_id_ce,20L\r
+\r
+#define SN_certificate_policies "certificatePolicies"\r
+#define LN_certificate_policies "X509v3 Certificate Policies"\r
+#define NID_certificate_policies 89\r
+#define OBJ_certificate_policies OBJ_id_ce,32L\r
+\r
+#define SN_authority_key_identifier "authorityKeyIdentifier"\r
+#define LN_authority_key_identifier "X509v3 Authority Key Identifier"\r
+#define NID_authority_key_identifier 90\r
+#define OBJ_authority_key_identifier OBJ_id_ce,35L\r
+\r
+#define SN_bf_cbc "BF-CBC"\r
+#define LN_bf_cbc "bf-cbc"\r
+#define NID_bf_cbc 91\r
+#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L\r
+\r
+#define SN_bf_ecb "BF-ECB"\r
+#define LN_bf_ecb "bf-ecb"\r
+#define NID_bf_ecb 92\r
+\r
+#define SN_bf_cfb64 "BF-CFB"\r
+#define LN_bf_cfb64 "bf-cfb"\r
+#define NID_bf_cfb64 93\r
+\r
+#define SN_bf_ofb64 "BF-OFB"\r
+#define LN_bf_ofb64 "bf-ofb"\r
+#define NID_bf_ofb64 94\r
+\r
+#define SN_mdc2 "MDC2"\r
+#define LN_mdc2 "mdc2"\r
+#define NID_mdc2 95\r
+#define OBJ_mdc2 2L,5L,8L,3L,101L\r
+/* An alternative? 1L,3L,14L,3L,2L,19L */\r
+\r
+#define SN_mdc2WithRSA "RSA-MDC2"\r
+#define LN_mdc2WithRSA "mdc2withRSA"\r
+#define NID_mdc2WithRSA 96\r
+#define OBJ_mdc2WithRSA 2L,5L,8L,3L,100L\r
+\r
+#define SN_rc4_40 "RC4-40"\r
+#define LN_rc4_40 "rc4-40"\r
+#define NID_rc4_40 97\r
+\r
+#define SN_rc2_40_cbc "RC2-40-CBC"\r
+#define LN_rc2_40_cbc "rc2-40-cbc"\r
+#define NID_rc2_40_cbc 98\r
+\r
+#define SN_givenName "G"\r
+#define LN_givenName "givenName"\r
+#define NID_givenName 99\r
+#define OBJ_givenName OBJ_X509,42L\r
+\r
+#define SN_surname "S"\r
+#define LN_surname "surname"\r
+#define NID_surname 100\r
+#define OBJ_surname OBJ_X509,4L\r
+\r
+#define SN_initials "I"\r
+#define LN_initials "initials"\r
+#define NID_initials 101\r
+#define OBJ_initials OBJ_X509,43L\r
+\r
+#define SN_uniqueIdentifier "UID"\r
+#define LN_uniqueIdentifier "uniqueIdentifier"\r
+#define NID_uniqueIdentifier 102\r
+#define OBJ_uniqueIdentifier OBJ_X509,45L\r
+\r
+#define SN_crl_distribution_points "crlDistributionPoints"\r
+#define LN_crl_distribution_points "X509v3 CRL Distribution Points"\r
+#define NID_crl_distribution_points 103\r
+#define OBJ_crl_distribution_points OBJ_id_ce,31L\r
+\r
+#define SN_md5WithRSA "RSA-NP-MD5"\r
+#define LN_md5WithRSA "md5WithRSA"\r
+#define NID_md5WithRSA 104\r
+#define OBJ_md5WithRSA OBJ_algorithm,3L\r
+\r
+#define SN_serialNumber "SN"\r
+#define LN_serialNumber "serialNumber"\r
+#define NID_serialNumber 105\r
+#define OBJ_serialNumber OBJ_X509,5L\r
+\r
+#define SN_title "T"\r
+#define LN_title "title"\r
+#define NID_title 106\r
+#define OBJ_title OBJ_X509,12L\r
+\r
+#define SN_description "D"\r
+#define LN_description "description"\r
+#define NID_description 107\r
+#define OBJ_description OBJ_X509,13L\r
+\r
+/* CAST5 is CAST-128, I'm just sticking with the documentation */\r
+#define SN_cast5_cbc "CAST5-CBC"\r
+#define LN_cast5_cbc "cast5-cbc"\r
+#define NID_cast5_cbc 108\r
+#define OBJ_cast5_cbc 1L,2L,840L,113533L,7L,66L,10L\r
+\r
+#define SN_cast5_ecb "CAST5-ECB"\r
+#define LN_cast5_ecb "cast5-ecb"\r
+#define NID_cast5_ecb 109\r
+\r
+#define SN_cast5_cfb64 "CAST5-CFB"\r
+#define LN_cast5_cfb64 "cast5-cfb"\r
+#define NID_cast5_cfb64 110\r
+\r
+#define SN_cast5_ofb64 "CAST5-OFB"\r
+#define LN_cast5_ofb64 "cast5-ofb"\r
+#define NID_cast5_ofb64 111\r
+\r
+#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC"\r
+#define NID_pbeWithMD5AndCast5_CBC 112\r
+#define OBJ_pbeWithMD5AndCast5_CBC 1L,2L,840L,113533L,7L,66L,12L\r
+\r
+/* This is one sun will soon be using :-(\r
+ * id-dsa-with-sha1 ID ::= {\r
+ * iso(1) member-body(2) us(840) x9-57 (10040) x9cm(4) 3 }\r
+ */\r
+#define SN_dsaWithSHA1 "DSA-SHA1"\r
+#define LN_dsaWithSHA1 "dsaWithSHA1"\r
+#define NID_dsaWithSHA1 113\r
+#define OBJ_dsaWithSHA1 1L,2L,840L,10040L,4L,3L\r
+\r
+#define NID_md5_sha1 114\r
+#define SN_md5_sha1 "MD5-SHA1"\r
+#define LN_md5_sha1 "md5-sha1"\r
+\r
+#define SN_sha1WithRSA "RSA-SHA1-2"\r
+#define LN_sha1WithRSA "sha1WithRSA"\r
+#define NID_sha1WithRSA 115\r
+#define OBJ_sha1WithRSA OBJ_algorithm,29L\r
+\r
+#define SN_dsa "DSA"\r
+#define LN_dsa "dsaEncryption"\r
+#define NID_dsa 116\r
+#define OBJ_dsa 1L,2L,840L,10040L,4L,1L\r
+\r
+#define SN_ripemd160 "RIPEMD160"\r
+#define LN_ripemd160 "ripemd160"\r
+#define NID_ripemd160 117\r
+#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L\r
+\r
+/* The name should actually be rsaSignatureWithripemd160, but I'm going\r
+ * to continue using the convention I'm using with the other ciphers */\r
+#define SN_ripemd160WithRSA "RSA-RIPEMD160"\r
+#define LN_ripemd160WithRSA "ripemd160WithRSA"\r
+#define NID_ripemd160WithRSA 119\r
+#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L\r
+\r
+/* Taken from rfc2040\r
+ * RC5_CBC_Parameters ::= SEQUENCE {\r
+ * version INTEGER (v1_0(16)),\r
+ * rounds INTEGER (8..127),\r
+ * blockSizeInBits INTEGER (64, 128),\r
+ * iv OCTET STRING OPTIONAL\r
+ * }\r
+ */\r
+#define SN_rc5_cbc "RC5-CBC"\r
+#define LN_rc5_cbc "rc5-cbc"\r
+#define NID_rc5_cbc 120\r
+#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L\r
+\r
+#define SN_rc5_ecb "RC5-ECB"\r
+#define LN_rc5_ecb "rc5-ecb"\r
+#define NID_rc5_ecb 121\r
+\r
+#define SN_rc5_cfb64 "RC5-CFB"\r
+#define LN_rc5_cfb64 "rc5-cfb"\r
+#define NID_rc5_cfb64 122\r
+\r
+#define SN_rc5_ofb64 "RC5-OFB"\r
+#define LN_rc5_ofb64 "rc5-ofb"\r
+#define NID_rc5_ofb64 123\r
+\r
+#define SN_rle_compression "RLE"\r
+#define LN_rle_compression "run length compression"\r
+#define NID_rle_compression 124\r
+#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L\r
+\r
+#define SN_zlib_compression "ZLIB"\r
+#define LN_zlib_compression "zlib compression"\r
+#define NID_zlib_compression 125\r
+#define OBJ_zlib_compression 1L,1L,1L,1L,666L,2L\r
+\r
+#define SN_ext_key_usage "extendedKeyUsage"\r
+#define LN_ext_key_usage "X509v3 Extended Key Usage"\r
+#define NID_ext_key_usage 126\r
+#define OBJ_ext_key_usage OBJ_id_ce,37\r
+\r
+#define SN_id_pkix "PKIX"\r
+#define NID_id_pkix 127\r
+#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L\r
+\r
+#define SN_id_kp "id-kp"\r
+#define NID_id_kp 128\r
+#define OBJ_id_kp OBJ_id_pkix,3L\r
+\r
+/* PKIX extended key usage OIDs */\r
+\r
+#define SN_server_auth "serverAuth"\r
+#define LN_server_auth "TLS Web Server Authentication"\r
+#define NID_server_auth 129\r
+#define OBJ_server_auth OBJ_id_kp,1L\r
+\r
+#define SN_client_auth "clientAuth"\r
+#define LN_client_auth "TLS Web Client Authentication"\r
+#define NID_client_auth 130\r
+#define OBJ_client_auth OBJ_id_kp,2L\r
+\r
+#define SN_code_sign "codeSigning"\r
+#define LN_code_sign "Code Signing"\r
+#define NID_code_sign 131\r
+#define OBJ_code_sign OBJ_id_kp,3L\r
+\r
+#define SN_email_protect "emailProtection"\r
+#define LN_email_protect "E-mail Protection"\r
+#define NID_email_protect 132\r
+#define OBJ_email_protect OBJ_id_kp,4L\r
+\r
+#define SN_time_stamp "timeStamping"\r
+#define LN_time_stamp "Time Stamping"\r
+#define NID_time_stamp 133\r
+#define OBJ_time_stamp OBJ_id_kp,8L\r
+\r
+/* Additional extended key usage OIDs: Microsoft */\r
+\r
+#define SN_ms_code_ind "msCodeInd"\r
+#define LN_ms_code_ind "Microsoft Individual Code Signing"\r
+#define NID_ms_code_ind 134\r
+#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L\r
+\r
+#define SN_ms_code_com "msCodeCom"\r
+#define LN_ms_code_com "Microsoft Commercial Code Signing"\r
+#define NID_ms_code_com 135\r
+#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L\r
+\r
+#define SN_ms_ctl_sign "msCTLSign"\r
+#define LN_ms_ctl_sign "Microsoft Trust List Signing"\r
+#define NID_ms_ctl_sign 136\r
+#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L\r
+\r
+#define SN_ms_sgc "msSGC"\r
+#define LN_ms_sgc "Microsoft Server Gated Crypto"\r
+#define NID_ms_sgc 137\r
+#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L\r
+\r
+#define SN_ms_efs "msEFS"\r
+#define LN_ms_efs "Microsoft Encrypted File System"\r
+#define NID_ms_efs 138\r
+#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L\r
+\r
+/* Additional usage: Netscape */\r
+\r
+#define SN_ns_sgc "nsSGC"\r
+#define LN_ns_sgc "Netscape Server Gated Crypto"\r
+#define NID_ns_sgc 139\r
+#define OBJ_ns_sgc OBJ_netscape,4L,1L\r
+\r
+#define SN_delta_crl "deltaCRL"\r
+#define LN_delta_crl "X509v3 Delta CRL Indicator"\r
+#define NID_delta_crl 140\r
+#define OBJ_delta_crl OBJ_id_ce,27L\r
+\r
+#define SN_crl_reason "CRLReason"\r
+#define LN_crl_reason "CRL Reason Code"\r
+#define NID_crl_reason 141\r
+#define OBJ_crl_reason OBJ_id_ce,21L\r
+\r
+#define SN_invalidity_date "invalidityDate"\r
+#define LN_invalidity_date "Invalidity Date"\r
+#define NID_invalidity_date 142\r
+#define OBJ_invalidity_date OBJ_id_ce,24L\r
+\r
+#define SN_sxnet "SXNetID"\r
+#define LN_sxnet "Strong Extranet ID"\r
+#define NID_sxnet 143\r
+#define OBJ_sxnet 1L,3L,101L,1L,4L,1L\r
+\r
+/* PKCS12 and related OBJECT IDENTIFIERS */\r
+\r
+#define OBJ_pkcs12 OBJ_pkcs,12L\r
+#define OBJ_pkcs12_pbeids OBJ_pkcs12, 1\r
+\r
+#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128"\r
+#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4"\r
+#define NID_pbe_WithSHA1And128BitRC4 144\r
+#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids, 1L\r
+\r
+#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40"\r
+#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4"\r
+#define NID_pbe_WithSHA1And40BitRC4 145\r
+#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids, 2L\r
+\r
+#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES"\r
+#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC"\r
+#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146\r
+#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 3L\r
+\r
+#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES"\r
+#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC"\r
+#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147\r
+#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 4L\r
+\r
+#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128"\r
+#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC"\r
+#define NID_pbe_WithSHA1And128BitRC2_CBC 148\r
+#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids, 5L\r
+\r
+#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40"\r
+#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC"\r
+#define NID_pbe_WithSHA1And40BitRC2_CBC 149\r
+#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids, 6L\r
+\r
+#define OBJ_pkcs12_Version1 OBJ_pkcs12, 10L\r
+\r
+#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1, 1L\r
+\r
+#define LN_keyBag "keyBag"\r
+#define NID_keyBag 150\r
+#define OBJ_keyBag OBJ_pkcs12_BagIds, 1L\r
+\r
+#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag"\r
+#define NID_pkcs8ShroudedKeyBag 151\r
+#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds, 2L\r
+\r
+#define LN_certBag "certBag"\r
+#define NID_certBag 152\r
+#define OBJ_certBag OBJ_pkcs12_BagIds, 3L\r
+\r
+#define LN_crlBag "crlBag"\r
+#define NID_crlBag 153\r
+#define OBJ_crlBag OBJ_pkcs12_BagIds, 4L\r
+\r
+#define LN_secretBag "secretBag"\r
+#define NID_secretBag 154\r
+#define OBJ_secretBag OBJ_pkcs12_BagIds, 5L\r
+\r
+#define LN_safeContentsBag "safeContentsBag"\r
+#define NID_safeContentsBag 155\r
+#define OBJ_safeContentsBag OBJ_pkcs12_BagIds, 6L\r
+\r
+#define LN_friendlyName "friendlyName"\r
+#define NID_friendlyName 156\r
+#define OBJ_friendlyName OBJ_pkcs9, 20L\r
+\r
+#define LN_localKeyID "localKeyID"\r
+#define NID_localKeyID 157\r
+#define OBJ_localKeyID OBJ_pkcs9, 21L\r
+\r
+#define OBJ_certTypes OBJ_pkcs9, 22L\r
+\r
+#define LN_x509Certificate "x509Certificate"\r
+#define NID_x509Certificate 158\r
+#define OBJ_x509Certificate OBJ_certTypes, 1L\r
+\r
+#define LN_sdsiCertificate "sdsiCertificate"\r
+#define NID_sdsiCertificate 159\r
+#define OBJ_sdsiCertificate OBJ_certTypes, 2L\r
+\r
+#define OBJ_crlTypes OBJ_pkcs9, 23L\r
+\r
+#define LN_x509Crl "x509Crl"\r
+#define NID_x509Crl 160\r
+#define OBJ_x509Crl OBJ_crlTypes, 1L\r
+\r
+/* PKCS#5 v2 OIDs */\r
+\r
+#define LN_pbes2 "PBES2"\r
+#define NID_pbes2 161\r
+#define OBJ_pbes2 OBJ_pkcs,5L,13L\r
+\r
+#define LN_pbmac1 "PBMAC1"\r
+#define NID_pbmac1 162\r
+#define OBJ_pbmac1 OBJ_pkcs,5L,14L\r
+\r
+#define LN_hmacWithSHA1 "hmacWithSHA1"\r
+#define NID_hmacWithSHA1 163\r
+#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L\r
+\r
+/* Policy Qualifier Ids */\r
+\r
+#define LN_id_qt_cps "Policy Qualifier CPS"\r
+#define SN_id_qt_cps "id-qt-cps"\r
+#define NID_id_qt_cps 164\r
+#define OBJ_id_qt_cps OBJ_id_pkix,2L,1L\r
+\r
+#define LN_id_qt_unotice "Policy Qualifier User Notice"\r
+#define SN_id_qt_unotice "id-qt-unotice"\r
+#define NID_id_qt_unotice 165\r
+#define OBJ_id_qt_unotice OBJ_id_pkix,2L,2L\r
+\r
+#define SN_rc2_64_cbc "RC2-64-CBC"\r
+#define LN_rc2_64_cbc "rc2-64-cbc"\r
+#define NID_rc2_64_cbc 166\r
+\r
+#define SN_SMIMECapabilities "SMIME-CAPS"\r
+#define LN_SMIMECapabilities "S/MIME Capabilities"\r
+#define NID_SMIMECapabilities 167\r
+#define OBJ_SMIMECapabilities OBJ_pkcs9,15L\r
+\r
+#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64"\r
+#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC"\r
+#define NID_pbeWithMD2AndRC2_CBC 168\r
+#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs,5L,4L\r
+\r
+#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64"\r
+#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC"\r
+#define NID_pbeWithMD5AndRC2_CBC 169\r
+#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs,5L,6L\r
+\r
+#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES"\r
+#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC"\r
+#define NID_pbeWithSHA1AndDES_CBC 170\r
+#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs,5L,10L\r
+\r
+/* Extension request OIDs */\r
+\r
+#define LN_ms_ext_req "Microsoft Extension Request"\r
+#define SN_ms_ext_req "msExtReq"\r
+#define NID_ms_ext_req 171\r
+#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L\r
+\r
+#define LN_ext_req "Extension Request"\r
+#define SN_ext_req "extReq"\r
+#define NID_ext_req 172\r
+#define OBJ_ext_req OBJ_pkcs9,14L\r
+\r
+#define SN_name "name"\r
+#define LN_name "name"\r
+#define NID_name 173\r
+#define OBJ_name OBJ_X509,41L\r
+\r
+#define SN_dnQualifier "dnQualifier"\r
+#define LN_dnQualifier "dnQualifier"\r
+#define NID_dnQualifier 174\r
+#define OBJ_dnQualifier OBJ_X509,46L\r
+\r
+#define SN_id_pe "id-pe"\r
+#define NID_id_pe 175\r
+#define OBJ_id_pe OBJ_id_pkix,1L\r
+\r
+#define SN_id_ad "id-ad"\r
+#define NID_id_ad 176\r
+#define OBJ_id_ad OBJ_id_pkix,48L\r
+\r
+#define SN_info_access "authorityInfoAccess"\r
+#define LN_info_access "Authority Information Access"\r
+#define NID_info_access 177\r
+#define OBJ_info_access OBJ_id_pe,1L\r
+\r
+#define SN_ad_OCSP "OCSP"\r
+#define LN_ad_OCSP "OCSP"\r
+#define NID_ad_OCSP 178\r
+#define OBJ_ad_OCSP OBJ_id_ad,1L\r
+\r
+#define SN_ad_ca_issuers "caIssuers"\r
+#define LN_ad_ca_issuers "CA Issuers"\r
+#define NID_ad_ca_issuers 179\r
+#define OBJ_ad_ca_issuers OBJ_id_ad,2L\r
+\r
+#define SN_OCSP_sign "OCSPSigning"\r
+#define LN_OCSP_sign "OCSP Signing"\r
+#define NID_OCSP_sign 180\r
+#define OBJ_OCSP_sign OBJ_id_kp,9L\r
+#endif /* USE_OBJ_MAC */\r
+\r
+#include <openssl/bio.h>\r
+#include <openssl/asn1.h>\r
+\r
+#define OBJ_NAME_TYPE_UNDEF 0x00\r
+#define OBJ_NAME_TYPE_MD_METH 0x01\r
+#define OBJ_NAME_TYPE_CIPHER_METH 0x02\r
+#define OBJ_NAME_TYPE_PKEY_METH 0x03\r
+#define OBJ_NAME_TYPE_COMP_METH 0x04\r
+#define OBJ_NAME_TYPE_NUM 0x05\r
+\r
+#define OBJ_NAME_ALIAS 0x8000\r
+\r
+#define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01\r
+#define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+typedef struct obj_name_st\r
+ {\r
+ int type;\r
+ int alias;\r
+ const char *name;\r
+ const char *data;\r
+ } OBJ_NAME;\r
+\r
+#define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c)\r
+\r
+\r
+int OBJ_NAME_init(void);\r
+int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *),\r
+ int (*cmp_func)(const char *, const char *),\r
+ void (*free_func)(const char *, int, const char *));\r
+const char *OBJ_NAME_get(const char *name,int type);\r
+int OBJ_NAME_add(const char *name,int type,const char *data);\r
+int OBJ_NAME_remove(const char *name,int type);\r
+void OBJ_NAME_cleanup(int type); /* -1 for everything */\r
+void OBJ_NAME_do_all(int type,void (*fn)(const OBJ_NAME *,void *arg),\r
+ void *arg);\r
+void OBJ_NAME_do_all_sorted(int type,void (*fn)(const OBJ_NAME *,void *arg),\r
+ void *arg);\r
+\r
+ASN1_OBJECT * OBJ_dup(const ASN1_OBJECT *o);\r
+ASN1_OBJECT * OBJ_nid2obj(int n);\r
+const char * OBJ_nid2ln(int n);\r
+const char * OBJ_nid2sn(int n);\r
+int OBJ_obj2nid(const ASN1_OBJECT *o);\r
+ASN1_OBJECT * OBJ_txt2obj(const char *s, int no_name);\r
+int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name);\r
+int OBJ_txt2nid(const char *s);\r
+int OBJ_ln2nid(const char *s);\r
+int OBJ_sn2nid(const char *s);\r
+int OBJ_cmp(const ASN1_OBJECT *a,const ASN1_OBJECT *b);\r
+const char * OBJ_bsearch(const char *key,const char *base,int num,int size,\r
+ int (*cmp)(const void *, const void *));\r
+const char * OBJ_bsearch_ex(const char *key,const char *base,int num,\r
+ int size, int (*cmp)(const void *, const void *), int flags);\r
+\r
+int OBJ_new_nid(int num);\r
+int OBJ_add_object(const ASN1_OBJECT *obj);\r
+int OBJ_create(const char *oid,const char *sn,const char *ln);\r
+void OBJ_cleanup(void );\r
+int OBJ_create_objects(BIO *in);\r
+\r
+/* BEGIN ERROR CODES */\r
+/* The following lines are auto generated by the script mkerr.pl. Any changes\r
+ * made after this point may be overwritten when the script is next run.\r
+ */\r
+void ERR_load_OBJ_strings(void);\r
+\r
+/* Error codes for the OBJ functions. */\r
+\r
+/* Function codes. */\r
+#define OBJ_F_OBJ_ADD_OBJECT 105\r
+#define OBJ_F_OBJ_CREATE 100\r
+#define OBJ_F_OBJ_DUP 101\r
+#define OBJ_F_OBJ_NAME_NEW_INDEX 106\r
+#define OBJ_F_OBJ_NID2LN 102\r
+#define OBJ_F_OBJ_NID2OBJ 103\r
+#define OBJ_F_OBJ_NID2SN 104\r
+\r
+/* Reason codes. */\r
+#define OBJ_R_MALLOC_FAILURE 100\r
+#define OBJ_R_UNKNOWN_NID 101\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+#endif\r