1# This file is dual licensed under the terms of the Apache License, Version 2# 2.0, and the BSD License. See the LICENSE file in the root of this repository 3# for complete details. 4 5from __future__ import absolute_import, division, print_function 6 7INCLUDES = """ 8#include <openssl/obj_mac.h> 9""" 10 11TYPES = """ 12static const int Cryptography_HAS_X25519; 13static const int Cryptography_HAS_X448; 14static const int Cryptography_HAS_ED448; 15static const int Cryptography_HAS_ED25519; 16 17static const int NID_undef; 18static const int NID_dsa; 19static const int NID_dsaWithSHA; 20static const int NID_dsaWithSHA1; 21static const int NID_md2; 22static const int NID_md4; 23static const int NID_md5; 24static const int NID_mdc2; 25static const int NID_ripemd160; 26static const int NID_sha; 27static const int NID_sha1; 28static const int NID_sha256; 29static const int NID_sha384; 30static const int NID_sha512; 31static const int NID_sha224; 32static const int NID_sha; 33static const int NID_ecdsa_with_SHA1; 34static const int NID_ecdsa_with_SHA224; 35static const int NID_ecdsa_with_SHA256; 36static const int NID_ecdsa_with_SHA384; 37static const int NID_ecdsa_with_SHA512; 38static const int NID_pbe_WithSHA1And3_Key_TripleDES_CBC; 39static const int NID_X9_62_c2pnb163v1; 40static const int NID_X9_62_c2pnb163v2; 41static const int NID_X9_62_c2pnb163v3; 42static const int NID_X9_62_c2pnb176v1; 43static const int NID_X9_62_c2tnb191v1; 44static const int NID_X9_62_c2tnb191v2; 45static const int NID_X9_62_c2tnb191v3; 46static const int NID_X9_62_c2onb191v4; 47static const int NID_X9_62_c2onb191v5; 48static const int NID_X9_62_c2pnb208w1; 49static const int NID_X9_62_c2tnb239v1; 50static const int NID_X9_62_c2tnb239v2; 51static const int NID_X9_62_c2tnb239v3; 52static const int NID_X9_62_c2onb239v4; 53static const int NID_X9_62_c2onb239v5; 54static const int NID_X9_62_c2pnb272w1; 55static const int NID_X9_62_c2pnb304w1; 56static const int NID_X9_62_c2tnb359v1; 57static const int NID_X9_62_c2pnb368w1; 58static const int NID_X9_62_c2tnb431r1; 59static const int NID_X9_62_prime192v1; 60static const int NID_X9_62_prime192v2; 61static const int NID_X9_62_prime192v3; 62static const int NID_X9_62_prime239v1; 63static const int NID_X9_62_prime239v2; 64static const int NID_X9_62_prime239v3; 65static const int NID_X9_62_prime256v1; 66static const int NID_secp112r1; 67static const int NID_secp112r2; 68static const int NID_secp128r1; 69static const int NID_secp128r2; 70static const int NID_secp160k1; 71static const int NID_secp160r1; 72static const int NID_secp160r2; 73static const int NID_sect163k1; 74static const int NID_sect163r1; 75static const int NID_sect163r2; 76static const int NID_secp192k1; 77static const int NID_secp224k1; 78static const int NID_secp224r1; 79static const int NID_secp256k1; 80static const int NID_secp384r1; 81static const int NID_secp521r1; 82static const int NID_sect113r1; 83static const int NID_sect113r2; 84static const int NID_sect131r1; 85static const int NID_sect131r2; 86static const int NID_sect193r1; 87static const int NID_sect193r2; 88static const int NID_sect233k1; 89static const int NID_sect233r1; 90static const int NID_sect239k1; 91static const int NID_sect283k1; 92static const int NID_sect283r1; 93static const int NID_sect409k1; 94static const int NID_sect409r1; 95static const int NID_sect571k1; 96static const int NID_sect571r1; 97static const int NID_X25519; 98static const int NID_X448; 99static const int NID_ED25519; 100static const int NID_ED448; 101static const int NID_wap_wsg_idm_ecid_wtls1; 102static const int NID_wap_wsg_idm_ecid_wtls3; 103static const int NID_wap_wsg_idm_ecid_wtls4; 104static const int NID_wap_wsg_idm_ecid_wtls5; 105static const int NID_wap_wsg_idm_ecid_wtls6; 106static const int NID_wap_wsg_idm_ecid_wtls7; 107static const int NID_wap_wsg_idm_ecid_wtls8; 108static const int NID_wap_wsg_idm_ecid_wtls9; 109static const int NID_wap_wsg_idm_ecid_wtls10; 110static const int NID_wap_wsg_idm_ecid_wtls11; 111static const int NID_wap_wsg_idm_ecid_wtls12; 112static const int NID_ipsec3; 113static const int NID_ipsec4; 114static const char *const SN_X9_62_c2pnb163v1; 115static const char *const SN_X9_62_c2pnb163v2; 116static const char *const SN_X9_62_c2pnb163v3; 117static const char *const SN_X9_62_c2pnb176v1; 118static const char *const SN_X9_62_c2tnb191v1; 119static const char *const SN_X9_62_c2tnb191v2; 120static const char *const SN_X9_62_c2tnb191v3; 121static const char *const SN_X9_62_c2onb191v4; 122static const char *const SN_X9_62_c2onb191v5; 123static const char *const SN_X9_62_c2pnb208w1; 124static const char *const SN_X9_62_c2tnb239v1; 125static const char *const SN_X9_62_c2tnb239v2; 126static const char *const SN_X9_62_c2tnb239v3; 127static const char *const SN_X9_62_c2onb239v4; 128static const char *const SN_X9_62_c2onb239v5; 129static const char *const SN_X9_62_c2pnb272w1; 130static const char *const SN_X9_62_c2pnb304w1; 131static const char *const SN_X9_62_c2tnb359v1; 132static const char *const SN_X9_62_c2pnb368w1; 133static const char *const SN_X9_62_c2tnb431r1; 134static const char *const SN_X9_62_prime192v1; 135static const char *const SN_X9_62_prime192v2; 136static const char *const SN_X9_62_prime192v3; 137static const char *const SN_X9_62_prime239v1; 138static const char *const SN_X9_62_prime239v2; 139static const char *const SN_X9_62_prime239v3; 140static const char *const SN_X9_62_prime256v1; 141static const char *const SN_secp112r1; 142static const char *const SN_secp112r2; 143static const char *const SN_secp128r1; 144static const char *const SN_secp128r2; 145static const char *const SN_secp160k1; 146static const char *const SN_secp160r1; 147static const char *const SN_secp160r2; 148static const char *const SN_sect163k1; 149static const char *const SN_sect163r1; 150static const char *const SN_sect163r2; 151static const char *const SN_secp192k1; 152static const char *const SN_secp224k1; 153static const char *const SN_secp224r1; 154static const char *const SN_secp256k1; 155static const char *const SN_secp384r1; 156static const char *const SN_secp521r1; 157static const char *const SN_sect113r1; 158static const char *const SN_sect113r2; 159static const char *const SN_sect131r1; 160static const char *const SN_sect131r2; 161static const char *const SN_sect193r1; 162static const char *const SN_sect193r2; 163static const char *const SN_sect233k1; 164static const char *const SN_sect233r1; 165static const char *const SN_sect239k1; 166static const char *const SN_sect283k1; 167static const char *const SN_sect283r1; 168static const char *const SN_sect409k1; 169static const char *const SN_sect409r1; 170static const char *const SN_sect571k1; 171static const char *const SN_sect571r1; 172static const char *const SN_wap_wsg_idm_ecid_wtls1; 173static const char *const SN_wap_wsg_idm_ecid_wtls3; 174static const char *const SN_wap_wsg_idm_ecid_wtls4; 175static const char *const SN_wap_wsg_idm_ecid_wtls5; 176static const char *const SN_wap_wsg_idm_ecid_wtls6; 177static const char *const SN_wap_wsg_idm_ecid_wtls7; 178static const char *const SN_wap_wsg_idm_ecid_wtls8; 179static const char *const SN_wap_wsg_idm_ecid_wtls9; 180static const char *const SN_wap_wsg_idm_ecid_wtls10; 181static const char *const SN_wap_wsg_idm_ecid_wtls11; 182static const char *const SN_wap_wsg_idm_ecid_wtls12; 183static const char *const SN_ipsec3; 184static const char *const SN_ipsec4; 185 186static const int NID_subject_key_identifier; 187static const int NID_authority_key_identifier; 188static const int NID_policy_constraints; 189static const int NID_ext_key_usage; 190static const int NID_info_access; 191static const int NID_key_usage; 192static const int NID_subject_alt_name; 193static const int NID_issuer_alt_name; 194static const int NID_basic_constraints; 195static const int NID_issuing_distribution_point; 196static const int NID_certificate_issuer; 197static const int NID_name_constraints; 198static const int NID_crl_distribution_points; 199static const int NID_certificate_policies; 200static const int NID_inhibit_any_policy; 201 202static const int NID_private_key_usage_period; 203static const int NID_crl_number; 204static const int NID_crl_reason; 205static const int NID_invalidity_date; 206static const int NID_delta_crl; 207static const int NID_any_policy; 208static const int NID_policy_mappings; 209static const int NID_target_information; 210static const int NID_no_rev_avail; 211 212static const int NID_commonName; 213static const int NID_countryName; 214static const int NID_localityName; 215static const int NID_stateOrProvinceName; 216static const int NID_organizationName; 217static const int NID_organizationalUnitName; 218static const int NID_serialNumber; 219static const int NID_surname; 220static const int NID_givenName; 221static const int NID_title; 222static const int NID_generationQualifier; 223static const int NID_dnQualifier; 224static const int NID_pseudonym; 225static const int NID_domainComponent; 226static const int NID_pkcs9_emailAddress; 227 228static const int NID_ad_OCSP; 229static const int NID_ad_ca_issuers; 230""" 231 232FUNCTIONS = """ 233""" 234 235CUSTOMIZATIONS = """ 236#ifndef NID_X25519 237static const long Cryptography_HAS_X25519 = 0; 238static const int NID_X25519 = 0; 239#else 240static const long Cryptography_HAS_X25519 = 1; 241#endif 242#ifndef NID_ED25519 243static const long Cryptography_HAS_ED25519 = 0; 244static const int NID_ED25519 = 0; 245#else 246static const long Cryptography_HAS_ED25519 = 1; 247#endif 248#ifndef NID_X448 249static const long Cryptography_HAS_X448 = 0; 250static const int NID_X448 = 0; 251#else 252static const long Cryptography_HAS_X448 = 1; 253#endif 254#ifndef NID_ED448 255static const long Cryptography_HAS_ED448 = 0; 256static const int NID_ED448 = 0; 257#else 258static const long Cryptography_HAS_ED448 = 1; 259#endif 260""" 261